Is it possible to overlay an image on each frame of the video using FFMPEG

I am trying to overlay 10 different images on a 10 second video. Currently, I can overlay one image for the entire duration of the video using FFMPEG. I want each time to display a different image on the video.

How can I achieve this if possible?

Regards, Reuben

+4
source share
2 answers

Yes, the command should look something like 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
+2
source

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

, , : .

+2

Source: https://habr.com/ru/post/1623385/


All Articles