[FFmpeg-devel] question: why (pts < dts) is Invalid timestamps
Maksym Veremeyenko
verem at m1stereo.tv
Fri Jan 6 07:22:10 CET 2012
Hi,
could somebody explain, what is wrong then packet has pts < dts:
1270 if(st->cur_pkt.pts != AV_NOPTS_VALUE &&
1271 st->cur_pkt.dts != AV_NOPTS_VALUE &&
1272 st->cur_pkt.pts < st->cur_pkt.dts){
1273 av_log(s, AV_LOG_WARNING, "Invalid timestamps
stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d\n",
1274 st->cur_pkt.stream_index,
1275 st->cur_pkt.pts,
1276 st->cur_pkt.dts,
1277 st->cur_pkt.size);
1278 // av_free_packet(&st->cur_pkt);
1279 // return -1;
1280 }
i re-read some posts about dst/pts like:
http://ffmpeg-users.933282.n4.nabble.com/understanding-DTS-PTS-td940270.html
http://dranger.com/ffmpeg/tutorial05.html
but still have a questions.
From the example:
PTS: 1 4 2 3
DTS: 1 2 3 4
Stream: I P B B
P and B frames has (pts < dts)
another real example is
http://samples.mplayerhq.hu/mov/FCP/HDV_1080i50.mov that according to
ctts atom:
count=1, duration=2
count=2, duration=-1
count=1, duration=2
count=2, duration=-1
count=1, duration=2
count=2, duration=-1
count=1, duration=2
[...]
PTS should be:
# DTS PTS
------------
0 0 2
1 1 0
2 2 1
3 3 5
4 4 3
5 5 4
6 6 8
7 7 6
8 8 7
9 9 11
[...]
that also has (pts < dts) from some samples, but current implementation
in mov.c makes a DTS negative (even in index table):
# DTS PTS
------------
0 -1 2
1 0 0
2 1 1
3 2 5
4 3 3
5 4 4
6 5 8
7 6 6
8 7 7
9 8 11
[...]
to provide condition (pts >= dts)
and how seeking should works for this?
--
________________________________________
Maksym Veremeyenko
More information about the ffmpeg-devel
mailing list