[Ffmpeg-devel] getting the frame-rate

Michel Bardiaux mbardiaux
Thu Aug 25 16:11:31 CEST 2005

IOhannes M Zmoelnig wrote:
> hi.
> this might seem rather obvious, but i haven't found any answer to this, 
> neither in any header-files nor in google. i have to admit that i didn't 
> try to read the code of mplayer or the like.
> if this is the wrong list, please re-direct me. anyhow:
> i am writing an application (pd/Gem) that uses ffmpeg to decode video. i 
> would like to know the frame-rate of an opened video-stream/file/whatever.
> what is the correct way to do that ?

See libavcodec/utils.c near line 787: 1/av_q2d(enc->time_base)

> i found the "frame_rate" field in AVCodecContext, but it seems to be no 
> longer in use.

No such field anymore, which version are you using?

> i also found the variable "pts" in AV_COMMON_FRAME which seems to be 
> related to this, but i am really unsure about this.
> note: i am using debian (with christian marillats packages) and on 3 
> machines at home i have installed an  avcodec.h with the 0x000409; all 3 
> files differ significantly (at least, regarding the frame_rate and 
> av_frame_seek()).
> of course this is a problem with the debian-packages.
> however i would like to know what is the advised way to get the 
> frame_rate in the future (eventually the debian-packages will be updated).
> so is the API already fixated with this peculiar feature ?
> (if not i will, for now, just _not_ try to read the framerate when using 
> ffmpeg)
> mfg.asd.r
> IOhannes
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/ffmpeg-devel

Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles

More information about the ffmpeg-devel mailing list