[FFmpeg-devel] [PATCH] libavfilter: Whisper audio filter
Vittorio Palmisano
vpalmisano at gmail.com
Wed Jul 23 13:19:05 EEST 2025
> > To understand why this is a problem, consider some audio input device
> > which samples at 16khz. This hardware contains lets say for simplicity a 16khz
> > crystal and samples based on that. But depending on temperature of this
> > crystal it will really sample lets say between 15990 and 16010khz. So
> > simply counting samples alone is not enough. the frame->pts need to be
> > used too.
I'm trying to use the frame->pts value but I don't understand how to
calculate the absolute time in milliseconds.
Adding some logs I've found that:
frame->time_base=1/48000
frame->sample_rate=16000
Using `1000 * frame->pts * frame->time_base` returns wrong results.
The only way to get the correct value seems `1000 * frame->pts /
frame->sample_rate`
--
/Vittorio Palmisano/
More information about the ffmpeg-devel
mailing list