I've managed to take a divx file and convert it to mpeg audio and video streams, but whenever I try to multiplex them together into a vcd compliant mpeg system file the audio and video are always out of sync. I can't understand how. I don't know much about video conversion, but surely they should match up? After all, I've just split the original file into it's component parts, turned those parts into mpeg format and tried to stick them back together again, haven't I?

I've used mp2enc, ffmpeg and mplex to achieve the results I have so far, which are basically perfect vcd compliant files, they just aren't synced properly. Can anyone give me a clue as to what I might be doing wrong?

The command I used to get the audio was:

$ ffmpeg -i /tmp/blah.avi -f wav /tmp/out.wav && mp2enc -V -o out.mpa < out.wav

I tried doing it straight from ffmpeg but the audio was way too fast for some reason.

The command for the video was:

$ ffmpeg -i /tmp/blah.avi -f mpegvideo -b 1152 -s 352x240 out.m1v

finally to mux them together I used:

$ mplex -f 1 out.m1v out.mpa -o out.mpg

To me this seems like it should have worked. Anyone know what the problem is?