[Ffmpeg-devel] can't get correct framerate

Daniel Dantas ddantasflu
Thu Jan 4 19:06:33 CET 2007


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 ?
   
  Thank you
  Daniel

 __________________________________________________
Fale com seus amigos  de gra?a com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/ 



More information about the ffmpeg-devel mailing list