Overlay video after set time offset with FFmpeg

后端 未结 2 1540
广开言路
广开言路 2021-01-04 08:58

I\'m trying to add overlays to an input video with ffmpeg that appear some time after the video starts.

The basic way to add an overlay is:

ffmpeg -i         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-04 09:08

    According to the limited FFmpeg overlay documentation, the process expects that both videos have the same timestamp (e.g., 0:00:00:00) value to keep things in sync, and warns if not done then the avi.out will have an unwanted offset from the overlay.avi video file used.

    However, you can use that that fact and take advantage of it!

    It's then conceivable that if the overlay.avi video has a starting timestamp with the desired offset which is required on the in.avi input video, then the overlay.avi video will fire at that same timestamp (provided by in.avi) to create the expected outcome for the out.avi video.

    The only bad news is the .avi container doesn't have timestamps, unlike .mp4 or .mkv file formats that do. You will have to switch to a file format that supports *timestamps* for this to work (e.g., overlay.mp4 or overlay.mkv) for creating the final output video file required.

提交回复
热议问题