[FFmpeg-trac] #5458(avcodec:new): Race condition in H.264 decoder causes corrupt output with more than one thread

FFmpeg trac at avcodec.org
Thu Apr 21 20:47:30 CEST 2016


#5458: Race condition in H.264 decoder causes corrupt output with more than one
thread
-------------------------------------+-------------------------------------
             Reporter:  dbuitenh     |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avcodec
              Version:  git-master   |               Resolution:
             Keywords:               |               Blocked By:
  multithreading h264                |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by cehoyos):

 JM19 indicates that the video stream is damaged.
 {{{
 $ ffmpeg -threads 8 -i nondeterministic_cut.h264 -f framecrc -
 ffmpeg version N-79584-g7b7c338 Copyright (c) 2000-2016 the FFmpeg
 developers
   built with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl
   libavutil      55. 22.101 / 55. 22.101
   libavcodec     57. 38.100 / 57. 38.100
   libavformat    57. 34.103 / 57. 34.103
   libavdevice    57.  0.101 / 57.  0.101
   libavfilter     6. 44.100 /  6. 44.100
   libswscale      4.  1.100 /  4.  1.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
 Input #0, h264, from 'nondeterministic_cut.h264':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 1440x1080
 [SAR 1:1 DAR 4:3], 25 fps, 30 tbr, 1200k tbn
 [framecrc @ 0x3dff680] Using AVStream.codec to pass codec parameters to
 muxers is deprecated, use AVStream.codecpar instead.
 #software: Lavf57.34.103
 #tb 0: 1/30
 #media_type 0: video
 #codec_id 0: rawvideo
 #dimensions 0: 1440x1080
 #sar 0: 1/1
 Output #0, framecrc, to 'pipe:':
   Metadata:
     encoder         : Lavf57.34.103
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1440x1080
 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 30 fps, 30 tbn
     Metadata:
       encoder         : Lavc57.38.100 rawvideo
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
 Press [q] to stop, [?] for help
 0,          0,          0,        1,  2332800, 0x009dacb8
 0,          1,          1,        1,  2332800, 0xb1e50764
 0,          2,          2,        1,  2332800, 0xe29481e0
 0,          3,          3,        1,  2332800, 0x0b1b4de4
 0,          4,          4,        1,  2332800, 0x726a644c
 0,          5,          5,        1,  2332800, 0x7a09c4a5
 0,          6,          6,        1,  2332800, 0x2e9059ea
 0,          7,          7,        1,  2332800, 0x52071fdc
 0,          8,          8,        1,  2332800, 0x4fa00417
 0,          9,          9,        1,  2332800, 0x6037fb4d
 0,         10,         10,        1,  2332800, 0x887ffae2
 0,         11,         11,        1,  2332800, 0x887ffae2
 0,         12,         12,        1,  2332800, 0x3e6e0cb8
 0,         13,         13,        1,  2332800, 0x3e6e0cb8
 0,         14,         14,        1,  2332800, 0x3e6e0cb8
 0,         15,         15,        1,  2332800, 0x3e6e0cb8
 0,         16,         16,        1,  2332800, 0x3e6e0cb8
 0,         17,         17,        1,  2332800, 0x3e6e0cb8
 0,         18,         18,        1,  2332800, 0x3e6e0cb8
 0,         19,         19,        1,  2332800, 0x3e6e0cb8
 0,         20,         20,        1,  2332800, 0x3e6e0cb8
 0,         21,         21,        1,  2332800, 0x3e6e0cb8
 0,         22,         22,        1,  2332800, 0x3e6e0cb8
 0,         23,         23,        1,  2332800, 0x3e6e0cb8
 0,         24,         24,        1,  2332800, 0x3e6e0cb8
 0,         25,         25,        1,  2332800, 0x3e6e0cb8
 0,         26,         26,        1,  2332800, 0x3e6e0cb8
 0,         27,         27,        1,  2332800, 0x3e6e0cb8
 0,         28,         28,        1,  2332800, 0x3e6e0cb8
 0,         29,         29,        1,  2332800, 0x824bb91b
 frame=   30 fps=0.0 q=-0.0 Lsize=       2kB time=00:00:01.00 bitrate=
 14.9kbits/s speed=23.8x
 video:68344kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 }}}
 {{{
 $ ffmpeg -threads 8 -i nondeterministic_cut.h264 -f framecrc -
 ffmpeg version N-79584-g7b7c338 Copyright (c) 2000-2016 the FFmpeg
 developers
   built with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl
   libavutil      55. 22.101 / 55. 22.101
   libavcodec     57. 38.100 / 57. 38.100
   libavformat    57. 34.103 / 57. 34.103
   libavdevice    57.  0.101 / 57.  0.101
   libavfilter     6. 44.100 /  6. 44.100
   libswscale      4.  1.100 /  4.  1.100
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
 Input #0, h264, from 'nondeterministic_cut.h264':
   Duration: N/A, bitrate: N/A
     Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 1440x1080
 [SAR 1:1 DAR 4:3], 25 fps, 30 tbr, 1200k tbn
 [framecrc @ 0x3976680] Using AVStream.codec to pass codec parameters to
 muxers is deprecated, use AVStream.codecpar instead.
 #software: Lavf57.34.103
 #tb 0: 1/30
 #media_type 0: video
 #codec_id 0: rawvideo
 #dimensions 0: 1440x1080
 #sar 0: 1/1
 Output #0, framecrc, to 'pipe:':
   Metadata:
     encoder         : Lavf57.34.103
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1440x1080
 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 30 fps, 30 tbn
     Metadata:
       encoder         : Lavc57.38.100 rawvideo
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
 Press [q] to stop, [?] for help
 0,          0,          0,        1,  2332800, 0x009dacb8
 0,          1,          1,        1,  2332800, 0xb1e50764
 0,          2,          2,        1,  2332800, 0xe29481e0
 0,          3,          3,        1,  2332800, 0x0b1b4de4
 0,          4,          4,        1,  2332800, 0x726a644c
 0,          5,          5,        1,  2332800, 0x7a09c4a5
 0,          6,          6,        1,  2332800, 0x2e9059ea
 0,          7,          7,        1,  2332800, 0x52071fdc
 0,          8,          8,        1,  2332800, 0x4fa00417
 0,          9,          9,        1,  2332800, 0x6037fb4d
 0,         10,         10,        1,  2332800, 0x887ffae2
 0,         11,         11,        1,  2332800, 0x887ffae2
 0,         12,         12,        1,  2332800, 0xc8ed909d
 0,         13,         13,        1,  2332800, 0xc8ed909d
 0,         14,         14,        1,  2332800, 0xc8ed909d
 0,         15,         15,        1,  2332800, 0xc8ed909d
 0,         16,         16,        1,  2332800, 0xc8ed909d
 0,         17,         17,        1,  2332800, 0xc8ed909d
 0,         18,         18,        1,  2332800, 0xc8ed909d
 0,         19,         19,        1,  2332800, 0xc8ed909d
 0,         20,         20,        1,  2332800, 0xc8ed909d
 0,         21,         21,        1,  2332800, 0xc8ed909d
 0,         22,         22,        1,  2332800, 0xc8ed909d
 0,         23,         23,        1,  2332800, 0xc8ed909d
 0,         24,         24,        1,  2332800, 0xc8ed909d
 0,         25,         25,        1,  2332800, 0xc8ed909d
 0,         26,         26,        1,  2332800, 0xc8ed909d
 0,         27,         27,        1,  2332800, 0xc8ed909d
 0,         28,         28,        1,  2332800, 0xc8ed909d
 0,         29,         29,        1,  2332800, 0x824bb91b
 frame=   30 fps=0.0 q=-0.0 Lsize=       2kB time=00:00:01.00 bitrate=
 14.9kbits/s speed=22.8x
 video:68344kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5458#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list