#4888: 62bd8deef causes a regression in HEVC decoding ----------------------------------+-------------------------------------- Reporter: staalebk | Type: defect Status: new | Priority: normal Component: avcodec | Version: git-master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ----------------------------------+-------------------------------------- Summary of the bug: I'm trying to extract a thumb from the middle of a live TS, containing one HEVC-stream. Before this patch I would always get a good looking thumb, but with this patch I would for the most part get a mostly gray frame. If I generates a few more thumbnails i see that it eventually spits out the same frame that ffmpeg before this patch produced as the first thumb, and it looks OK. However it is much more blocky than what the previous ffmpeg produced. How to reproduce (b7baebb75 is the commit just before the patch): {{{ % ./ffmpeg.b7baebb75 -an -i hevc_fail.ts -vframes 1 before_patch%d.jpg ffmpeg version N-74781-gb7baebb Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.7 (Debian 4.7.2-5) configuration: libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 [NULL @ 0x1f74780] PPS id out of range: 0 [hevc @ 0x1f74780] PPS id out of range: 0 [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. [hevc @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1f74780] Error parsing NAL unit #2. Input #0, mpegts, from 'hevc_fail.ts': Duration: 00:00:02.50, start: 2237.360033, bitrate: 7740 kb/s Stream #0:0[0x1e1]: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc [swscaler @ 0x1f9a140] deprecated pixel format used, make sure you did set range correctly Output #0, image2, to 'before_patch%d.jpg': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: mjpeg, yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc Metadata: encoder : Lavc56.60.100 mjpeg Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> mjpeg (native)) Press [q] to stop, [?] for help [NULL @ 0x1f74780] PPS id out of range: 0 [hevc @ 0x2052600] PPS id out of range: 0 [hevc @ 0x2052600] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x20609a0] PPS id out of range: 0 [hevc @ 0x20609a0] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 [hevc @ 0x2072400] PPS id out of range: 0 [hevc @ 0x2072400] Error parsing NAL unit #2. [hevc @ 0x2083e60] PPS id out of range: 0 [hevc @ 0x2083e60] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x20958c0] PPS id out of range: 0 [hevc @ 0x20958c0] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 [hevc @ 0x20a7320] PPS id out of range: 0 [hevc @ 0x20a7320] Error parsing NAL unit #2. [hevc @ 0x20b8d80] PPS id out of range: 0 [hevc @ 0x20b8d80] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x20ca7e0] PPS id out of range: 0 [hevc @ 0x20ca7e0] Error parsing NAL unit #2. Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x20dc240] PPS id out of range: 0 [hevc @ 0x20dc240] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x2052600] PPS id out of range: 0 [hevc @ 0x2052600] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x20609a0] PPS id out of range: 0 [hevc @ 0x20609a0] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x2072400] PPS id out of range: 0 [hevc @ 0x2072400] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x2083e60] PPS id out of range: 0 [hevc @ 0x2083e60] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x20958c0] PPS id out of range: 0 [hevc @ 0x20958c0] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x20a7320] PPS id out of range: 0 [hevc @ 0x20a7320] Error parsing NAL unit #2. [NULL @ 0x1f74780] PPS id out of range: 0 Error while decoding stream #0:0: Invalid data found when processing input [hevc @ 0x20b8d80] PPS id out of range: 0 [hevc @ 0x20b8d80] Error parsing NAL unit #2. Error while decoding stream #0:0: Invalid data found when processing input Last message repeated 7 times frame= 1 fps=0.0 q=7.5 Lsize=N/A time=00:00:00.75 bitrate=N/A video:108kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown Conversion failed! }}} This gives me one image, before_patch1.jpg that looks completly fine. http://kolbu.ws/~chiller/ffmpeg_bug/before_patch1.jpg Now I do the same with the patch: {{{ ffmpeg version N-74782-g62bd8de Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.7 (Debian 4.7.2-5) configuration: libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 [NULL @ 0x1dc2780] PPS id out of range: 0 [hevc @ 0x1dc2780] PPS id out of range: 0 [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. [hevc @ 0x1dc2780] PPS id out of range: 0 Last message repeated 1 times [hevc @ 0x1dc2780] Error parsing NAL unit #2. Input #0, mpegts, from 'hevc_fail.ts': Duration: 00:00:02.50, start: 2237.360033, bitrate: 7740 kb/s Stream #0:0[0x1e1]: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc [swscaler @ 0x1dec4e0] deprecated pixel format used, make sure you did set range correctly Output #0, image2, to 'with_patch%d.jpg': Metadata: encoder : Lavf56.40.101 Stream #0:0: Video: mjpeg, yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc Metadata: encoder : Lavc56.60.100 mjpeg Stream mapping: Stream #0:0 -> #0:0 (hevc (native) -> mjpeg (native)) Press [q] to stop, [?] for help [hevc @ 0x1ea0760] Could not find ref with POC 12 [hevc @ 0x1ea0760] Could not find ref with POC 15 frame= 1 fps=0.0 q=5.0 Lsize=N/A time=00:00:00.04 bitrate=N/A video:69kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown }}} This gives me one file with_patch1.jpg that looks garbaged. http://kolbu.ws/~chiller/ffmpeg_bug/with_patch1.jpg If I re-run the last command with -vframes 100 it generates 60 images, where image 18 is almost identical to the before_patch1.jpg, except a bit more blocky. http://kolbu.ws/~chiller/ffmpeg_bug/with_patch18.jpg Here is the link to the .ts-file: http://kolbu.ws/~chiller/ffmpeg_bug/hevc_fail.ts and all files involved can be viewed here: http://kolbu.ws/~chiller/ffmpeg_bug/ (The most important ones are attached) -- Ticket URL: <https://trac.ffmpeg.org/ticket/4888> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker