blob: 30b95c27039c2b83a12fb605e9f19adc019ff1e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
CLEAN_TARGETS += clean_video
REAL_CLEAN_TARGETS += real_clean_video
## Video encoder options
# with added voice low-pass filter and frame rate reduced to 15 (good for slides)
ffmpegOptions ?= -movflags faststart -r 15 -c:v libx264 -preset veryfast -tune stillimage -c:a libfdk_aac -vbr 1 -cutoff 4000
# remove audio track and recode video (good for slides)
#ffmpegOptions ?= -movflags faststart -r 15 -c:v libx264 -preset veryfast -tune stillimage -an
# remove audio track and recode video (do not change frame rate)
# ffmpegOptions ?= -movflags faststart -c:v libx264 -preset veryfast -tune stillimage -an
# recode video with no filters
# ffmpegOptions ?= -movflags faststart -c:v libx264 -preset veryfast -tune stillimage -c:a libfdk_aac -vbr 1
rawDir = rawVideo
recodedDir = recodedVideo
readyDir = readyVideo
dest_dir_video_recoded ?= $(dest_dir)/$(recodedDir)
dest_dir_video_ready ?= $(dest_dir)/$(readyDir)
destination_dirs += $(dest_dir_video_recoded) $(dest_dir_video_ready)
rawVideo = $(wildcard $(rawDir)/*.mp4)
recoded_video_from_raw = $(rawVideo:$(rawDir)/%=$(recodedDir)/%)
recoded_video_dest_targets = $(rawVideo:$(rawDir)/%=$(dest_dir_video_recoded)/%)
readyVideo = $(wildcard $(readyDir)/*.mp4)
ready_video_dest_targets = $(readyVideo:$(readyDir)/%=$(dest_dir_video_ready)/%)
recoded_video: $(recoded_video_from_raw)
$(recodedDir):
$(INSTALL) -d -m 0755 '$@'
$(recodedDir)/% : $(rawDir)/% | $(recodedDir)
ffmpeg -i $< $(ffmpegOptions) $@
install_recoded_video: $(recoded_video_dest_targets)
install_ready_video: $(ready_video_dest_targets)
# $(dest_dir_video_recoded):
# $(INSTALL) -d -m 0755 '$@'
$(recoded_video_dest_targets): $(dest_dir_video_recoded)/% : $(recodedDir)/% | $(dest_dir_video_recoded)
ifneq ($(strip $(recoded_video_from_raw)),)
$(INSTALL) -m 0644 '$<' '$@'
endif
$(ready_video_dest_targets): $(dest_dir_video_ready)/% : $(readyDir)/% | $(dest_dir_video_ready)
ifneq ($(strip $(readyVideo)),)
$(INSTALL) -m 0644 '$<' '$@'
endif
clean_video:
real_clean_video:
ifneq ($(strip $(recoded_video_from_raw)),)
rm -f $(recoded_video_from_raw)
endif
|