10

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

3 Answers 3

7

a little old but the way to do this would be

mencoder -ovc copy -audiofile silent.mp3 -oac copy input.avi -o output.avi
4

You can do this with ffmpeg quite easily:

ffmpeg -i input.mpeg -i input.mp3 -map 0 -map 1 -c copy output.mpeg
1

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 http://forum.doom9.org/showthread.php?t=124626 (scripting of avidemux)

1
  • It seems like this is going to be the way to go. Thanks for the advice!
    – Riley Dutton
    Aug 25, 2009 at 14:31

You must log in to answer this question.