I am working on an M4a file with the following metadata:
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
creation_time : 2019-08-14T13:45:39.000000Z
iTunSMPB : 00000000 00000840 00000000 00000000000387C0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Duration: 00:00:05.25, start: 0.047891, bitrate: 69 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 65 kb/s (default)
The audio duration = 5246.2585 ms
I am trying to calculate a number of frames using the following formula:
duration * sampling rate / frame size = 5246.2585 * 44.1/1024 = 225.9375 frames
I tried multiple files and it always gives xxx.9357 frames.
However, using FFprobe:
ffprobe -i audio.m4a -show_streams -hide_banner
I am getting:
nb_frames=228
There is always a 2.0625 difference between my calculations and FFprobe output. Any ideas what I am doing wrong here? How can I accurately calculate the number of frames?