Combining a H264 Video file with AC3 audio


I have a MP4 file (H264 video format and 127kbits/s AAC Audio),

A 5.1 Channel 343MB AC3 file which has the movie’s audio is also provided,

My question is how do I replace the 127Kbits/s AAC audio with the 5.1 Channel AC3 audio?

The Mp4 file is 949MB,
And AC3 file is 343MB,

[B]MP4 file details

Duration: 01:47:12
Bit rate: 1238kbps
Format: h264
Size: 718x468
Frame rate: 25.00fps
Format: mpeg4aac
Bit rate: 127kbps
Sample rate: 48000Hz[/B]

Please check this pic for some reference:-

You should be able to do this with AVIDemux. Import the video into AVIDemux, go to Audio—>Main Track. Select None. Save the video. This should give you the video stream without the AAC audio.

Then import the video stream you just extracted back into AVIDemux, go to Audio and hit Main Track again. Select External AC3 file and browse to where you have your ac3 file stored. Add it as the audio stream and then save the video.

I believe there are still issues playing back ac3 audio in mp4 container…
I have no probs playing aac in mp4, however for h.264 and ac3 audio I’ll mux to mkv container or create an m2ts file(for streaming)…You may want to play with VLC or if using WMP install the haali media splitter…

Thank you for your help guys,

I combined the H264 vid with the AC3 into MKV container but audio is lagging by about 500ms :frowning: .

Hey t0nee1, I’ve stopped asking why people do what they do with video. :bigsmile:
I just do my poor best to answer the questions. :stuck_out_tongue:

You should be able to shift the audio sync if it is a constant, not progressive error in playback.

Yeah good point kerry56 and BTW great advise, I’m gonna start(well, ok try) doing the same …