How do I merge MP4 files without audio going out of sync?

6

2

Is there a tool I can use that can merge MP4 files without throwing the audio out of sync? I generated some MP4 files from a DVD using AVIDemux but whatever tool I try to use always ends up throwing the audio out of sync with the video. The further you get into the video the further off-sync the audio is.

By themselves the MP4/AAC videos have perfect audio-video sync.


later tonight i might try http://www.headbands.com/gspot/ to examine the file before and after to see if anything changed in the media format.

djangofan

Posted 2009-11-28T01:52:30.687

Reputation: 2 459

so, you're essentially concatenating several MP4 files, right? is the first part of the final video out-of-sync, or is it just the 2nd, 3rd, etc parts (corresponding to the 2nd, 3rd, etc input files)? – quack quixote – 2009-11-28T02:39:00.707

related, possible duplicate (though it appears abandoned and unanswered): http://superuser.com/questions/35896/synchronizing-audio-and-video-using-mp4box-ffmpeg-to-concatenate-files

– quack quixote – 2009-11-28T02:41:20.077

yes, all the parts are off sync and it gets worse and worse progressively through the concatenated video. – djangofan – 2009-11-28T18:41:58.710

2

If you want to analyze the contents of a media file I would recommend MediaInfo (http://mediainfo.sourceforge.net/en) instead of GSpot. The later is quite old right now and MediaInfo is in active development.

– Xandy – 2009-12-01T13:01:44.880

Answers

1

Avidemux should do it without problems, which one are you using?

Try the latest SVN build MuldeR builds, I've never had a problem of not synced audio with it.

Anyway, as the container is mp4 mp4box may come handy. I suggest you use the latest development build (0.4.6 at the time of writing). If you need a GUI frontend for it, take a look at YAMB or My MP4box GUI.

I you don't mind the container, I suggest Matroska (it's quite flexible, scalable and adds little overhead as a container). Use MKVToolnix if you decide to use that container.

Xandy

Posted 2009-11-28T01:52:30.687

Reputation: 3 442

@djangofan which method worked for you? Answer has multiple methods. – kanna – 2019-05-29T11:20:38.360

I've tried using Yamb with MP4Box and it didnt' work either. The audio endeup up out of sync. Its as-if it is re-encoding the audio while merging. – djangofan – 2009-11-30T23:43:40.387

It's weird, try MKVToolnix: open the GUI (mmg.exe) and select "Add" in the input files section. Select the first file you want to join, and then click in "Append" to add the next files. You could select several options but just to try click tell it where you want the new file and click "Start muxing". It should generate a MKV file, play it and look if the audio is out of sync. If it's not, you could use Avidemux to create a MP4 file from the MKV one. – Xandy – 2009-12-01T12:59:45.660