[MPlayer-users] Concatenating AVI files - audio sync problem

Ian Pickworth ian at pickworth.me.uk
Thu Feb 24 19:05:17 CET 2005


I have two AVI files, and I want to concatenate them to make one AVI 
file, however, I cannot get the sound in the second file to be properly 
syncronised in the concatenated version, its always about a second out 
of sync.

Both files are encoded identically (MJPEG), having been created using 
mencoder -ss and -endpos options from an original AVI file (also 
recorded using mencoder).
eg:
mencoder -oac copy -ovc copy -ss 186 -o 2.avi 2005-02-13_21-46_CH4.avi

I have tried the following:

1)
cat 1.avi 2.avi | mencoder -noidx -ovc copy -oac copy -o output.avi -

This stops at the end of 1.avi, so no concatenation. (I saw this on 
Google as an example of concatenating AVI files, which implied it should 
work.)

2)
cat 1.avi 2.avi >cat.avi
mencoder -noidx -ovc copy -oac copy -o output.avi cat.avi

This gives a concatenated file, but the audio is out of sync by about a 
second from the start of the second part. I also tried -forceidx instead 
of -noidx and that made no difference.

3)
cat 1.avi 2.avi >cat.avi
cat cat.avi | mencoder -noidx -ovc copy -oac copy -o output.avi -

Same result as 1), ie stops at end of 1.avi.

If I play back (using either mplayer or xine) 1.avi and 2.avi 
separately, the sound is in sync for both.

Is there a way of concatenating two AVI files in this way and keeping 
the sound in sync for the second (third etc) parts?

Thanks
Ian




More information about the MPlayer-users mailing list