Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFMPEG- Is it possible to overlay multiple images over a video at specified intervals?

Tags:

ffmpeg

I 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?

like image 253
hack Avatar asked Mar 22 '17 05:03

hack


1 Answers

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.

like image 76
Gyan Avatar answered Oct 03 '22 06:10

Gyan