Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ffmpeg how can I get the overlay to apply to all images in the slideshow

This command applies the overlay image to only the first image of the slideshow series. I messed with labeling and can’t figure out the correct labels to get the overlay to apply to all images in the video.

/opt/bin/ffmpeg -y -framerate 1/3 -start_number 1 -i %01d.jpg -i $watermark.png -filter_complex "pad=500:500:(500-iw*min(500/iw\,500/ih))/2:(500-ih*min(500/iw\,500/ih))/2:color=white,overlay=250:420" out.mp4 2>&1

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

See this works:

/opt/bin/ffmpeg -y -framerate 1/3 -start_number 1 -i %01d.jpg \
                -loop 1 -framerate 1/3 -i $watermark.png \
                -filter_complex "pad=500:500:(500-iw*min(500/iw\,500/ih))/2:(500-ih*min(500/iw\,500/ih))/2:color=white,overlay=250:420:shortest=1" \
                out.mp4 2>&1

If you want to show the same overlay image on all frames, you need to loop the overlay image. Since the looping will go forever, you need to stop with -shortest option to stop encoding when the first input ends.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading