Opened 6 years ago

Closed 6 years ago

#2371 closed defect (fixed)

h264 decoding regression in ref frame management

Reported by: heleppkes Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: h264 regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Ever since a recent change (specifically 01a0283), h264 decoding of this particular file is broken.

The file is not without its own problems, however the decoder seemed to handle it fine before.

How to reproduce:

% ffmpeg -i H.264_10bit.mp4 test.avi
ffmpeg version N-51032-g9f95e35 Copyright (c) 2000-2013 the FFmpeg developers
  built on Mar 17 2013 07:59:15 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl
  libavutil      52. 19.101 / 52. 19.101
  libavcodec     55.  0.100 / 55.  0.100
  libavformat    55.  0.100 / 55.  0.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 47.102 /  3. 47.102
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'D:\H.264_10bit.mp4'.
Reading option 'test2.avi' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set libav* logging level) with argument 99.
Successfully parsed a group of options.
Parsing a group of options: input file D:\H.264_10bit.mp4.
Successfully parsed a group of options.
Opening an input file: D:\H.264_10bit.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 032EB820] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 032EB820] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 032EB820] File position before avformat_find_stream_info() is 4464
[h264 @ 003C9A00] no picture 
[mov,mp4,m4a,3gp,3g2,mj2 @ 032EB820] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 032EB820] File position after avformat_find_stream_info() is 472524
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\H.264_10bit.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42M4V mp41isomiso2iso3iso4iso5iso6avc1M4A 
    creation_time   : 2013-03-17 03:42:05
  Duration: 00:00:07.84, start: 0.021625, bitrate: 9993 kb/s
    Stream #0:0(jpn), 1, 1/24000: Video: h264 (High 10) (avc1 / 0x31637661), yuv420p10le, 1920x1080 [SAR 1:1 DAR 16:9], 1001/48000, 7597 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 2013-03-17 03:42:05
      handler_name    : Video
    Stream #0:1(jpn), 6, 1/48000: Audio: alac (alac / 0x63616C61), 48000 Hz, 5.1, s16p, 2361 kb/s
    Metadata:
      creation_time   : 2013-03-17 03:42:05
      handler_name    : Audio
