I'm new to mencoder and have been playing around with it for a bit. Right now, as a test scenario, I demuxed an .mkv with mkvtoolnix and am re-encoding and re-muxing some of the streams. I managed to burn the subs into a copy of the video stream, which is cool. But now I'm having issues with encoding and re-muxing the audio.

The audio streams were in .aac format, and I want to convert them to .mp3 format and re-mux them into the .avi video streams (one with the subs and one without). I tried running the following:

mencoder -oac mp3lame -ovc copy -o test.avi -audiofile Track2.aac Track1.avi

But throughout the process I get lots of "skipping frame" and "duplicate frame" messages, then a whole bunch of sync errors at the end of the encoding. And the resulting file is very out of sync.

What am I doing wrong? Any help would be much appreciated, thank you.