[Libav-user] Error with PTS/DTS after enabling multithreaded decoding

Przemysław Sobala przemyslaw.sobala at gmail.com
Fri Sep 23 16:50:26 EEST 2016


Hello

[I'm making it a new thread]
I've set thread_count in decoder's AVCodecContext and had a significant 
decoding speedup with some files but now some other mp4 files fail with:

[libx264 @ 0x3751e20] invalid DTS: PTS is less than DTS
[mp4 @ 0x35a05e0] pts (1548) < dts (2408) in stream 1


I'm using a modified transcoding.c example that handles my sample mp4 
file correctly with thread_count=1 and fails with 0 , >1 or "auto".

Time stamps are as follows:

|[INFO]Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'kanal_detka_lodz.mp4':|

|[INFO]  Metadata:|

|[INFO]    major_brand     : isom|

|[INFO]    minor_version   : 512|

|[INFO]    compatible_brands: isomiso2mp41|

|[INFO]    creation_time   : 2016-09-05 12:53:02|

|[INFO]  Duration: 00:02:52.03, start: 0.000000, bitrate: 5826 kb/s|

|[INFO]    Stream #0:0(und), 24, 1/48000: Audio: aac (LC) (mp4a / 
0x6134706D), 48000 Hz, stereo, fltp, 123 kb/s (default)|

|[INFO]    Metadata:|

|[INFO]      creation_time   : 2016-09-05 12:53:02|

|[INFO]    Stream #0:1(und), 1, 1/1000: Video: h264 (High), 1 reference 
frame (avc1 / 0x31637661), yuv420p(left), 1280x720 [SAR 1:1 DAR 16:9], 
0/1, 5700 kb/s, 49.99 fps, 50 tbr, 1k tbn, 99.99 tbc (default)|

|[INFO]Output #0, mp4, to '/tmp/out.mp4':|

|[INFO]    Stream #0:0, 0, 86/8599: Video: h264 (libx264), 1 reference 
frame, yuv420p, 128x72 [SAR 1:1 DAR 16:9], 0/1, q=1-51, 256 kb/s, 49.99 
fps, 99.99 tbn, 99.99 tbc|

|[INFO]read frame pts: 0|

|[DEBU]encoding frame pts: 0|

|[INFO]read frame pts: 2|

|[DEBU]encoding frame pts: 2|

|[INFO]read frame pts: 4|

|[DEBU]encoding frame pts: 4|

|[INFO]read frame pts: 6|

|[DEBU]encoding frame pts: 6|

|[INFO]read frame pts: 8|

|[DEBU]encoding frame pts: 8|

|[INFO]read frame pts: 10|

|[DEBU]encoding frame pts: 10|

|[INFO]read frame pts: 12|

|[DEBU]encoding frame pts: 12|

|[INFO]read frame pts: 14|

|[DEBU]encoding frame pts: 14|

|[INFO]read frame pts: 16|

|[DEBU]encoding frame pts: 16|

|[INFO]read frame pts: 9|

|[DEBU]encoding frame pts: 9|

|[WARN][libx264] non-strictly-monotonic PTS|

|[INFO]read frame pts: 10|

|[DEBU]encoding frame pts: 10|

|[INFO]read frame pts: 11|

|[DEBU]encoding frame pts: 11|

|[INFO]read frame pts: 12|

|[DEBU]encoding frame pts: 12|

|[INFO]read frame pts: 13|

|[DEBU]encoding frame pts: 13|

|[INFO]read frame pts: 14|

|[DEBU]encoding frame pts: 14|

|[INFO]read frame pts: 15|

|[DEBU]encoding frame pts: 15|

|[INFO]read frame pts: 16|

|[DEBU]encoding frame pts: 16|

|[INFO]read frame pts: 17|

|[DEBU]encoding frame pts: 17|

|[INFO]read frame pts: 18|

|[DEBU]encoding frame pts: 18|

|[INFO]read frame pts: 19|

|[DEBU]encoding frame pts: 19|

|[INFO]read frame pts: 20|

|[DEBU]encoding frame pts: 20|

|[INFO]read frame pts: 21|

|[DEBU]encoding frame pts: 21|

|[INFO]read frame pts: 22|

|[DEBU]encoding frame pts: 22|

|[INFO]read frame pts: 23|

|[DEBU]encoding frame pts: 23|

|[INFO]read frame pts: 24|

|[DEBU]encoding frame pts: 24|

|[INFO]read frame pts: 25|

|[DEBU]encoding frame pts: 25|

|[INFO]read frame pts: 26|

|[DEBU]encoding frame pts: 26|

|[INFO]read frame pts: 27|

|[DEBU]encoding frame pts: 27|

|[INFO]read frame pts: 28|

|[DEBU]encoding frame pts: 28|

|[INFO]read frame pts: 29|

|[DEBU]encoding frame pts: 29|

|[INFO]read frame pts: 30|

|[DEBU]encoding frame pts: 30|

|[INFO]read frame pts: 31|

|[DEBU]encoding frame pts: 31|

|[INFO]read frame pts: 32|

|[DEBU]encoding frame pts: 32|

