[Ffmpeg-devel] how to handel pts

Patrick Fischer patrick_fischer
Fri Jul 15 12:44:20 CEST 2005


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.

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

The calculation is

3600 * X + 60 * yy + zz = sec
sec * 25 + cc = frames

2099007527
-> 83960301 sec + 2 Frames
-> 1399338 min + 21 sec + 2 Frames
-> 23322 Std + 18 min + 21 sec + 2 Frames

This does't fit!!!
As i know the pts is a 33bit number.
Should i mask the 33 bit or shift it?

Patrick





More information about the ffmpeg-devel mailing list