FFMPEG- Is it possible to overlay multiple images over a video at specified intervals?
10,601
Basic method is
ffmpeg -i video -i image1 -i image2 -i image3
-filter_complex
"[0][1]overlay=x=X:y=Y:enable='between(t,23,27)'[v1];
[v1][2]overlay=x=X:y=Y:enable='between(t,44,61)'[v2];
[v2][3]overlay=x=X:y=Y:enable='gt(t,112)'[v3]"
-map "[v3]" -map 0:a out.mp4
The last image will be overlaid from t=112 seconds till end of video.
Related videos on Youtube
Author by
hack
Updated on January 15, 2020Comments
-
hack over 2 yearsI want to overlay multiple images (Say 5) in a 120 second video at specified intervals , like, between 3-7 seconds overlay image 1. Is is it possible without splitting the video in multiple parts?
-
hack about 5 yearsThanks. It is working. But there is a visible difference in quality of the video generated as output. -
Gyan about 5 yearsInsert-crf 18after the filter the complex. I assume you have libx264 in your ffmpeg build. -
hack about 5 yearsif i have a single image to be overlapped at multiple intervals, will i have to specify it in input multiple times? -
Gyan about 5 yearsNo. Just reuse the same input pad e.g.[1]. -
hack about 5 yearsHi. In this command, can we specify the input images to be overlayed in a text file? The final command getting generated is very very long. I have already put the complex filters in a script. -
Gyan about 5 yearsIt should be possible. -
hack about 5 yearsThanks. How to specify input pad in this case? Like i have 3 image path in a text file, how can we tell that overlay 1st image for these much seconds, 2nd for these seconds? -
Sunny Tambi almost 5 yearsI am also doing the same, however my need is to be millisecond precise. There i find it hard to see precise timing in image overlay. Do you have any suggestion for me? Please see my post stackoverflow.com/questions/45818266/… -
ND1010_ about 4 years@Mulvya by using this command all images will appear 23 to 27(image1) after 27 second image1 disable and image2(44 to 61) enable and then disable at 61 sec and so on am i right? but in my case after showing first image other images can not visible -
Gyan about 4 yearsPost a new Q with your full command and console output at SuperUser. -
ND1010_ about 4 yearshey @Mulvya i have asked question Link[stackoverflow.com/questions/49363053/… -
llogan over 3 yearsNot much different than Gyan's answer.