|[INFO]read frame pts: 33|

|[DEBU]encoding frame pts: 33|

|[INFO]read frame pts: 34|

|[DEBU]encoding frame pts: 34|

|[INFO]read frame pts: 35|

|[DEBU]encoding frame pts: 35|

|[INFO]read frame pts: 36|

|[DEBU]encoding frame pts: 36|

|[INFO]read frame pts: 37|

|[DEBU]encoding frame pts: 37|

|[INFO]read frame pts: 38|

|[DEBU]encoding frame pts: 38|

|[INFO]read frame pts: 39|

|[DEBU]encoding frame pts: 39|

|[INFO]read frame pts: 40|

|[DEBU]encoding frame pts: 40|

|[INFO]read frame pts: 41|

|[DEBU]encoding frame pts: 41|

|[INFO]read frame pts: 42|

|[DEBU]encoding frame pts: 42|

|[INFO]read frame pts: 43|

|[DEBU]encoding frame pts: 43|

|[INFO]read frame pts: 44|

|[DEBU]encoding frame pts: 44|

|[INFO]read frame pts: 45|

|[DEBU]encoding frame pts: 45|

|[INFO]read frame pts: 46|

|[DEBU]encoding frame pts: 46|

|[INFO]read frame pts: 47|

|[DEBU]encoding frame pts: 47|

|[INFO]read frame pts: 48|

|[DEBU]encoding frame pts: 48|

|[INFO]read frame pts: 49|

|[DEBU]encoding frame pts: 49|

|[INFO]read frame pts: 50|

|[DEBU]encoding frame pts: 50|

|[INFO]read frame pts: 51|

|[DEBU]encoding frame pts: 51|

|[INFO]read frame pts: 52|

|[DEBU]encoding frame pts: 52|

|[INFO]read frame pts: 53|

|[DEBU]encoding frame pts: 53|

|[DEBU][libx264] frame=   0 QP=34.22 NAL=3 Slice:I Poc:0   I:40   P:0    
SKIP:0    size=375 bytes|

|[DEBU]Writing video packet (pts: 0, dts: -688)|

|[INFO]read frame pts: 54|

|[DEBU]encoding frame pts: 54|

|[DEBU][libx264] frame=   1 QP=33.00 NAL=2 Slice:P Poc:6   I:0    P:0    
SKIP:40   size=12 bytes|

|[DEBU]Writing video packet (pts: 1032, dts: -344)|

|[INFO]read frame pts: 55|

|[DEBU]encoding frame pts: 55|

|[DEBU][libx264] frame=   2 QP=37.00 NAL=2 Slice:B Poc:2   I:0    P:0    
SKIP:40   size=12 bytes|

|[DEBU]Writing video packet (pts: 344, dts: 0)|

|[INFO]read frame pts: 56|

|[DEBU]encoding frame pts: 56|

|[DEBU][libx264] frame=   3 QP=39.00 NAL=0 Slice:B Poc:4   I:0    P:0    
SKIP:40   size=12 bytes|

|[DEBU]Writing video packet (pts: 688, dts: 344)|

|[INFO]read frame pts: 57|

|[DEBU]encoding frame pts: 57|

|[DEBU][libx264] frame=   4 QP=35.90 NAL=2 Slice:P Poc:10  I:0    P:2    
SKIP:38   size=25 bytes|

|[DEBU]Writing video packet (pts: 1720, dts: 688)|

|[INFO]read frame pts: 58|

|[DEBU]encoding frame pts: 58|

|[DEBU][libx264] frame=   5 QP=39.00 NAL=0 Slice:B Poc:8   I:0    P:0    
SKIP:40   size=12 bytes|

|[DEBU]Writing video packet (pts: 1376, dts: 1032)|

|[INFO]read frame pts: 59|

|[DEBU]encoding frame pts: 59|

|[DEBU][libx264] frame=   6 QP=33.00 NAL=2 Slice:P Poc:14  I:0    P:0    
SKIP:40   size=18 bytes|

|[DEBU]Writing video packet (pts: 2408, dts: 1376)|

|[INFO]read frame pts: 60|

|[DEBU]encoding frame pts: 60|

|[DEBU][libx264] frame=   7 QP=38.00 NAL=0 Slice:B Poc:12  I:0    P:0    
SKIP:40   size=12 bytes|

|[DEBU]Writing video packet (pts: 2064, dts: 1720)|

|[INFO]read frame pts: 61|

|[DEBU]encoding frame pts: 61|

|[WARN][libx264] invalid DTS: PTS is less than DTS|

|[DEBU][libx264] frame=   8 QP=33.00 NAL=2 Slice:P Poc:22  I:0    P:0    
SKIP:40   size=17 bytes|

|[DEBU]Writing video packet (pts: 1892, dts: 2064)|

|[ERRO][mp4] pts (1892) < dts (2064) in stream 0|

|[ERRO]Writing packet failed: Invalid argument|


I can also send a copy of that file to this list.

What has to be taken into consideration when using multithreaded decoding?

--
Regards
Przemysław Sobala

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160923/b454a7a9/attachment.html>


More information about the Libav-user mailing list