(14.10.2021, 05:26)Selur Wrote: Quote:You can tell Hybrid to not compensate the aac encoder delay by deactivating "Audio->Misc->Compensate aac encoder delay" (haven't disabled this for years, so if there's a problem let me know) before the entries in the audio job queue are created.
source: second post in this thread,...
Cu Selur
Thanks for the tip! And sorry I didn't see it in the beginning of the thread.
I did all the tests you suggested. The Hybrid's steps are:
1. extracting audio as pcm/wav using ffmpeg
2. encoding audio to aac using fdkaac
3. encoding video to MPEG-4 HEVC with x265
4. (mkv) creating mkv/webm file with mkvmerge
4. (mp4:MP4Box) creating mp4 file with MP4Box
4. (mp4:ffmpeg) creating mp4 file with ffmpeg
There are 3 ways to create the container and 2 audio delay options (compensate or not). So 6 cases total.
Only in one of them (mp4:MP4Box with delay compensation), an additional step is introduced before creating the container:
renaming iId_2_aid_1_DELAY_-41ms.aac to iId_2_aid_1_ms.aac
This seems to REVERSE the delay compensation.
My question is: Why is this done? And why only for the mp4 output but not for the mkv output?
In short, the results of the tests are as follows:
Compansate aac encoder delay:
+ MP4Box_delay-41ms.mp4 //appears as the source in VirtualDub2
mkvmerge_delay-41ms.mkv //audio 1.5 frame ahead
ffmpeg_delay-41ms.mp4 //audio 1 frame ahead
Do NOT compansate aac encoder delay:
+ MP4Box_delay0ms.mp4 //appears as the source in VirtualDub2
+ mkvmerge_delay0ms.mkv //appears as the source in VirtualDub2
ffmpeg_delay0ms.mp4 //video 2 frames ahead and audio 1 frame ahead
My personal conclusions for muxing AAC:
1. For mp4, stick with defaults (MP4Box, Compansate aac encoder delay).
2. For mkv, uncheck "Compansate aac encoder delay".
3. Do NOT bother with "FFmpeg instead of MP4Box.
Later I may post the detailed MediaInfo data for all the 6 tests and screenshots of VirtualDub2, visualizing the Audio vs. Video delays.