[Libav-user] How to determine frame sizes in msec

Yurii Monakov monakov.y at gmail.com
Wed Oct 3 10:58:32 EEST 2018

Bob, you can simply multiply number of samples and audio time_base.


вт, 2 окт. 2018 г. в 18:15, Bob Kirnum <bkirnum at gmail.com>:

> We are using the libavformat APIs in order to support various containers
> including WebM, MKV, MP4, and MOV.  We do not use libavcodec APIs for
> encoding or decoding, we have our own implementations.  Our implementation
> is a real-time media server which can play from or record to these
> containers.  We also offer DVR like controls for skipping ahead or behind.
> I am having some difficulty finding a consistent implementation for all
> containers to determine the frame times for the audio and video frames we
> read.  When using some MP4 files, the cur_dts value is always
> AV_NOPTS_VALUE so this can't be used.  When playing some MKV files, the
> audio and video codec context time_base values are inconsistent.  For video
> the time_base is (1001 / 24000) which can be used to determine the frame
> rate and duration (23.976 fps or 41.7 msec).  However, the audio values are
> (1 / 8000) which is the sample rate not the frame size.  It is certainly
> possible that I am not understanding this correctly.  Can someone recommend
> a consistent calculation that will work for audio and video in these
> various containers?
> Thanks,
> Bob
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20181003/b9ba3690/attachment.html>

More information about the Libav-user mailing list