[FFmpeg-user] get in-time for clips after filter_complex concat

Erik Blankinship erikb at mediamods.com
Wed Dec 7 15:40:28 EET 2016

Here is a link to the videos I am using to try and solve this problem:

Also at that link is the python script I use to measure the clips'

To recap: I want to concat videos, but blank footage between them, *and* know
the *exact* in-time for each video.
It would be super if there were a way to make the in-times on a rounded
second, but my ffmpeg-fu is not that strong.

Help greatly appreciated!

On Tue, Nov 29, 2016 at 5:46 PM, Erik Blankinship <erikb at mediamods.com>

> I've concatenated some videos (with audio tracks) together using ffmpeg's
> filter_complex. Between each video is a blank video (black with silent
> audio).
> #the blank video
> ffmpeg -f lavfi -i color=c=black:s={w}x{h}:d={duration} -f lavfi -i aevalsrc=0:c=2:d={duration} {target_file}
> #concat the videos
> ffmpeg -i b.mp4 -i clip0.mp4 -i clip1.mp4 -i clip2.mp4 -i clip3.mp4 -filter_complex '[1:0] [1:1] [0:0] [0:1] [2:0] [2:1] [0:0] [0:1] [3:0] [3:1] [0:0] [0:1] [4:0] [4:1] concat=n=7:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' argh.mp4 -report
> Once created, the resultant video looks great and sounds great!
> Now I need to know the exact time or frame the videos are inserted into
> the output file.
> My attempts to sum up the durations of the clips which were used to make
> the output movie often leaves me off by one frame.
> I got the durations for the clips using ffprobe and have tried using the
> audio durations, video durations, and the "format" durations. However,
> whichever of the clip durations I sum to determine the inpoint of the clip
> in the concatenated video is off by ~1 frame for some of the last clips :-/
> What is the right way to solve this problem? Is there a better way to
> construct my video so that I can accurately find the inpoints in the
> concatenated video?
> (If it is helpful I can post the videos somewhere).

More information about the ffmpeg-user mailing list