[FFmpeg-devel] Calculating audio frame rate

Hendrik Leppkes h.leppkes at gmail.com
Tue Mar 3 11:07:57 EET 2020


On Tue, Mar 3, 2020 at 8:22 AM Eran Kornblau <eran.kornblau at kaltura.com> wrote:
>
> Hi all,
>
> First, I apologize for asking a question not directly related to ffmpeg development, but hope you can still help me...
>
> I'm looking for some code to calculate the frame rate of audio, based on parameters such as the codec id,
> sampling rate, channels, codec private data etc.
> For example, if the codec is AAC and the sampling rate is 44.1KHz, the frame rate would be 44100/1024= ~43 fps
> (assuming each frame has 1024 samples, not 960)
>
> Has anyone ever written/bumped into something that implements this across multiple codecs?
>

The frame size of audio codecs is pretty much only dependent on the
codec itself, which means you would need to basically hard-code this
for every codec you care about.
Ultimately I wonder however, when does this information really matter?

- Hendrik


More information about the ffmpeg-devel mailing list