[FFmpeg-user] Modern ffmpeg/libvpx generates incorrect PTS for vp9 when decode
Sagara Wijetunga
sagarawmw at yahoo.com
Tue Oct 7 09:46:22 CEST 2014
> I later managed to more narrow down the issue. Its the vp9 file itself having an issue.
> Many video packets having negative PTS values!
Here are some more insight.
The av_read_frame(pFormatCtx, &packet) returns PTS/DTS as follows. For negative PTS video packets I assigned the previous known PTS. Now the vp9 decoded frames comes with correct PTS values and player plays it very well.
Video PKT PTS: 0, DTS: 0, Size: 129
Video PKT PTS: 42, DTS: 42, Size: 31
Video PKT PTS: -9223372036854775808, DTS: -9223372036854775808, Size: 27
Negative video PTS: -9223372036854775808, DTS: -9223372036854775808 Last PTS assigned: 42
Video PKT PTS: 83, DTS: 83, Size: 25
Video PKT PTS: 125, DTS: 125, Size: 24
Video PKT PTS: 167, DTS: 167, Size: 23
Video PKT PTS: 209, DTS: 209, Size: 20
Video PKT PTS: 250, DTS: 250, Size: 20
Video PKT PTS: 292, DTS: 292, Size: 18
Video PKT PTS: 334, DTS: 334, Size: 18
Video PKT PTS: 375, DTS: 375, Size: 18
Video PKT PTS: 417, DTS: 417, Size: 19
Video PKT PTS: 459, DTS: 459, Size: 18
Video PKT PTS: 501, DTS: 501, Size: 18
Video PKT PTS: 542, DTS: 542, Size: 18
Video PKT PTS: 584, DTS: 584, Size: 18
Video PKT PTS: 626, DTS: 626, Size: 18
Video PKT PTS: 667, DTS: 667, Size: 18
Video PKT PTS: 709, DTS: 709, Size: 18
Video PKT PTS: 751, DTS: 751, Size: 18
Video PKT PTS: 792, DTS: 792, Size: 18
Video PKT PTS: 834, DTS: 834, Size: 18
Video PKT PTS: 876, DTS: 876, Size: 18
Video PKT PTS: 918, DTS: 918, Size: 18
Video PKT PTS: 959, DTS: 959, Size: 18
Video PKT PTS: 1001, DTS: 1001, Size: 18
Video PKT PTS: 1043, DTS: 1043, Size: 34578
Video PKT PTS: 1084, DTS: 1084, Size: 97
Video PKT PTS: -9223372036854775808, DTS: -9223372036854775808, Size: 38
Negative video PTS: -9223372036854775808, DTS: -9223372036854775808 Last PTS assigned: 1084
Video PKT PTS: 1126, DTS: 1126, Size: 29
Video PKT PTS: 1168, DTS: 1168, Size: 26
Video PKT PTS: 1210, DTS: 1210, Size: 24
Video PKT PTS: 1251, DTS: 1251, Size: 22
Video PKT PTS: 1293, DTS: 1293, Size: 20
Video PKT PTS: 1335, DTS: 1335, Size: 19
I assigned last PTS directly to the packet as follows:
packet.pts = videoLastPTS;
The real issue is before the decoding, the av_read_frame() returns some video packets with negative PTS/DTS values.
1. Is it always correct to assign the last known PTS to the packet.pts but it works very well?
2. Is this issue known and already corrected in the git version of the ffmpeg? So that I can give it a try to the git version of the ffmpeg.
Sagara
More information about the ffmpeg-user
mailing list