summaryrefslogtreecommitdiff
path: root/video.mk
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2020-10-14 22:45:15 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2020-10-14 22:45:15 -0400
commit2691b6d549aabaf5756860917c683c891ea6b5ad (patch)
tree38cc926c183c1db9a9cf6f30f3158512ddd951e0 /video.mk
parent728fec5d4474f440f8ef229901e4c2ca02bd83ea (diff)
downloadmakefile_templates-2691b6d549aabaf5756860917c683c891ea6b5ad.tar.gz
makefile_templates-2691b6d549aabaf5756860917c683c891ea6b5ad.zip
video makefile is more general and has more settings
Diffstat (limited to 'video.mk')
-rw-r--r--video.mk18
1 files changed, 10 insertions, 8 deletions
diff --git a/video.mk b/video.mk
index 30b95c2..8d4a4cf 100644
--- a/video.mk
+++ b/video.mk
@@ -11,19 +11,21 @@ ffmpegOptions ?= -movflags faststart -r 15 -c:v libx264 -preset veryfast -tune s
# 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
+rawDir ?= rawVideo
+recodedDir ?= recodedVideo
+readyDir ?= readyVideo
+video_ext_in ?= mp4
+video_ext_out ?= mp4
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)/%)
+rawVideo = $(wildcard $(rawDir)/*.$(video_ext_in))
+recoded_video_from_raw = $(rawVideo:$(rawDir)/%.$(video_ext_in)=$(recodedDir)/%.$(video_ext_out))
+recoded_video_dest_targets = $(rawVideo:$(rawDir)/%.$(video_ext_in)=$(dest_dir_video_recoded)/%.$(video_ext_out))
-readyVideo = $(wildcard $(readyDir)/*.mp4)
+readyVideo = $(wildcard $(readyDir)/*.$(video_ext_out))
ready_video_dest_targets = $(readyVideo:$(readyDir)/%=$(dest_dir_video_ready)/%)
@@ -32,7 +34,7 @@ recoded_video: $(recoded_video_from_raw)
$(recodedDir):
$(INSTALL) -d -m 0755 '$@'
-$(recodedDir)/% : $(rawDir)/% | $(recodedDir)
+$(recodedDir)/%.$(video_ext_out) : $(rawDir)/%.$(video_ext_in) | $(recodedDir)
ffmpeg -i $< $(ffmpegOptions) $@
install_recoded_video: $(recoded_video_dest_targets)