I used mp4box to extract audio from .mp4 file:
If I try to mux it to other video/container, there's a negative -100ms delay.Code:mp4box -raw 2 audio.aac
I need to add the delay/offset to the aac sound file itself, like cut the first -100ms or something. I know I could just set delay muxed into the mkv container with mkvmerge or similar, but that's not the solution in my case.
Best scenario would be if you could extract the audio with mp4box and set delay into the process, then you would get raw audio file with delay applied.
+ Reply to Thread
Results 1 to 7 of 7
I think MP3DirectCut or eac3to is what you need.
But remember that the delay applied is normally different from the value chosen by the user, because the application deals only with integer multiples of an audio frame.
MKVToolNix GUI and remux it as an MKV. The existing video/audio sync should be maintained. If you do need to extract the audio to modify it, maybe remux it as an MKV first, then extract it from the MKV with gMKVExtractGUI. Any audio delay will generally be positive and written to the extracted audio stream (unless on rare occasions there's also a video delay, which can effectively make the audio delay negative). As negative delays aren't permitted for MKV, if there was a -100ms delay in the source file, when remuxing MKVToolNix would delete as close to 100ms of the audio stream as is can from the beginning, and add a positive audio delay as required to make up the difference. You might end up with an MKV with an audio delay of 8ms, or 24ms.... whatever is required, but MKVToolNix knows what it's doing.
Or as sneaker said, if you need to manually set a negative audio delay, the appropriate amount will be removed from the beginning by MKVToolNix when muxing in the same way I described above.
For the record, if you extract audio from MKVs with eac3to it'll replace delays/gaps with silence. It doesn't re-encode the rest. I don't think it'll open MP4s but once again you can remux as MKV first.