Opened 6 months ago
#11031 new defect
CMAF MP4 not skipping priming samples for audio tracks
Reported by: | derrod | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | fmp4 cmaf |
Cc: | derrod | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
When muxing an audio stream to a CMAF file, edit lists get disabled unless explicitly enabled (which prints a warning message). While they are not necessary for video due to negative CTS offsets being enabled, audio still requires them to skip "priming" samples produced particularly by AAC and Opus encoders.
When muxing an audio stream that has priming samples (e.g. 2112 when using the AudioToolbox AAC encoder) into a CMAF ISO file the edit list will be missing and the first 2112 samples of silence will not be skipped, resulting in A/V desync.
I do not have access to the CMAF spec so I cannot check what the current intended solution is. The 2016 draft does say that an edit list "SHOULD" be used to deal with audio data before presentation time 0 and names priming as an example.
How to reproduce:
# base file % ffmpeg -f lavfi -i sine -c:a aac_at -t 10 audio_test.mp4 # mux with CMAF enabled % ffmpeg -i audio_test -c copy -movflags cmaf+delay_moov audio_test_cmaf.mp4 # remux to regular MP4, which will play 2112 additional samples of silence at the start (44 ms at 48 kHz) % ffmpeg -i audio_test_cmaf.mp4 -c copy audio_test_remuxed.mp4