Reputation: 14418
Now Display the following.
Packet DTS -> 7200.00 [ from packet ]
Frame PTS -> -9223372036854775808.000000
stream time_base -> 0.000011
Offset -> 0.080000 [ pts * time_base ]
code:
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));
Upvotes: 1
Views: 2741
Reputation: 414
The number you're seeing for PTS is -9223372036854775808 (0x8000000000000000) is also known as AV_NOPTS_VALUE. It means that there's no value available.
I couldn't find a solution when I was seeing this so after quite some time of banging my head against this, I ended up manually advancing my video clock when I saw this.
int64 pts = m_frame->pts;
if (pts == AV_NOPTS_VALUE)
{
pts = m_videoClock +
(1.f / av_q2d(stream->avg_frame_rate)) / av_q2d(stream->time_base);
}
m_videoClock = pts;
I don't think DTS is useful here because that represents when the packet decoded, which isn't a replacement for PTS.
Upvotes: 1