[FFmpeg-devel] question: why (pts < dts) is Invalid timestamps

C Chatterjee cchatterj at hotmail.com
Fri Jan 6 08:13:16 CET 2012


pts < dts means you are displaying video you have not decoded. Not possible.

Your PTS DTS numbers below are presentation and decoding order not presentation and decoding time stamps.
These are:
Decoding order        0  3  1  2
Presentation Order      0  1   2   3

Chanchal


> Date: Fri, 6 Jan 2012 08:22:10 +0200
> From: verem at m1stereo.tv
> To: ffmpeg-devel at ffmpeg.org
> Subject: [FFmpeg-devel] question: why (pts < dts) is Invalid timestamps
> 
> 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
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 		 	   		  


More information about the ffmpeg-devel mailing list