[FFmpeg-user] Question about concat protocol

Nicolas George nicolas.george at normalesup.org
Sun Oct 28 09:41:11 CET 2012


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

The problem is visible here, and fortunately it is the easiest one: in the
second file, the audio and video do not start at exactly the same time.
Therefore, the STARTPTS value that you subtract to both is not the same,
thus causing the desync: 1210.366744-1210.161144=0.2056 is very visible.

I can suggest two way of fixing this:

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.

Unfortunately, if the video frames that are missing at the start of the
second file are present at the end of the first file (you may be able to see
them with ffprobe -show_frames), then this solution will cause first some
silence to sync the frames at the end of the first file, and then a frozen
frame to sync the audio at the beginning of the second file. If this happens
during a fade to black, it is not much of an issue. But if it happens
anywhere else, this is ugly.

The other solution would be to concatenate the video and audio separately.
If the inputs are really in sync all the way long, it should produce the
correct result.

But I notice that in both your files, the video is stream #0 and the audio
is stream #1. Since on top of that the format is VOB, I believe you should
be using the concat protocol rather than the concat filter.

> >Nicolas George <mailto:nicolas.george at normalesup.org>

Please remember that the convention on this list is not to top-post.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20121028/7de7e50b/attachment.asc>


More information about the ffmpeg-user mailing list