Log in

View Full Version : Audio/video delay values work in MKV but not in MP4?


Anacondo
29th December 2012, 22:37
Hello everyone.

I need help syncing a video stream with an audio stream that don't come from the same source. So here's what I've done so far:


I have video.mp4 and audio.mp4. I muxed them with 0 delay using yamb to get muxed.mp4

I opened muxed.mp4 with MPC-HC and VLC and after some guessing I finally concluded that the delay is +1700ms. That value works great throughout the stream using both players.

I muxed video.mp4 and audio.mp4 with yamb and megui mp4 muxer using the guessed value of 1700ms, but the resulting mp4 file is unsynced on both cases, using both MPC and VLC. In fact, it's not taking the delay into account at all, because when I manually set the delay to +1700ms again from the players the sound is in sync with the video again.

I did the same thing but muxing to MKV instead, and it worked perfectly.


Am I doing something wrong, or is audio/video delay not supported by the MP4 container?

Thanks in advance!

hello_hello
30th December 2012, 10:38
A while ago I think I found a problem with MPC-HC and MP4 audio delays but never got around to investigating because about the only time I'd open an MP4 with anything is to remux it as an MKV. Your post prompted me to check though, and yes, there seems to be an issue with MPC-HC. Anyway....

Yamb seems to do some odd things. In fact it's got me close to suicidal trying to create an MP4 in the past. I just tried remuxing using YAMB and couldn't get it to apply an audio delay no matter how I went about it. It doesn't seem to be an MP4Box problem as I replaced those files in YAMB's installation folder with the ones MeGUI uses and Yamb still crashed every second time a tried to create an MP4 and still no audio delay......

Edit: Further investigation (checking the log file) indicates Yamb simply isn't adding the delay to the MP4Box command line.

There's probably other MP4Box GUIs which actually work properly, but I tried the Adaptive Muxer and the MP4 muxer built into MeGUI and they both worked as they should. According to MeGUI's log file the audio delay was being used in the MP4Box command line.

Finally I checked the MP4s using MediaInfo and there was no audio delay specified for the MP4 Yamb created but there definitely was one for the MP4 MeGUI created. Only problem is, MPC-HC completely ignored it. I tried using Haali media splitter instead of the internal one and nothing changed. VLC played the MP4 using the correct delay though. I tried the same MP4 on another PC and MPC-HC ignored the delay then too. I've not had that problem with MKVs. Maybe it's a bug. I'm using MPC-HC 1.6.5.6366. If it is a bug I'd assume someone else has reported it already given I found it and I probably only open a handful of MP4s files using MPC-HC over a year.

Anacondo
30th December 2012, 16:43
Aha! So it's a software bug and not some container shortcoming. I guess I'll stick with MKV for the time being then when I face this issue.

Thanks a lot, I was really starting to lose my mind over this!

hello_hello
2nd January 2013, 11:34
I posted a question regarding MPC-HC and MP4 audio delay in the MPC-HC thread but so far my post must be invisible to others. ;)

Anacondo
2nd January 2013, 11:53
cool, let's hope someone answers :) link?

hello_hello
2nd January 2013, 11:55
http://forum.doom9.org/showthread.php?t=166689&page=6
(http://forum.doom9.org/showthread.php?t=166689&page=6)
Post numbers 111 and 114.