FFMPEG- Is it possible to overlay multiple images

2019-02-05 07:56发布

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?

标签: ffmpeg
2条回答
我想做一个坏孩纸
2楼-- · 2019-02-05 08:32

The following code is working to create a video with multiple overlay images with specified duration.

ffmpeg -i video -i image1 -i image2 -i image3 
-filter_complex
"[0][1]overlay=y=H-h:enable='between(t,2,4)'[v1];
 [v1][2]overlay=y=H-h:enable='between(t,6,8)'[v2];
 [v2][3]overlay=y=H-h:enable='between(t,8,10)'[v3]"
-map "[v3]" outputVideo.mp4
查看更多
男人必须洒脱
3楼-- · 2019-02-05 08:34

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.

查看更多
登录 后发表回答