Kagami / boram

:film_strip: Cross-platform graphical WebM converter
https://github.com/Kagami/boram/releases
439 stars 30 forks source link

[Feature request] tpad support #81

Open ghost opened 2 years ago

ghost commented 2 years ago

I hope this won't be as niche as I think but would it be possible to add a tpad option?

I find this filter especially useful when encoding very short videos that might benefit from additional padding at the beginning or end due to an approaching jump cut. Example: without tpad, with tpad (right click on the video and enable Loop or it won't be as evident).

I am not sure how this would work with audio on, so limiting this feature for encodes without audio would be an acceptable compromise. Also moving the -t flag before -i or adding the delay/pad to -t itself is a must or tpad will be completely ignored. I think the former would be a much easier solution to implement.

The following is an example of the raw arguments generated by boram after adding the tpad filter to the mix and moving the -t flag before -i to make the filter work properly:

-ss <start> -t <duration> -i <input> -map 0:v:0 -threads 8 -c:v libvpx-vp9 -speed 1 -tile-columns 6 -row-mt 1 \
-frame-parallel 0 -b:v 0 -crf 25 -auto-alt-ref 1 -lag-in-frames 25 -g 128 -pix_fmt yuv420p \
-vf "crop=w=1072:h=1072:x=520:y=32,scale=540:540,tpad=stop_mode=clone:stop_duration=1,setsar=1" -f webm
ghost commented 2 years ago

On a side note, appending tpad AFTER scale will make the process faster