[FFmpeg-trac] #2325(undetermined:open): MP4 AAC Audio is delayed by 2ms when converted to PCM
FFmpeg
trac at avcodec.org
Wed Mar 23 15:01:27 EET 2022
#2325: MP4 AAC Audio is delayed by 2ms when converted to PCM
-------------------------------------+-------------------------------------
Reporter: BChap | Owner: (none)
Type: defect | Status: open
Priority: important | Component:
| undetermined
Version: git-master | Resolution:
Keywords: aac mov | Blocked By:
regression |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by Bartek Zdanowski):
OK. I know all :)
Some codes needs ramp-up samples. Some of them plenty, for example 2048 or
more which can be more than one frame. It depends on the codec.
Those samples are added in front of data that comes from the codec.
One can check how many samples are added via
VCodecContext::initial_padding;
Those samples need to be discarded!
This can be easily done if you're using ffmpeg as a library. But from
command line this (to my best knowledge) cannot be discarded. If somebody
knows a way - please add a comment.
I've came up with a solution if initial_padding is different that a
multiply of a frame size. You have to add missing samples to fill up to
next full frame and discard those frames. Now you can push real audio data
and enjoy output without latency and padding.
This can be achieved only using ffmpeg as a library.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/2325#comment:22>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list