[FFmpeg-user] Question about concat protocol

Jan Ehrhardt phpdev at ehrhardt.nl
Mon Oct 29 15:06:28 CET 2012


Nicolas George in gmane.comp.video.ffmpeg.user (Sun, 28 Oct 2012
09:41:11 +0100):
>Le septidi 7 brumaire, an CCXXI, Dennis Volodomanov a écrit :
>> The second VOB dump:
>
>> [FRAME]
>> media_type=audio
>> key_frame=1
>> pkt_pts=108914503
>> pkt_pts_time=1210.161144
>
>> [FRAME]
>> media_type=video
>> key_frame=0
>> pkt_pts=108933007
>> pkt_pts_time=1210.366744
>
>You can replace STARTPTS by 1210.161144 explicitly. If you want to make this
>automatic, you will need to parse ffprobe's output to get the value.

Couldn't this be fixed within FFMpeg by adding an extra variable to be
used by the complex filter? Something like MINSTARTPTS which is the
minimum of the STARTPTS's of all streams or FIRSTPTS = the PTS of the
first frame in the file, whatever type it is. It really seems odd to
parse something from ffprobe's output and insert that into the
filter_complex setup, when FFMpeg can do that all by itself.

Then the filter setup could be something like:

-filter_complex " \
	[0:v]  setpts=PTS-FIRSTPTS [v0]; \
	[0:a] asetpts=PTS-FIRSTPTS [a0]; \
	[1:v]  setpts=PTS-FIRSTPTS [v1]; \
	[1:a] asetpts=PTS-FIRSTPTS [a1]; \
	[v0] [a0] [v1] [a1] concat=n=2:v=1:a=1 [v] [a];"

Because FIRSTPTS is independent of the stream, A/V sync should stay as
it was. The problem with the missing video frames (or the padded
silence) at the end of the previous file is not solved this way, but A/V
desync is avoided.

Jan



More information about the ffmpeg-user mailing list