I can't overlay and center a video on top of an image with ffmpeg. The output is 0 seconds long -


i have mp4 want overlay on top of jpeg. command i'm using is:

ffmpeg -y -i background.jpg -i video.mp4 -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy output.mp4 

but reason, output 0 second long thumbnail show first frame of video centred on image properly.

i have tried using -t 4 set output's length 4 seconds not work.

i doing on windows.

you need loop image. since loops indefinitely must use shortest option in overlay ends when video.mp4 ends.

ffmpeg -loop 1 -i background.jpg -i video.mp4 -filter_complex \ "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2:shortest=1" \ -codec:a copy -movflags +faststart output.mp4 

see overlay documentation more info.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -