Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#528 closed defect (fixed)

Image corruption in H264 from DVB

Reported by: Hendrik Owned by:
Priority: minor Component: avcodec
Version: git-master Keywords: H264 mpegts
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Hi,

following sample shows image corruption during decoding/transcoding/playback. The problem can be seen both with ffmpeg (after transcode into .avi for example), or with ffplay during playback.

The problem occurs around 3 seconds into playback, when the laptop keyboard is shown, as well as briefly before the scene switch.

Sample link:

http://files.1f0.de/samples/BBCOneHD20110921_21161.ts

Full ffmpeg output:

ffmpeg version N-33213-g2a9046c, Copyright (c) 2000-2011 the FFmpeg developers

built on Oct 2 2011 10:30:12 with gcc 4.6.1
configuration: --enable-gpl --enable-version3 --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 51. 18. 0 / 51. 18. 0
libavcodec 53. 19. 0 / 53. 19. 0
libavformat 53. 13. 0 / 53. 13. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 43. 6 / 2. 43. 6
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0

[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS referenced
[h264 @ 03DFB180] non-existing SPS 0 referenced in buffering period
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] non-existing PPS 0 referenced
[h264 @ 03DFB180] decode_slice_header error
[h264 @ 03DFB180] no frame!
[mpegts @ 01B191A0] PES packet size mismatch
[mpegts @ 01B191A0] Could not find codec parameters (Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16)
[mpegts @ 01B191A0] Could not find codec parameters (Unknown: none ([11][0][0][0] / 0x000B))

Last message repeated 3 times

[mpegts @ 01B191A0] Could not find codec parameters (Unknown: none ([5][0][0][0] / 0x0005))

Last message repeated 9 times

[NULL @ 01B1FA40] start time is not set in estimate_timings_from_pts
[NULL @ 03E015C0] start time is not set in estimate_timings_from_pts
[NULL @ 03E078E0] start time is not set in estimate_timings_from_pts
[NULL @ 03E0D9C0] start time is not set in estimate_timings_from_pts
[NULL @ 03E13AC0] start time is not set in estimate_timings_from_pts
[NULL @ 03E19A20] start time is not set in estimate_timings_from_pts
[NULL @ 03E1FAE0] start time is not set in estimate_timings_from_pts
[NULL @ 03E25AE0] start time is not set in estimate_timings_from_pts
[NULL @ 03E2BA80] start time is not set in estimate_timings_from_pts
[NULL @ 03E319C0] start time is not set in estimate_timings_from_pts
[NULL @ 03E37AA0] start time is not set in estimate_timings_from_pts
[NULL @ 03E3DA00] start time is not set in estimate_timings_from_pts
[NULL @ 03E43AE0] start time is not set in estimate_timings_from_pts
[NULL @ 03E49A80] start time is not set in estimate_timings_from_pts
[NULL @ 03E8AFA0] start time is not set in estimate_timings_from_pts
[NULL @ 03E9C380] start time is not set in estimate_timings_from_pts
[NULL @ 03EA2280] start time is not set in estimate_timings_from_pts
[mpegts @ 01B191A0] PES packet size mismatch

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 50.00 (50/1)
Input #0, mpegts, from 'BBCOneHD20110921_2116#1.ts':

Duration: 00:00:05.40, start: 46167.342433, bitrate: 7635 kb/s
Program 6941

Stream #0:0[0x1518]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 31.19 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x151a](NAR): Audio: mp3 ([3][0][0][0] / 0x0003), 0 channels, s16
Stream #0:2[0x151b](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Stream #0:3[0xf05]: Unknown: none ([11][0][0][0] / 0x000B)
Stream #0:4[0xf06]: Unknown: none ([11][0][0][0] / 0x000B)
Stream #0:5[0xf07]: Unknown: none ([11][0][0][0] / 0x000B)
Stream #0:6[0xf08]: Unknown: none ([11][0][0][0] / 0x000B)
Stream #0:7[0x151c](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:8[0xf00]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:9[0xf01]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:10[0xf02]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:11[0xf03]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:12[0xf04]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:13[0x911]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:14[0x912]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:15[0x913]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:16[0x1519](eng): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, s16, 192 kb/s
Stream #0:17[0x919]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:18[0x91a]: Unknown: none ([5][0][0][0] / 0x0005)

