[Ffmpeg-devel] Frame rates and time_base

Michael Niedermayer michaelni
Sat May 7 11:02:29 CEST 2005


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?


[...]
> >> - 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


> 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 ...

-- 
Michael

"nothing is evil in the beginning. Even Sauron was not so." -- Elrond





More information about the ffmpeg-devel mailing list