I am trying to apply the overlay filter on the video to blend a single image for a few seconds. Since my video duration is about 1 min it seems wasteful when FFMPEG tries to re-encode the whole video again instead of reencoding the portion of the video that needs to be altered.
My blend video command is:
ffmpeg -i beach.mp4 -i logo.png
-filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'"
-pix_fmt yuv420p -c:a copy output.mp4
Does anyone knows how can I avoid this ? (I was thinking to split the video, but is seems that the video can not be split accurately by specifying the start and the end frame)
-c copy
. Then use the concat demuxer to join them. Note that the two resulting segments to be joined must match parameters (codec, timebase, etc), and you'll need to cut on a keyframe for best results. A lot of work for a one minute video. My laziness would tell me just re-encode it all or simply not deal with the overlay. If you're using a web based player you can have it add the logo instead.