[Ffmpeg-devel] Calculating PTS Times

Rich Felker dalias
Sun Oct 23 09:23:38 CEST 2005

On Sun, Oct 23, 2005 at 01:56:49PM +0800, Colin Ward wrote:
> Rich Felker wrote:
> >
>   [snip]
> >>>Increment by one timebase unit is definitely NOT correct. You need to
> >>>obtain a pts value for each frame. For proper containers, every frame
> >>>will come with a pts value to begin with. For broken containers, it
> >>>can be a lot of work to get the pts.. :(
> >>
> >> I took this logic from one of the example programs that comes with 
> >>FFMPEG; IIRC it was from ffplay.c.  So what must I do in the case where 
> >>AVFrame->pts is 0?  Does this mean that the container/codec is broken? 
> >>And if so, shouldn't they be fixed?
> >
> >0 means the pts is 0. If a demuxer outputs 0 except for the first
> >frame it's broken.
>   Well lots of decoders output 0 for all of their frames with my build 
> of the libraries.

The pts from the decoder is generally meaningless/invalid, except for
a few codecs that can be used 'raw' without a container, and even for
these pts is likely invalid if there is a container. You really need
to obtain pts from the demuxer.


More information about the ffmpeg-devel mailing list