How to replace avi file soundtrack with another avi file soundtrack?

2

I have a high resolution video which soundtrack is broken, then I have a low resolution video which soundtrack works. I want to combine high resolution video with the low resolution video soundtrack.

How can i do this without re-encoding the soundtrack or video?

Rookie

Posted 2012-04-06T12:22:36.903

Reputation: 1 073

Answers

2

If you want to do it via commandline, use FFmpeg (free, open-source, cross-platform).

First, extract the soundtrack from the correct video file. I assume the audio is MP3*.

ffmpeg -i correct.avi correct.mp3

Then, merge the broken file's video bitstream with the new soundtrack:

ffmpeg -i broken.avi -i correct.mp3 -map 0:0 -map 1:0 -c:v copy -c:a copy out.avi

This will not re-encode the video and audio bitstreams.

* You can verify this by doing a simple ffmpeg -i correct.avi call and looking for the audio stream. Or, you can use MediaInfo. Note that the extension (here, .mp3) should really match the audio. If your AVI file does not have MP3 audio, but something else, you have to change the container accordingly.

slhck

Posted 2012-04-06T12:22:36.903

Reputation: 182 472

0

You might want to have a look at VirtualDub:

VirtualDub features

  • Remove and replace audio tracks without touching the video.

Der Hochstapler

Posted 2012-04-06T12:22:36.903

Reputation: 77 228

1Couldn't locate decompressor for format 'XVID' (unknown) VirtualDub requires a Video for Windows (VFW) compatible codec to decompress video. DirectShow codecs, such as those used by Windows Media Player, are not suitable. Looks like VirtualDub supports only one format... – Rookie – 2012-04-06T12:42:02.603

1

@Rookie No, it supports pretty much any format, you just have to install it correctly with XviD support.

– slhck – 2012-04-06T13:21:20.467

0

avidemux should do this in copy mode. Alternately you should be able to strip out the audio and add it back in.

If you want to look for alternatives, you're demuxing the audio and vidio to seperate them, and muxing them back together.

Journeyman Geek

Posted 2012-04-06T12:22:36.903

Reputation: 119 122

0

You can do this with either VirtualDub, AviDemux (doesn't need extra codecs) or Xmedia Recode. First, you gotta rip the audio out of the one file, preferably with GoldWave 4, because then you can store is as WAV, which is uncompressed, you need that to sync it. Second, make sure your audio is EXACTLY the same lenght as the video, we're talking thousands of seconds here. A difference of e.g. 0.234 seconds is okay, more than a second prolly will be bad.

Third, IF they are the same, open the video with either Vdub or AviDemux and look for the Add Audio from different source option. Add the WAV file. If it's sync, you can then use compression to make the movie smaller.

You can adjust the length of the WAV file in Goldwave. You can do this, even when they are completely different and have totally different starts and endings. But that's hard.

user246942

Posted 2012-04-06T12:22:36.903

Reputation: 11