Successfully opened the file.
Parsing a group of options: output file test2.avi.
Successfully parsed a group of options.
Opening an output file: test2.avi.
Successfully opened the file.
[buffer @ 032F0060] Setting entry with key 'video_size' to value '1920x1080'
[buffer @ 032F0060] Setting entry with key 'pix_fmt' to value '72'
[buffer @ 032F0060] Setting entry with key 'time_base' to value '1/24000'
[buffer @ 032F0060] Setting entry with key 'pixel_aspect' to value '1/1'
[buffer @ 032F0060] Setting entry with key 'sws_param' to value 'flags=2'
[buffer @ 032F0060] Setting entry with key 'frame_rate' to value '24000/1001'
[graph 0 input from stream 0:0 @ 033D6E40] w:1920 h:1080 pixfmt:yuv420p10le tb:1/24000 fr:24000/1001 sar:1/1 sws_param:flags=2
[scale @ 03A60060] Setting 'w' to value '0'
[scale @ 03A60060] Setting 'h' to value '0'
[scale @ 03A60060] Setting 'flags' to value '0x4'
[auto-inserted scaler 0 @ 033D7260] w:0 h:0 flags:'0x4' interl:0
[format @ 033D7120] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[auto-inserted scaler 0 @ 033D7260] w:1920 h:1080 fmt:yuv420p10le sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1 flags:0x4
[abuffer @ 032F0160] Setting entry with key 'time_base' to value '1/48000'
[abuffer @ 032F0160] Setting entry with key 'sample_rate' to value '48000'
[abuffer @ 032F0160] Setting entry with key 'sample_fmt' to value 's16p'
[abuffer @ 032F0160] Setting entry with key 'channel_layout' to value '0x3f'
[graph 1 input from stream 0:1 @ 003CB080] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3f
[aformat @ 033D75A0] Setting entry with key 'sample_fmts' to value 'fltp'
[aformat @ 033D75A0] Setting entry with key 'channel_layouts' to value '0x4,0x3,0x103,0x7,0x603,0x33,0x107,0x607,0x37,0xc,0xb,0x10b,0xf,0x60b,0x3b,0x10f,0x60f,0x3f'
[audio format for output stream 0:1 @ 003CB140] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:1'
[auto-inserted resampler 0 @ 003CB1A0] ch:6 chl:5.1 fmt:s16p r:48000Hz -> ch:6 chl:5.1 fmt:fltp r:48000Hz
[mpeg4 @ 03B56480] detected 8 logical cores
[mpeg4 @ 03B56480] intra_quant_bias = 0 inter_quant_bias = -64
[h264 @ 003C9A00] detected 8 logical cores
Output #0, avi, to 'test2.avi':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42M4V mp41isomiso2iso3iso4iso5iso6avc1M4A 
    ISFT            : Lavf55.0.100
    Stream #0:0(jpn), 0, 1001/24000: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1001/24000, q=2-31, 200 kb/s, 23.98 tbn, 23.98 tbc
    Metadata:
      creation_time   : 2013-03-17 03:42:05
      handler_name    : Video
    Stream #0:1(jpn), 0, 4/125: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1, fltp, 448 kb/s
    Metadata:
      creation_time   : 2013-03-17 03:42:05
      handler_name    : Audio
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (alac -> ac3)
Press [q] to stop, [?] for help
[h264 @ 032EB100] no picture 
[h264 @ 03AC2D60] no picture 
[h264 @ 03AC3920] Missing reference picture, default is 65540
[h264 @ 03AC3920] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65544
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC48C0] Missing reference picture, default is 65548
[h264 @ 03AC48C0] decode_slice_header error
[h264 @ 03AC2D60] Missing reference picture, default is 65552
[h264 @ 03AC2D60] decode_slice_header error
[h264 @ 03AC3520] Missing reference picture, default is 65556
[h264 @ 03AC3520] decode_slice_header error
[h264 @ 03AC44C0] Missing reference picture, default is 65564
[h264 @ 03AC44C0] decode_slice_header error
[h264 @ 03AC3140] Missing reference picture, default is 65572
[h264 @ 03AC3140] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65580
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC2D60] Missing reference picture, default is 65588
[h264 @ 03AC2D60] decode_slice_header error
[h264 @ 03AC3D00] Missing reference picture, default is 65596
[h264 @ 03AC3D00] decode_slice_header error
[h264 @ 032EB100] Missing reference picture, default is 65604
[h264 @ 032EB100] decode_slice_header error
[h264 @ 03AC3920] Missing reference picture, default is 65612
[h264 @ 03AC3920] decode_slice_header error
[h264 @ 03AC48C0] Missing reference picture, default is 65620
[h264 @ 03AC48C0] decode_slice_header error
[h264 @ 03AC3520] Missing reference picture, default is 65628
[h264 @ 03AC3520] decode_slice_header error
[h264 @ 03AC44C0] Missing reference picture, default is 65636
[h264 @ 03AC44C0] decode_slice_header error
[h264 @ 03AC3140] Missing reference picture, default is 65644
[h264 @ 03AC3140] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65652
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC2D60] Missing reference picture, default is 65660
[h264 @ 03AC2D60] decode_slice_header error
[h264 @ 03AC3D00] Missing reference picture, default is 65668
[h264 @ 03AC3D00] decode_slice_header error
[h264 @ 032EB100] Missing reference picture, default is 65676
[h264 @ 032EB100] decode_slice_header error
frame=   47 fps=0.0 q=31.0 size=    1928kB time=00:00:03.58 bitrate=4407.9kbits/s    
Missing reference picture, default is 65684
[h264 @ 03AC3920] decode_slice_header error
[h264 @ 03AC48C0] Missing reference picture, default is 65692
[h264 @ 03AC48C0] decode_slice_header error
[h264 @ 03AC3520] Missing reference picture, default is 65700
[h264 @ 03AC3520] decode_slice_header error
[h264 @ 03AC44C0] Missing reference picture, default is 65708
[h264 @ 03AC44C0] decode_slice_header error
[h264 @ 03AC3140] Missing reference picture, default is 65716
[h264 @ 03AC3140] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65724
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC2D60] Missing reference picture, default is 65732
[h264 @ 03AC2D60] decode_slice_header error
[h264 @ 03AC3D00] Missing reference picture, default is 65740
[h264 @ 03AC3D00] decode_slice_header error
[h264 @ 032EB100] Missing reference picture, default is 65748
[h264 @ 032EB100] decode_slice_header error
[h264 @ 03AC3140] Missing reference picture, default is 65752
[h264 @ 03AC3140] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65760
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC3140] Missing reference picture, default is 65540
[h264 @ 03AC3140] decode_slice_header error
[h264 @ 03AC3920] Missing reference picture, default is 65544
[h264 @ 03AC3920] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65548
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC48C0] Missing reference picture, default is 65552
[h264 @ 03AC48C0] decode_slice_header error
[h264 @ 03AC2D60] Missing reference picture, default is 65556
[h264 @ 03AC2D60] decode_slice_header error
[h264 @ 03AC48C0] Missing reference picture, default is 65570
[h264 @ 03AC48C0] decode_slice_header error
[h264 @ 03AC3920] Missing reference picture, default is 65580
[h264 @ 03AC3920] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65584
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC48C0] Missing reference picture, default is 65588
[h264 @ 03AC48C0] decode_slice_header error
[h264 @ 03AC2D60] Missing reference picture, default is 65592
[h264 @ 03AC2D60] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65602
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC3920] Missing reference picture, default is 65616
[h264 @ 03AC3920] decode_slice_header error
frame=  107 fps=107 q=31.0 size=    3343kB time=00:00:06.65 bitrate=4114.3kbits/s    
Missing reference picture, default is 65626
[h264 @ 032EB100] decode_slice_header error
[h264 @ 03AC3140] Missing reference picture, default is 65630
[h264 @ 03AC3140] decode_slice_header error
[h264 @ 03AC40E0] Missing reference picture, default is 65638
[h264 @ 03AC40E0] decode_slice_header error
[h264 @ 03AC2D60] Missing reference picture, default is 65646
[h264 @ 03AC2D60] decode_slice_header error
[h264 @ 03AC3D00] Missing reference picture, default is 65654
[h264 @ 03AC3D00] decode_slice_header error
[h264 @ 03AC44C0] Missing reference picture, default is 65658
[h264 @ 03AC44C0] decode_slice_header error
[h264 @ 03AC3520] Missing reference picture, default is 65668
[h264 @ 03AC3520] decode_slice_header error
[h264 @ 03AC44C0] Missing reference picture, default is 65676
[h264 @ 03AC44C0] decode_slice_header error
[output stream 0:0 @ 033D7020] EOF on sink link output stream 0:0:default.
[output stream 0:1 @ 003CB0E0] EOF on sink link output stream 0:1:default.
No more output streams to write to, finishing.
frame=  137 fps=108 q=31.0 Lsize=    4422kB time=00:00:07.93 bitrate=4564.7kbits/s    

video:3968kB audio:434kB subtitle:0 global headers:0kB muxing overhead 0.456228%
[AVIOContext @ 003C9380] Statistics: 9794102 bytes read, 0 seeks

Sample here: http://files.1f0.de/samples/h264refframeregression.mp4
With the patch in question (01a0283) reverted, the file plays fine. The log still shows the "Missing reference picture" errors, however the "decode_slice_header error" messages go away, and so does the image corruption.

Change History (2)

comment:1 Changed 6 years ago by cehoyos

  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

comment:2 Changed 6 years ago by michael

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.