add background music to existing avi

676 Views Asked by At

I have a video.avi which I have generated with mencoder before. It has a video and audio stream and I'm trying add (mix) a background.mp3 file to it, but I haven't found anything on the internet, thats why I'm asking. The background music is always longer than the audio in video.avi so I have to use something like "shortest" like I know from ffmpeg.

If I do this:

mencoder -ovc copy -audiofile background.mp3 -oac copy video.avi -o output.avi

the existing audio stream from video.avi is overwritten (or not used). Is it even possible to do this with mencoder? If anyone could tell me how to do this with ffmpeg or avconv (any linux command line tool) I would appreciate it.

0

There are 0 best solutions below