5

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

ReubenCH
  • 123
  • 1
  • 9

2 Answers2

4

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
Dimitri Podborski
  • 3,714
  • 3
  • 19
  • 31
3

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.

llogan
  • 121,796
  • 28
  • 232
  • 243