I am trying to overlay 10 different images on a 10 second video. I am currently able to overlay one image over the entire time span of the video using FFMPEG. I want to be able to see a different image every sec on the video.
How can i achieve this if it is possible?
Regards, Reuben
Yes the command should then look similar to this:
ffmpeg -y
-i foo.mp4 -i foo.jpg -i bar.jpg [...put more pics here...]
-filter_complex "
[0:v][1:v] overlay=25:25:enable='between(t,0,1)' [tmp];
[tmp][2:v] overlay=25:25:enable='between(t,1,2)' [tmp]
...continue the same way...
"
bar.mp4
An easy method assuming you have an ordered sequence of images:
ffmpeg -i video.mp4 -pattern_type glob -framerate 1 -i "*.png" \
-filter_complex overlay output.mp4
The downside is that all input images need to be the same width, height, and pixel format: otherwise the overlaid frames may not display properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With