Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an existing MPG (MPEG-1) video file. The video has no sound. I have an audio track (currently in MP3 format, but I could record it in AC3 or some other required format if that's what it will take for it to work). The two files are the same "length" (meaning that when played, both are 5 seconds long, for example).

I just want to add the audio track on to the video track, using mencoder. The resulting video file can be another MPEG file, or it can be an AVI file (any format playable by a standard Windows Vista computer, at any rate).

I have tried using MEncoder to do the trick, but every time the resulting video file seems very corrupted. Here's the command I'm currently using:

.\mplayer\mencoder.exe -ovc copy -audiofile temp.mp3 -oac copy temp.mpg -of mpeg -o output.mpg

I have also tried:

.\mplayer\mencoder.exe -ovc copy -audiofile temp.ac3 -oac copy temp.mpg -o output.avi
share|improve this question

migrated from Oct 13 '09 at 13:33

This question came from our site for professional and enthusiast programmers.

a little old but the way to do this would be

mencoder -ovc copy -audiofile silent.mp3 -oac copy input.avi -o output.avi
share|improve this answer

You can do this with ffmpeg quite easily:

ffmpeg -i input.mpeg -i input.mp3 -map 0 -map 1 -c copy output.mpeg
share|improve this answer

i wasnt able with mencoder either, but had good results with avidemux (linux) or virtualdub (windows)

if you need scripting then have a look at (scripting of avidemux)

share|improve this answer
It seems like this is going to be the way to go. Thanks for the advice! – Riley Dutton Aug 25 '09 at 14:31

You must log in to answer this question.