diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2020-08-28 15:43:48 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2020-08-28 15:43:48 -0400 |
commit | f80b729d7b21b67503e8f497d10bf61a454698e5 (patch) | |
tree | a548b7eaec6a4b7391eb2e9e972d30ca2aca1397 /video.mk | |
parent | f6a9687a80d3bfcf86079305320d4930f72295a8 (diff) | |
download | makefile_templates-f80b729d7b21b67503e8f497d10bf61a454698e5.tar.gz makefile_templates-f80b729d7b21b67503e8f497d10bf61a454698e5.zip |
added video.mk to process videos
Diffstat (limited to 'video.mk')
-rw-r--r-- | video.mk | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/video.mk b/video.mk new file mode 100644 index 0000000..abc6bd0 --- /dev/null +++ b/video.mk @@ -0,0 +1,38 @@ +CLEAN_TARGETS += clean_video +REAL_CLEAN_TARGETS += real_clean_video + +rawDir = rawVideo +recodedDir = recodedVideo + +dest_dir_video ?= $(dest_dir)/$(recodedDir) +destination_dirs += $(dest_dir_video) + +rawVideo = $(wildcard $(rawDir)/*.mp4) +recoded_video_from_raw = $(rawVideo:$(rawDir)/%=$(recodedDir)/%) +recoded_video_dest_targets = $(rawVideo:$(rawDir)/%=$(dest_dir_video)/%) + +recoded_video: $(recoded_video_from_raw) + +$(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 $@ + +install_recoded_video: $(recoded_video_dest_targets) + +# $(dest_dir_video): + # $(INSTALL) -d -m 0755 '$@' + +$(recoded_video_dest_targets): $(dest_dir_video)/% : $(recodedDir)/% | $(dest_dir_video) +ifneq ($(strip $(recoded_video_from_raw)),) + $(INSTALL) -m 0644 '$<' '$@' +endif + +clean_video: + +real_clean_video: +ifneq ($(strip $(recoded_video_from_raw)),) + rm -f $(recoded_video_from_raw) +endif + |