[FFmpeg-trac] #4415(avcodec:new): Multi-threaded Multi-slice H264 decode incorrect error.

FFmpeg trac at avcodec.org
Tue Mar 31 23:28:38 CEST 2015


#4415: Multi-threaded Multi-slice H264 decode incorrect error.
-----------------------------------+---------------------------------------
             Reporter:  mmorrison  |                     Type:  defect
               Status:  new        |                 Priority:  normal
            Component:  avcodec    |                  Version:  unspecified
             Keywords:             |               Blocked By:
             Blocking:             |  Reproduced by developer:  0
Analyzed by developer:  0          |
-----------------------------------+---------------------------------------
 Summary of the bug: Using slice-based multithreaded decode with the H264
 decoder produces the error "changing width/height on slice N" when the
 width and height have not changed.  There appears there may be a bug in
 the logic and/or some variables are not properly initialized.

 How to reproduce:
 Using the attached Record1MDVideoX.h264 file (which seems to be correct..)

 $ ffmpeg -y -threads 4 -thread_type slice -i /mnt/u/Record1MDVideoX.h264
 test.mp4

 I am currently using ffmpeg 2.1.4 but the same can be reproduced on the
 latest ffmpeg as well.  I instrumented the method decode_slice_header as
 attached and it produced the following output:

 $ ffmpeg -y -threads 4 -thread_type slice -i /mnt/u/Record1MDVideo.h264
 test.mp4
 ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers
   built on Mar 31 2015 11:57:39 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
   configuration:
   libavutil      52. 48.101 / 52. 48.101
   libavcodec     55. 39.101 / 55. 39.101
   libavformat    55. 19.104 / 55. 19.104
   libavdevice    55.  5.100 / 55.  5.100
   libavfilter     3. 90.100 /  3. 90.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
 [h264 @ 0x2678640] pps.sps_id: 1 current_sps_id: -1
 [h264 @ 0x2678640] hw: 0 sw: 80
 [h264 @ 0x2678640] hh: 0 sh: 45
 [h264 @ 0x2678640] hbpsw: 8 sbdl: 8
 [h264 @ 0x2678640] hccfi: 1 scfi: 1
 [h264 @ 0x2678640] needs_reinit 0
 Input #0, h264, from '/mnt/u/Record1MDVideo.h264':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9],
 30 fps, 30 tbr, 1200k tbn, 60 tbc
 Output #0, mp4, to 'test.mp4':
   Metadata:
     encoder         : Lavf55.19.104
     Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 1280x720
 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 15360 tbn, 30 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> mpeg4)
 Press [q] to stop, [?] for help
 [h264 @ 0x2678640] pps.sps_id: 1 current_sps_id: -1
 [h264 @ 0x2678640] hw: 0 sw: 80
 [h264 @ 0x2678640] hh: 0 sh: 45
 [h264 @ 0x2678640] hbpsw: 8 sbdl: 8
 [h264 @ 0x2678640] hccfi: 1 scfi: 1
 [h264 @ 0x2678640] needs_reinit 0
 [h264 @ 0x2678640] pps.sps_id: 1 current_sps_id: 0
 [h264 @ 0x2678640] hbdl: 0 sbdl: 8
 [h264 @ 0x2678640] hcfi: 0 scfi: 1
 [h264 @ 0x2678640] needs_reinit 1
 [h264 @ 0x2678640] h: 0x3352080 h0: 0x32e3f60
 [h264 @ 0x2678640] 1280x720 vs 1280x720
 [h264 @ 0x2678640] mr: 0 nr: 1
 [h264 @ 0x2678640] changing width/height on slice 2
 [h264 @ 0x2678640] decode_slice_header error
 [h264 @ 0x2678640] pps.sps_id: 1 current_sps_id: 0
 [h264 @ 0x2678640] hbdl: 0 sbdl: 8
 [h264 @ 0x2678640] hcfi: 0 scfi: 1
 [h264 @ 0x2678640] needs_reinit 1
 [h264 @ 0x2678640] h: 0x33c01a0 h0: 0x32e3f60
 [h264 @ 0x2678640] 1280x720 vs 1280x720
 [h264 @ 0x2678640] mr: 0 nr: 1
 [h264 @ 0x2678640] changing width/height on slice 3
 [h264 @ 0x2678640] decode_slice_header error
 [h264 @ 0x2678640] Cannot use next picture in error concealment
 [h264 @ 0x2678640] concealing 2720 DC, 2720 AC, 2720 MV errors in P frame
 [h264 @ 0x2678640] pps.sps_id: 1 current_sps_id: 0
 [h264 @ 0x2678640] hbdl: 0 sbdl: 8
 [h264 @ 0x2678640] hcfi: 0 scfi: 1
 [h264 @ 0x2678640] needs_reinit 1
 [h264 @ 0x2678640] h: 0x342e2c0 h0: 0x32e3f60
 [h264 @ 0x2678640] 1280x720 vs 1280x720
 [h264 @ 0x2678640] mr: 0 nr: 1
 [h264 @ 0x2678640] changing width/height on slice 4
 [h264 @ 0x2678640] decode_slice_header error
 [h264 @ 0x2678640] Cannot use next picture in error concealment
 [h264 @ 0x2678640] concealing 2720 DC, 2720 AC, 2720 MV errors in P frame
 [h264 @ 0x2678640] pps.sps_id: 1 current_sps_id: 1
 frame=  151 fps=0.0 q=31.0 size=     726kB time=00:00:05.03
 bitrate=1181.8kbits/
 [...]

 Should we expect to get these errors every time we decode a multi-slice
 video with multiple threads?

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4415>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list