[FFmpeg-user] Question about concat protocol

Dennis Volodomanov volodomanov at gmail.com
Thu Oct 18 15:57:58 CEST 2012


On 11/10/2012 9:01 PM, Nicolas George wrote:
> This is possible, but since you want to combine several streams into one,
> you can not just use the -map option, you have to use the complex filters
> mechanism. Look in the doc, especially the examples for the concat filter.
>

I finally had a chance to do this and it's almost working, but not quite...

The problem is that (on the same files), if I use just "concat:" it's 
all ok, but if I use -filters_complex, the moment the stitch occurs, 
there's a tiny pause and then audio becomes a tiny bit out of synch. The 
second problem, is that it seems to eat up a lot more memory (well into 
2GBs), while "concat" didn't seem to need that much. Memory aside, the 
synch issue is serious, but perhaps I'm doing something wrong.

The command line (FFmpeg latest from git):

ffmpeg.exe -i "file1.vob" -i "file2.vob" -i "file3.vob" -i "file4.vob" 
-c:v wmv2  -b:v 4288000  -r 29.97 -filter_complex "[0:v] 
setpts=PTS-STARTPTS [v0]; [0:a] asetpts=PTS-STARTPTS [a0]; [1:v] 
setpts=PTS-STARTPTS [v1]; [1:a] asetpts=PTS-STARTPTS [a1]; [2:v] 
setpts=PTS-STARTPTS [v2]; [2:a] asetpts=PTS-STARTPTS [a2]; [3:v] 
setpts=PTS-STARTPTS [v3]; [3:a] asetpts=PTS-STARTPTS [a3]; [v0] [a0] 
[v1] [a1] [v2] [a2] [v3] [a3] concat=n=4:v=1:a=1 [v] [a]; [v] yadif, 
format=yuv420p [vs]" -map [vs]  -c:a wmav2  -b:a 192000  -ar 48000 -ac 
2  -map [a]  -f asf -async 1  -thread_type slice "out.wmv"

I've tried with and without "async 1" with the same result. With it, 
it's a bit better, I think. The thread_type makes it go faster.

As you can imagine, there's lots of output, but perhaps the interesting 
bits are when one file ends and another starts. There's the following, 
perhaps it makes sense to you:

frame=68511 fps= 81 q=2.0 size=  991348kB time=00:38:06.38 
bitrate=3551.9kbits/s
frame=68553 fps= 81 q=2.0 size=  991716kB time=00:38:07.79 
bitrate=3551.1kbits/s
ac-tex damaged at 31 1
[mpeg2video @ 04720920] Warning MVs not available
[mpeg2video @ 04720920] concealing 1276 DC, 1276 AC, 1276 MV errors in B 
frame
[ac3 @ 017642a0] incomplete frame
[ac3 @ 01735ba0] frame sync error
Error while decoding stream #2:1: Error number -1 occurred
frame=68590 fps= 81 q=2.0 size=  992473kB time=00:38:08.90 
bitrate=3552.1kbits/s
frame=68626 fps= 81 q=2.0 size=  993232kB time=00:38:10.09 
bitrate=3552.9kbits/s

I appreciate your help and input. Thanks!

    Dennis



More information about the ffmpeg-user mailing list