[Ffmpeg-devel] can't get correct framerate

Michael Niedermayer michaelni
Thu Jan 4 22:01:35 CET 2007


On Thu, Jan 04, 2007 at 06:06:33PM +0000, Daniel Dantas wrote:
> Hi,
>   I'm trying to decode a *.wmv file using libavcodec, but unlike other previously decoded file formats like avi and mpeg, i can't get the correct framerate using the following piece of code:
>   float frame_rate = 1/((float)st->time_base.num/(float)st->time_base.den);
>   where st is "AVStream * "
>   when I made the calculation above for this file i got the result frame_rate = 1000, but if i run the file in a loop and count all the frames, and divide these total of frames by the duration, i get the correct result of 15 fps. But obviously making it this way would have terrific consequences for the playback performance.
>   So, my question is: is there another way to get the correct framerate when the values on time_base structure are completely wrong ?

this question belongs to ffmpeg-user and st->time_base is not wrong it is
1/1000 for all asf files

maybe r_frame_rate is closer to what you want

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070104/70258e6f/attachment.pgp>

More information about the ffmpeg-devel mailing list