[buffer @ 040DFF60] w:1440 h:1080 pixfmt:yuv420p tb:1/1000000 sar:4/3 sws_param:
Output #0, avi, to 'bbcone.avi':

Metadata:

ISFT : Lavf53.13.0
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 200 kb/s, 50 tbn, 50 tbc
Stream #0:1(eng): Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 128 kb/s

Stream mapping:

Stream #0.0 -> #0.0 (h264 -> mpeg4)
Stream #0.16 -> #0.1 (ac3 -> libmp3lame)

Press [q] to stop, ? for help
frame= 20 fps= 0 q=31.0 size= 40kB time=00:00:01.89 bitrate= 172.8kbits/s
frame= 53 fps= 52 q=31.0 size= 324kB time=00:00:03.43 bitrate= 773.1kbits/s
PES packet size mismatch
[h264 @ 03DFB180] error while decoding MB 41 32, bytestream (td)
[h264 @ 03DFB180] concealing 3248 DC, 3248 AC, 3248 MV errors
frame= 79 fps= 50 q=31.0 size= 600kB time=00:00:04.72 bitrate=1040.2kbits/s
incomplete frame
frame= 81 fps= 51 q=31.0 Lsize= 943kB time=00:00:04.87 bitrate=1585.7kbits/s

video:846kB audio:76kB global headers:0kB muxing overhead 2.267769%

Attachments (2)

ticket528.264 (2.2 MB ) - added by Carl Eugen Hoyos 13 years ago.
ticket528short.264 (1.8 MB ) - added by Carl Eugen Hoyos 13 years ago.

Change History (7)

by Carl Eugen Hoyos, 13 years ago

Attachment: ticket528.264 added

by Carl Eugen Hoyos, 13 years ago

Attachment: ticket528short.264 added

comment:1 by Carl Eugen Hoyos, 13 years ago

Reproduced by developer: set
Status: newopen

The original sample shows 11 wrong frames after the scene change.

This is reproducible with ticket528.264, which decodes ~33 frames correctly, then 11 wrong (framecrc: 0xcae18c42 - 0x9f3d95e7, bit-identical with the original sample), then 9 correct frames, all compared with the reference decoder.

$ ffmpeg -i ticket528.264 -qscale 2 out.avi
ffmpeg version N-33240-ga5dfeb6, Copyright (c) 2000-2011 the FFmpeg developers
  built on Oct  3 2011 10:53:02 with gcc 4.5.3
  configuration: --cc='/usr/local/gcc-4.5.3/bin/gcc -m32'
  libavutil    51. 19. 0 / 51. 19. 0
  libavcodec   53. 19. 0 / 53. 19. 0
  libavformat  53. 13. 0 / 53. 13. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 43. 6 /  2. 43. 6
  libswscale    2.  1. 0 /  2.  1. 0
[h264 @ 0x8cc7aa0] Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (50/2)
Input #0, h264, from 'ticket528.264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 28.07 fps, 25 tbr, 1200k tbn, 50 tbc
[buffer @ 0x8ccfe20] w:1440 h:1080 pixfmt:yuv420p tb:1/1000000 sar:4/3 sws_param:
[mpeg4 @ 0x8ccccc0] removing common factors from framerate
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf53.13.0
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0 (h264 -> mpeg4)
Press [q] to stop, [?] for help
frame=   52 fps= 34 q=2.0 Lsize=    1952kB time=00:00:02.08 bitrate=7687.5kbits/s dup=0 drop=2
video:1945kB audio:0kB global headers:0kB muxing overhead 0.352859%

ticket528short.264 contains all the corrupt frames from above (plus many frames before), but starts to decode in the middle of the originally corrupt block and outputs all frames correctly.

comment:2 by Carl Eugen Hoyos, 13 years ago

Keywords: H264 TS added; h264 artifact corruption removed

comment:3 by Carl Eugen Hoyos, 13 years ago

Priority: normalminor

The same eleven frames as before are still not decoded bit-identical with the reference decoder, but no artefacts are visible anymore afaict.

comment:4 by Carl Eugen Hoyos, 12 years ago

Resolution: fixed
Status: openclosed

The sample is decoded bit-identical with current git head.

comment:5 by Carl Eugen Hoyos, 10 years ago

Keywords: mpegts added; TS removed
Note: See TracTickets for help on using tickets.