Opened 12 days ago

Last modified 12 days ago

#6815 open defect

Regression recovering broken H264 stream

Reported by: w3sip 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

Summary of the bug:

With v3.1.7, the attached H264 input encounters an error, but recovers almost immediately. With v3.3.3 (and current master), it still will recover if AV_CODEC_FLAG2_CHUNKS flag isn't set (which is why ffmpeg works), but will never decode another frame, if the flag is provided.

How to reproduce:

Change ffmpeg.c by adding

ist->dec_ctx->flags2 |= AV_CODEC_FLAG2_CHUNKS;

before avcodec_open2 (not sure if there's a command line option to set it?)

% ffmpeg -threads 1 -i brokenStream.h264 -vcodec mpeg4 foo.mp4

n3.1.7 will recover after encountering an error
concealing 1580 DC, 1580 AC, 1580 MV errors in P frame

n3.3.3 will not

Attachments (1)

brokenStream_cut.h264 (2.4 MB) - added by cehoyos 12 days ago.

Change History (4)

comment:1 Changed 12 days ago by cehoyos

Please provide the input stream.

comment:2 Changed 12 days ago by w3sip

Here goes. For some reason it did not go through the first time.

https://www.dropbox.com/s/g28nnu5vksq1q1r/brokenStream.h264?dl=0

comment:3 in reply to: ↑ description Changed 12 days ago by cehoyos

  • Keywords h264 regression added
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Regression since 78c7197ea0e5c53393849a32dd6f49e3b89f7815

$ ffmpeg -flags2 +chunks -threads 1 -i brokenStream_cut.h264 out.mp4
ffmpeg version N-88612-gce52e43 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl
  libavutil      56.  0.100 / 56.  0.100
  libavcodec     58.  1.100 / 58.  1.100
  libavformat    58.  2.100 / 58.  2.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  0.101 /  7.  0.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Input #0, h264, from 'brokenStream_cut.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf58.2.100
    Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 1280x720, q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.1.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
[h264 @ 0x39b7f20] concealing 1580 DC, 1580 AC, 1580 MV errors in P frame
[h264 @ 0x39b7f20] Frame num change from 13 to 14
[h264 @ 0x39b7f20] decode_slice_header error
[h264 @ 0x39b7f20] concealing 1580 DC, 1580 AC, 1580 MV errors in P frame
[h264 @ 0x39b7f20] Frame num change from 13 to 15
[h264 @ 0x39b7f20] decode_slice_header error

...

[h264 @ 0x39b7f20] concealing 1580 DC, 1580 AC, 1580 MV errors in P frame
[h264 @ 0x39b7f20] Frame num change from 13 to 1
[h264 @ 0x39b7f20] decode_slice_header error
[h264 @ 0x39b7f20] concealing 1580 DC, 1580 AC, 1580 MV errors in P frame
[h264 @ 0x39b7f20] Frame num change from 13 to 0
[h264 @ 0x39b7f20] decode_slice_header error
[h264 @ 0x39b7f20] concealing 1580 DC, 1580 AC, 1580 MV errors in P frame
frame=   45 fps=0.0 q=31.0 Lsize=     506kB time=00:00:01.76 bitrate=2356.2kbits/s speed=2.21x
video:505kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.203155%

Changed 12 days ago by cehoyos

Note: See TracTickets for help on using tickets.