diff options
-rw-r--r-- | video.mk | 34 |
1 files changed, 28 insertions, 6 deletions
@@ -1,15 +1,31 @@ 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 ?= $(dest_dir)/$(recodedDir) -destination_dirs += $(dest_dir_video) +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_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) @@ -17,18 +33,24 @@ $(recodedDir): $(INSTALL) -d -m 0755 '$@' $(recodedDir)/% : $(rawDir)/% | $(recodedDir) - ffmpeg -i $< -movflags faststart -r 15 -c:v libx264 -preset veryfast -tune stillimage -c:a libfdk_aac -vbr 1 -cutoff 4000 $@ + ffmpeg -i $< $(ffmpegOptions) $@ install_recoded_video: $(recoded_video_dest_targets) +install_ready_video: $(ready_video_dest_targets) -# $(dest_dir_video): +# $(dest_dir_video_recoded): # $(INSTALL) -d -m 0755 '$@' -$(recoded_video_dest_targets): $(dest_dir_video)/% : $(recodedDir)/% | $(dest_dir_video) +$(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: |