Hello all, I have muxed some of my encoding to the mp4 container with mp4box. Sometimes I use a negative or postive audio delay. When doing this I notice that when playing the file in VLC it actually works but when playing the same file in MPC-HC the audio correction is ignored totally.. I'm using Haali renderer.
+ Reply to Thread
Results 1 to 18 of 18
I know this thread's a bit old but I was wondering if you found a solution? I thought I'd noticed an oddity with MP4 audio a while back but never got around to investigating as I generally just remux everything as MKV, but today I confirmed it. MPC-HC (I'm using the current release) is ignoring the specified audio delay in MP4s. It's fine with other file types. MPC-BE is doing the same thing. I've tried different splitters and decoders etc with the same result. It's the same when using MPC-HC on the second PC here.
Thinking I'd found a bug I googled and this thread is closest to relevant info on the topic I found. I thought there'd be information for days, but apparently not. Either it's a very rare bug or most MP-HC users simply haven't noticed it.
Anyway.... anyone else experiencing the same problem? MP4s with an audio delay play correctly for me using VLC too.
I tried a much older version of MPC-HC (2007) and it's the same. Even an old version of MPC I tested is no different. Well except for the fact when I set a 5 second audio delay, MPC displayed the original duration in the status bar. MPC-HC displayed the duration as 5 seconds longer but still ignored the audio delay when playing. I find it hard to believe it's ignored MP4 audio delays for years and hardly anyone has noticed.
If I can find the motivation to sign up for a sourceforge account I'll file a bug report, although given about the only time I open an MP4 is to remux it as an MKV it's not really an issue for me.
Had this problem before, I used mkvtoolnix merge to change the frame rate of the input file. Seemed to allow MPC to adjust after muxing. If you convert the file format (avi,mp4 etc)before merging, you have lost the content needed to merge the separate tracks. It's important to understand that mkv and mp4 are containers that may have various "tracks" such as audio, video, subtitles and other metadata. AVI are often "burned" on a single layer.
Adjust each track in mkv and mpeg related files before merging. I suggest checking media info in mpc or vlc before muxing or anything. File properties in MPC, tools>media info in vlc....source and output need to match player codecs, frame rates etc...sorry if this dont help, take care and look closely to tabs and numbers
btw the mp4 audio became a non issue after muxing and merging with proper values...and @sardonis original question, sub and audio delay are player specific...mpc wont save delay info to be adjusted to vlc playback. Must be saved as a complete file after adjusting in options>playback or tools vlc. Either way, input is output. Ignoring haali and saving a file in mkvmerge works for me with a delay I specified in mpc or specified in other players. Just keep notes about what delay works, then merge it to the file. Good luck. mkvtoolnix can do all that and save the edited media/movie.
Last edited by milo77; 28th Jan 2013 at 09:16.
The problem appears to be MPC-HC's inability to automatically use the audio delay specified when creating an MP4 file. If you open an MKV with MKVMergeGUI and specify a 1000ms delay (for example) then save it as a new MKV, MPC-HC will play the audio in the new MKV file with a delay of 1000ms as it should. If you do the same thing with an MP4 using MP4Box you can open the new MP4 with MediaIndo to confirm it has a 1000ms audio delay and VLC will use the delay just as it would when playing the MKV file. For some reason though, MPC-HC won't.
I've tried quite a few older versions of MPC-HC with the same result. It seems it's always ignored audio delays in MP4s. I've suspected there was something odd happening with MP4s a few times in the past but as I generally remux everything as an MKV I'd not paid much attention to it until recently when I did some testing and confirmed MPC-HC definitely ignores MP4 audio delays. I'm astounded it hasn't caused a lot of complaints and the problem fixed a long time ago, but I could scarcely find a mention of it via Google. Unless there's something particular to a PC setup which only causes MPC-HC to ignore MP4 audio delays for a small number of people. I've tested in on two different PCs (both running XP) with the same result. Maybe if you (or somebody else) could confirm whether MP4s with an audio delay are played correctly by MPC-HC on your PC? I'd be interested to know.
I've just found this old thread @ Doom9's forum:
and from the post:
I conclude ( and this conclusion can be wrong ) that the actual problem is in MP4Box or/and in the MP4 specs themselves. I mean, the audio delay should be implemented through a direct modification in the audio timestamps, and this is not what happens.
EDIT: More fuel to the bonfire:
Last edited by El Heggunte; 29th Jan 2013 at 07:33. Reason: better wording
I did experiment with using MKVMergeGUI to remux MP4s at one stage and it did my head in trying to work out what MKVMergeGUI was doing, but it seems to get it right.
As an example I'd take an MP4 which according to MediaInfo had a 80ms audio delay and after remuxing it as an MKV, MediaInfo reported no audio delay in the MKV, or it'd be quite different, but then I'd open the MKV using one instance of MPC and the MP4 in another, manually apply the delay MPC-HC won't to the MP4, play them both while stopping and starting one until the audio of each was perfectly in sync, and they were no doubt the same.... scene changes would happen at exactly the same time..... so I gave up trying to work it out and decided to accepted MKVMerge knows what it's doing. Hopefully it does. I think i was using MKVMerge 4.8.0 when I tried the last round of testing.
Given the age of the posts you linked to, you'd kind of assume this problem would have been fixed a long time ago, whether it be MPC-HC's fault or MP4Box's fault..... given VLC seems to pick up the MP4 audio delay correctly it must be possible.
Oh well.... I've always considered the best thing to do with MP4's is remux them as MKVs before deleting them.
Here we go again:
ffmpeg -i video.mp4 -itsoffset 00:00:05.000 -i audio.mp4 -vcodec copy -acodec copy output.mp4
OTOH, Mplayer ignores the audio delay generated through ffmpeg (the switch "-demuxer lavf" makes no difference)
And if I remux output.mp4 to output2.mp4 with MP4Box, the timestamp-based audio delay is removed
Now, "someone" will have to check if VLC understands the ffmpeg-method of creating audio delay in MP4 files.
UPDATE: The audio delay created through MP4Box DOES WORK in MPC-HC Lite.
just don't use the built-in MP4 splitter of MPC-HC, nor the standalone filter "MP4Splitter.ax",
Last edited by El Heggunte; 1st Feb 2013 at 16:16. Reason: typo
I did test a couple of MP4s using the Haali splitter, after remuxing the MP4s using MP4Box while specifying an audio delay, and I'm pretty sure the delay was still being ignored.
If I find the motivation I might play around with it again later, but given I never keep MP4s myself, I'm not sure I will.....
Last edited by El Heggunte; 4th Feb 2013 at 10:27. Reason: better wording
@El Heggunte: I think you pretty cleared things up. My experiences have been identical and I agree with your basic opinions.
@Hello_hello: thanks for your reply. I can confirm that the mp4 audio delay is ignored by MPC if set in MP4Box for reasons mentioned by El Heggunte. I have always had good results using the MKV container with MKVToolnix and associated proggys. BTW for those that don't know, there is a GUI for MKVExtract and it sees very stable. Now if I could just get Handbrake to manage IDX/SUB, I could forego the added step of another muxing, hehe. Have fun Guys. Thank you El Heggunte for the clarifications.
Well, I think El Heggunte pretty much summed it up. I concur with both their experiences and opinions. I prefer MKV as a container and MKVToolnix as the weapon of choice. BTW guys and girls, if you don't already know, there is a GUI for MKVExtract and it has been very stable for me. Have fun Everyone! Now if I could just tweak handbrake a little to manage IDX/SUB better and skip the remux, hehe...Hmm that was weird. I double posted after adding my Avatar. oh well, lol...
I tried a couple of quick tests with an MP4 I had on my hard drive and with the LAV Splitter, MPC-HC did use the correct audio delay, even after remuxing with MP4Box while specifying one, so I assume MPC-HC's internal splitter is to blame when it comes to ignoring MP4 delays (which the Haali splitter also does).
I guess it was time to move on from Haali/ffdshow to LAV anyway..... even if installing LAV did mess with many of the file associations for some reason. Oh well.... it wasn't too hard to fix that.