[FFmpeg-user] Question about concat protocol

Dennis Volodomanov volodomanov at gmail.com
Sun Oct 28 11:42:50 CET 2012


Nicolas George wrote:
>
> 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.


Ok, thanks for explaining this - I can now look through other files and 
I suspect it'll be similar.

>
> 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.


Yes, I've tried something similar and since this happens right in the 
middle of an action scene, it does cause a visual stutter.

>
> 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.


Yes, in one of my first posts on this issue, I said that using the 
concat protocol works, but it doesn't work in other cases (e.g. when 
stream indexes are not the same between files or if I need to change the 
output fps or the aspect ratio). I was trying to find a semi-automatic 
solution where I could use the concat filter and it does work in most 
cases I've tried, so it's not too bad. Perhaps I'll just have two 
solutions - one with a filter for complex cases and another with the 
protocol for simple ones.

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


Yes, sorry - I thought I deleted all the replies below...

Thank you for your help - I now have a direction which I can explore 
further :)

Best regards,

Dennis


More information about the ffmpeg-user mailing list