[Ffmpeg-devel] Frame rates and time_base

Måns Rullgård mru
Sat May 7 11:54:46 CEST 2005

Michael Niedermayer <michaelni at gmx.at> writes:

> Hi
> On Friday 06 May 2005 23:30, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>> > Hi
>> >
>> > On Friday 06 May 2005 17:05, M?ns Rullg?rd wrote:
>> >> After the latest framerate/pts related changes, I have a few
>> >> questions:
>> >>
>> >> - Is it still possible to find the framerate in AVCodecContext?  How?
>> >
>> > well, if its fixed fps, AVCodecContext.time_base should be
>> > 1/framerate and if its not fixed, well then theres no fps anyway
>> > (the old frame_rate wouldnt have helped you here either, as most
>> > likely it would have been 1/time_base)
>> Formerly, I'd get things like 1/25 in frame_rate/frame_rate_base.
>> Now, with the same files, I get things like 1/2 in time_base.  I'm
>> surely doing something wrong, but what?
> what does ffmpeg -i file show?

That shows the correct frame rate, as expected.  What should I be
looking for?

>> >> - What is the proper way to synchronize the pts values with timestamps
>> >>   from the containter?
>> >
>> > hmm, iam not sure what you are asking here ...
>> OK, I'll try to rephrase it.  Where does libavcodec get the values it
>> puts in AVFrame.pts?  
> some video streams contain timestamps independant of the demuxer
> layer, thats what will be in AVFrame.pts during decoding

Are you talking about things like the SMPTE timecodes in MPEG streams?
Calling them PTS is an error.

>> If the demuxer supplies a pts with a frame, I'd 
>> like that pts to appear in the corresponding AVFrame.  How do I tell
>> libavcodec about the pts of the encoded frames I'm feeding it?
> put them in AVFrame.opaque in the AVCodecContext.get_buffer() callback ...

I was hoping for an easier way.

M?ns Rullg?rd
mru at inprovide.com

More information about the ffmpeg-devel mailing list