[FFmpeg-user] Replace part of video with series of images

Joshua Grauman jnfo-c at grauman.com
Mon Jan 29 19:09:10 EET 2018

Hi all,

Would someone mind helping me to get a commandline correct?

I have a video, screencast.avi, of utvideo with transparency.

I extract a couple seconds of images from screencast.avi like:

ffmpeg -ss 31 -t 2 -i screencast.avi filename%03d.png

I would like to edit the images and then "put them back" into the video, 
replacing the appropriate frames.

I know how to use the overlay filter, but don't know how to make it use 
the whole series of images at the correct time. Plus, I can't simply 
overlay the video as it has transparency. I would need to replace the 
frames, or blank the appropriate frames before overlaying.

Thanks for help getting the command correct!


Here are my attempts for anyone interested:

This command uses all the images, but doesn't start and end them at the 
right place:

ffmpeg -i screencast.avi -pattern_type glob -i "filename*.png" -filter_complex overlay output.avi

This command puts the overlay in the correct frames, but only uses a 
single .png file, not all of them:

ffmpeg -i screencast.avi -pattern_type glob -i "filename*.png" -filter_complex "overlay=0:0:enable='between(t,2,3)'" output.avi

Plus, both commands incorrectly overlay the transparent images, rather 
than replacing the frames.

More information about the ffmpeg-user mailing list