Opened 3 months ago

Last modified 3 months ago

#7340 new defect

Damaged h.264 input breaks the decoder

Reported by: cehoyos Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: h264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

http://ffmpeg.org/pipermail/ffmpeg-devel/2018-July/232704.html
A user provided a damaged raw h.264 stream that freezes after some time, this command starts to duplicate a certain frame after 107 seconds:

$ ffmpeg -vsync cfr -i input_with_error.h264 -qscale 2 out.avi
ffmpeg version N-91546-g1ffd63a Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.4.0 (GCC)
  configuration: --enable-gpl --enable-gnutls --enable-libxml2
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 22.100 / 58. 22.100
  libavformat    58. 17.101 / 58. 17.101
  libavdevice    58.  4.101 / 58.  4.101
  libavfilter     7. 26.100 /  7. 26.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] SPS unavailable in decode_picture_timing
[h264 @ 0x33c2e00] non-existing PPS 0 referenced
[h264 @ 0x33c2e00] decode_slice_header error
[h264 @ 0x33c2e00] no frame!
Input #0, h264, from 'input_with_error.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.25 fps, 29.97 tbr, 1200k tbn, 59.94 tbc
Please use -q:a or -q:v, -qscale is ambiguous
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[h264 @ 0x340a140] mmco: unref short failure
    Last message repeated 1 times
[h264 @ 0x340a140] number of reference frames (0+5) exceeds max (4; probably corrupt input), discarding one
[h264 @ 0x35d4c40] reference picture missing during reorder
[h264 @ 0x35d4c40] Missing reference picture, default is 65376
[h264 @ 0x35db980] reference picture missing during reorder
[h264 @ 0x35db980] Missing reference picture, default is 65377
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf58.17.101
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.22.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
[h264 @ 0x35ef440] Invalid NAL unit 6, skipping.0:00:10.74 bitrate=22060.9kbits/s dup=26 drop=0 speed=5.34x
[h264 @ 0x340a140] Invalid NAL unit 6, skipping.0:00:24.39 bitrate=21583.0kbits/s dup=26 drop=0 speed=5.39x
[h264 @ 0x33c6c40] Invalid NAL unit 6, skipping.0:00:43.91 bitrate=20155.6kbits/s dup=26 drop=0 speed=5.46x
[h264 @ 0x3404740] Invalid NAL unit 6, skipping.0:00:47.01 bitrate=19717.4kbits/s dup=26 drop=0 speed= 5.5x
[h264 @ 0x3662680] Invalid NAL unit 6, skipping.0:00:56.79 bitrate=23265.5kbits/s dup=26 drop=0 speed=5.38x
[NULL @ 0x33c2e00] non-existing PPS 17 referenced
[h264 @ 0x35d4c40] non-existing PPS 17 referenced
[h264 @ 0x35d4c40] decode_slice_header error
[h264 @ 0x35d4c40] no frame!
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x3662680] Invalid NAL unit 6, skipping.0:01:07.43 bitrate=22205.6kbits/s dup=27 drop=0 speed=5.37x
[NULL @ 0x33c2e00] missing picture in access unit with size 16rate=21945.1kbits/s dup=27 drop=0 speed=5.38x
[h264 @ 0x35d4c40] Invalid NAL unit 9, skipping.
[h264 @ 0x35d4c40] no frame!
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x35ef440] non-existing PPS 4 referenced0:01:16.54 bitrate=21398.7kbits/s dup=27 drop=0 speed=5.44x
[h264 @ 0x35ef440] decode_slice_header error
[h264 @ 0x35db980] Invalid NAL unit 6, skipping.
[h264 @ 0x3404740] Invalid NAL unit 6, skipping.0:01:19.54 bitrate=21118.1kbits/s dup=27 drop=0 speed=5.46x
[NULL @ 0x33c2e00] sps_id 3 out of rangeB time=00:01:22.64 bitrate=20883.5kbits/s dup=27 drop=0 speed=5.48x
[h264 @ 0x35bed40] sps_id 3 out of range
[h264 @ 0x33c6c40] Invalid NAL unit 6, skipping.0:01:28.95 bitrate=20298.8kbits/s dup=27 drop=0 speed=5.53x
[h264 @ 0x3404740] Invalid NAL unit 6, skipping.0:01:31.92 bitrate=20190.6kbits/s dup=27 drop=0 speed=5.54x
[h264 @ 0x35d4c40] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x35d4c40] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[NULL @ 0x33c2e00] non-existing PPS 10 referenced:01:45.97 bitrate=20858.7kbits/s dup=27 drop=0 speed=5.55x
[h264 @ 0x35d4c40] non-existing PPS 10 referenced
[h264 @ 0x35d4c40] decode_slice_header error
[h264 @ 0x35d4c40] no frame!
[h264 @ 0x35ed7c0] reference picture missing during reorder
[h264 @ 0x35ed7c0] Missing reference picture, default is 65682
[h264 @ 0x35ef440] mmco: unref short failure
    Last message repeated 1 times
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x35ef440] reference picture missing during reorder
[h264 @ 0x35ef440] Missing reference picture, default is 65683
[h264 @ 0x35ed7c0] mmco: unref short failure
    Last message repeated 1 times
[h264 @ 0x35db980] Invalid NAL unit 6, skipping.0:01:47.67 bitrate=21093.8kbits/s dup=27 drop=0 speed=5.35x
[h264 @ 0x33c6c40] Invalid NAL unit 6, skipping.
[h264 @ 0x3404740] Invalid NAL unit 6, skipping.
[h264 @ 0x33c6c40] Invalid NAL unit 6, skipping.0:01:47.67 bitrate=21093.8kbits/s dup=27 drop=0 speed=4.98x
[h264 @ 0x3404740] error while decoding MB 50 46, bytestream -15
More than 1000 frames duplicated
frame= 4546 fps=180 q=2.0 Lsize=  292468kB time=00:02:31.68 bitrate=15795.2kbits/s dup=1344 drop=0 speed=   6x
video:292353kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.039247%

Behaviour changes depending on how much of the provided file is read before the reception error, the following command starts encoding shortly before the issue above but also shows the remaining 40 seconds of the input stream:

$ ffmpeg -skip_initial_bytes 70000000 -vsync cfr -i input_with_error.h264 -qscale 2 out.avi

Change History (1)

Note: See TracTickets for help on using tickets.