[MEncoder-users] Problem re-encoding matroska xvid+ac3 file

Oleynik Phil Oleynik.Phil at mail.ioffe.ru
Thu May 26 16:37:52 CEST 2005


Maciej J. Woloszyk wrote:

>Hi,
>I've been using mencoder for quite some time without any significant problems. 
>However lately I've been downloading some anime files some of which are 
>contained in matroska files. As my standalone DVD player does not support 
>matroska I need to re-encode it to standard avi (hardcoding subs). Problem is 
>the input files seems to be vop packed xvid's with ac3 audio and mencoder 
>can't reencode them properly - I get some horrible A/V desync whatever I try. 
>And when I try to use just stream copy to transfer both audio and video 
>streams into avi container using:
>mencoder -oac copy -ovc copy -o output.avi input.mkv
>It starts fine and after some 5000 frames I get the message "Too many audio 
>packets in the buffer" and it stops and effecting 3 minutes of the output 
>file is broken - it has A/V desync and some compression artifacts.
>
>Is there any way to make it re-encode correctly? I don't understend why 
>mplayer can play the input file perfectly fine and mencoder can't re-encode 
>it. Is there some difference in code used by mplayer and mencoder? Shouldn't 
>both programs use the same mechanisms?
>
>Thanks in advance for any help,
>
>M.
>PS. I've been trying to solve this problem for a few days so I already tried 
>simple soultions I could think about - none of them worked. Even using 
>Windows VirtualDub solves problem only partially - 5 of 12 files can then be 
>re-encoded correctly.
>  
>
I know your problem. I had it in the same way, with AAC sound. I solved 
it in my special way,
I have an opinion that 5.1 is a little insane thing, because probably, 
nobody has 5+1 ears ;).
So I am going to advice to downmix to stereo. You may try not to do it, 
maybe it'll work also for 5.1.

1. Extract PCM WAV from mkv file with mplayer.
2. Encode it with anything you wish, I used OGG
3. Put it to the original matroska with --disable-lacing key.
4. remix matroska without original sound, keeping your OGG stream with 
--disable-lacing key.
5. Feed it to mencoder, as usual.

I do not know why it works, so do not ask ^-^. Probably it is because 
buggy lacing algorithm in early
mkvtoolnixes.

Philipp




More information about the MEncoder-users mailing list