[Ffmpeg-devel] how to handel pts

Måns Rullgård mru
Fri Jul 15 14:04:03 CEST 2005


Patrick Fischer said:
> After lots of problems i can read the pts from an mpeg-ts
> but how to handel the 64bit?
>
> while(av_read_frame(pFormatCtx, &packet)>=0) {
> if(packet.stream_index==videoStream) {
> avcodec_decode_video(pCodecCtx, pFrame, &frameFinished,
> packet.data, packet.size);
> printf("pts : %I64u\n",packet.pts);
> }
> }
>
> Shows me
> pts : 2099007527
> pts : 2099047527
> pts : 2099207527
> pts : 2099127527
> pts : 2099167527
> pts : 2099327527
> ......
> As I think the pts is a time_stamp whitch is set from the decoder for
> each frame.
> the timer is running 1/90000 sec
> So if i have 25 Frames/sec then the diff of two pts should be:
> 1/25 * 90000 = 3600 ticks
> I know the frames are not in the corrent order.

Those numbers look like timestamps in microseconds, with a 40000 us interval,
some reordering, and some missing (which is fine).

> In most Programms the pts is given in this format:
> 3:01:13.20
> x:yy:zz:cc

That's just formatting.

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list