[FFmpeg-user] Frame Pts is it the right way to calculate ?

whoami Jils get2jils at gmail.com
Tue Feb 25 16:19:21 CET 2014


Hi,

1)  I have a AVStream of Video from FormatContext. [ avstream ]
2)  Read Packet
3)  Decode packet if it is from video.
4)  Now Display the below.
       Packet DTS ->  7200.00    [ from packet ]
       Frame PTS   -> -9223372036854775808.000000
       stream time_base ->  0.000011
       Offset                    ->  0.080000    [ pts * time_base ]

 double pts = (double) packet.dts;
printf (" dts of packet %f , Frame pts:  %f, timeBase %f Offset: %f ",pts,
(double)pFrame->pts, av_q2d (avstream->time_base) , pts
*av_q2d(avstream->time_base));

1) Why Frame pts  is negative ? is it valid ?
2) Do i need to consider Frame pts from packet DTS [ ie: frame pts = packet
dts ]

Thanks for your help.


More information about the ffmpeg-user mailing list