[Libav-user] How to get correct video frame rate
xuanyu.huang at gmail.com
Fri Oct 2 01:49:41 CEST 2015
Just need someone to confirm if below code can always get correct frame
rate from all formats:
AVStream *st = pFormatCtx->streams[your_video_index];
double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den;
in case of MPEG-2 and H.264 decoders are used where
pFormatCtx->streams[your_video_index]->codec->ticks_per_frame = 2,
above calculated framerate is actually field rate and actual framerate
is only half of it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user