FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe #FFMPEG = ffmpeg GUETZLI = /d/projekte/tests/guetzli.git/bin/Release/guetzli.exe #GUETZLI = /home/marko/proggis/guetzli/bin/Release/guetzli DEFAULT_FFMPEG = ffmpeg #DEFAULT_FFMPEG = /c/proggis/media/editoren/ffmpeg-4.0.2-win64-static/bin/ffmpeg.exe # Für eine schnelle Komprimierung libvpx, sonst vp9 DEFAULT_VID_CODEC_HEIGHT = 360 DEFAULT_VID_CODEC_WIDTH = -2 DEFAULT_VID_CODEC_BITRATE = 500k DEFAULT_VID_CODEC = libvpx-vp9 # Standardwerte auf die benutzen Variablen schreiben, falls diese noch # nicht (z.B. aus dem Terminal heraus oder über ein IncludeCfgFile) # gesetzt worden sind VID_CODEC_BITRATE := $(if $(VID_CODEC_BITRATE),$(VID_CODEC_BITRATE),$(DEFAULT_VID_CODEC_BITRATE)) VID_CODEC_HEIGHT := $(if $(VID_CODEC_HEIGHT),$(VID_CODEC_HEIGHT),$(DEFAULT_VID_CODEC_HEIGHT)) VID_CODEC_WIDTH := $(if $(VID_CODEC_WIDTH),$(VID_CODEC_WIDTH),$(DEFAULT_VID_CODEC_WIDTH)) VID_CODEC := $(if $(VID_CODEC),$(VID_CODEC),$(DEFAULT_VID_CODEC)) defaultTargetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/))) VID_CODEC_DEADLINE := -deadline best #VID_CODEC_DEADLINE := -deadline realtime targetSourceDirectories = $(sort $(dir $(wildcard ./videos/aufnahmen/*/))) targetSourceDirectories := $(if $(targetSourceDirectories), $(targetSourceDirectories), $(defaultTargetSourceDirectories)) sourceVideos = $(wildcard videos/.forCompressing/*.video) vidstabLogs = $(addsuffix .trf, $(basename $(sourceVideos))) firstPassLogs = $(addsuffix .firstPassLog-0.log, $(basename $(sourceVideos))) webmVideos = $(addprefix videos/webm/, $(addsuffix .webm, $(basename $(notdir $(sourceVideos))))) jpegThumbs = $(addprefix videos/thumbnails/, $(addsuffix .jpg, $(basename $(notdir $(sourceVideos))))) # das result= fehlt absichtlich ffmpegVideoFilterVidstabDetect = vidstabdetect=shakiness=10:accuracy=15 # das input= fehlt absichtlich ffmpegVideoFilterVidstabTransform = vidstabtransform=optzoom=2:interpol=bicubic:smoothing=30 ffmpegVideoScaleFilter = scale=$(VID_CODEC_WIDTH):$(VID_CODEC_HEIGHT):sws_flags=lanczos, ffmpegVideoFilterDeinterlace = yadif, ffmpegVideoFilterDenoise = nlmeans, #ffmpegVideoFilterDenoise = hqdn3d, ffmpegDisplayAspectRatio = 16:9 #ffmpegDisplayAspectRatio = 9:16 .SECONDARY: $(vidstabLogs) $(firstPassLogs) .PHONY: all clean all: $(webmVideos) $(jpegThumbs) clean: $(RM) \ $(vidstabLogs) \ $(firstPassLogs) \ $(webmVideos) \ $(jpegThumbs) .PHONY: thumbnails thumbnails: $(jpegThumbs) .PHONY: echo echo: @echo $(webmVideos) @echo $(firstPassLogs) @echo $(targetSourceDirectories) # Erzeugen der Targets .PHONY: targets targets: mkdir -p videos/.forCompressing # for file in videos/aufnahmen/papaRomy/*.webm;\ # do \ # checkSum=$$(sha512sum $${file});\ # ln -f $${file} videos/.forCompressing/$${checkSum%%\ *}.video;\ # done; for directory in $(targetSourceDirectories) ;\ do for file in $${directory}/*.*;\ do \ checkSum=$$(sha512sum $${file});\ ln -f $${file} videos/.forCompressing/$${checkSum%%\ *}.video;\ done;\ done; # Die Stabilisierungsberechnung: # eventuell sollte hier die Skalierung vorgeschaltet werden... videos/.forCompressing/%.trf: videos/.forCompressing/%.video $(FFMPEG) -i $^ \ -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabDetect):result="$@" \ -f null \ - videos/.forCompressing/%.firstPassLog-0.log: videos/.forCompressing/%.video videos/.forCompressing/%.trf # -b:v $(VID_CODEC_BITRATE) \ # -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",nlmeans=s=6:p=5:r=7,$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \ # First Pass $(FFMPEG) -i $< \ -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \ -codec:v $(VID_CODEC) \ -pass 1 \ -passlogfile "$(basename $<).firstPassLog" \ -aspect $(ffmpegDisplayAspectRatio) \ -threads 1 \ -speed 4 \ -tile-columns 0 \ -frame-parallel 0 \ -g 9999 \ -aq-mode 0 \ -an \ -f webm \ -y \ /dev/null # target und dependencies müssen noch angepasst werden # Die erste Abhängigkeit muss das quellVideo sein! videos/webm/%.webm: videos/.forCompressing/%.video videos/.forCompressing/%.trf videos/.forCompressing/%.firstPassLog-0.log mkdir -p videos/webm ~/keeper/judo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $< # -b:v $(VID_CODEC_BITRATE) \ # Second Pass $(FFMPEG) -i $< \ -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4 \ -codec:v $(VID_CODEC) \ -pass 2 \ -passlogfile "$(basename $<).firstPassLog" \ <<<<<<< HEAD -deadline best \ -b:v $(shell /d/temp/cwsvJudo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<)k \ -aspect $(ffmpegDisplayAspectRatio)\ ======= $(VID_CODEC_DEADLINE) \ -b:v $(shell ~/keeper/judo/homepage/redesign2018/markdownExperiment/src/galleryHelper/getVideoDurationJson.py $<)k \ -aspect 16:9 \ >>>>>>> a763569bdbb2f100ce14b50dcb7828db4e6f4852 -threads 1 \ -speed 0 \ -tile-columns 0 \ -frame-parallel 0 \ -auto-alt-ref 1 \ -lag-in-frames 25 \ -g 9999 \ -aq-mode 0 \ -an \ -f webm \ $@ videos/thumbnails/%.png: videos/.forCompressing/%.video mkdir -p videos/thumbnails # $(FFMPEG) -i "$<" -vf "select=gt(scene\,0.4)" -frames:v 5 -vsync vfr -vf $(ffmpegVideoScaleFilter)fps=fps=1/600 "$@" # $(FFMPEG) -i "$<" -vf $(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@" # $(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoFilterDenoise)$(ffmpegVideoFilterVidstabTransform):input="$(basename $<).trf",$(ffmpegVideoScaleFilter)unsharp=5:5:0.8:3:3:0.4,thumbnail -frames:v 1 "$@" $(FFMPEG) -i "$<" -filter:v $(ffmpegVideoFilterDeinterlace)$(ffmpegVideoScaleFilter)thumbnail -frames:v 1 "$@" videos/thumbnails/%.jpg: videos/thumbnails/%.png <<<<<<< HEAD $(GUETZLI) --quality 90 "$<" "$@" ======= # $(GUETZLI) --quality 90 "$<" "$@" convert "$<" "$@" >>>>>>> a763569bdbb2f100ce14b50dcb7828db4e6f4852