Opened 2 years ago

Closed 2 years ago

#8732 closed defect (invalid)

videotoolbox decoding Could not find ref with POC 0

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

Description

videotoolbox fails to decode a 4k UHD HEVC.

sample file: https://0x0.st/iVhY.mkv
related mpv issue: https://github.com/mpv-player/mpv/issues/5893

ffmpeg -hwaccel videotoolbox -i "/Volumes/AkemiData/Downloads/ffmpeg_videotoolbox_issues/s_ge.mkv.mkv" -f null -
ffmpeg version git-2020-06-11-bc8ab084 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.12)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-bc8ab08 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=/usr/bin/clang --host-cflags='-Os -w -pipe -march=nehalem -mmacosx-version-min=10.14 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -fno-stack-check' --host-ldflags='-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/python@3.8/lib -L/usr/local/opt/sqlite/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/lib -F/usr/local/Frameworks -Wl,-headerpad_max_install_names -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk' --enable-ffplay --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-gpl --enable-nonfree --enable-hardcoded-tables --enable-libfdk-aac --enable-libgme --enable-libbs2b --enable-libgsm --enable-libxml2 --enable-openssl --enable-libwavpack --enable-libzmq --enable-libzimg --enable-opencl
  libavutil      56. 54.100 / 56. 54.100
  libavcodec     58. 92.100 / 58. 92.100
  libavformat    58. 46.101 / 58. 46.101
  libavdevice    58. 11.100 / 58. 11.100
  libavfilter     7. 86.100 /  7. 86.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, matroska,webm, from '/Volumes/AkemiData/Downloads/ffmpeg_videotoolbox_issues/s_ge.mkv.mkv':
  Metadata:
    encoder         : libebml v1.3.5 + libmatroska v1.4.8
    creation_time   : 2017-12-30T19:36:48.000000Z
  Duration: 02:17:24.66, start: 0.000000, bitrate: 99 kb/s
    Chapter #0:0: start 0.000000, end 672.213000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 672.213000, end 1210.501000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 1210.501000, end 1838.336000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 1838.336000, end 2481.562000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 2481.562000, end 3097.344000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 3097.344000, end 3714.920000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 3714.920000, end 4250.997000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 4250.997000, end 4827.489000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 4827.489000, end 5663.741000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 5663.741000, end 6275.102000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 6275.102000, end 7021.723000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 7021.723000, end 7578.196000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 7578.196000, end 8244.662000
    Metadata:
      title           : Chapter 13
    Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Stream #0:1(rus): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s32p (24 bit) (default)
    Metadata:
      title           : Dub, Blu-Ray
    Stream #0:2(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : А. Смирнов
    Stream #0:3(eng): Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s32p (24 bit)
    Stream #0:4(rus): Subtitle: subrip (default)
    Metadata:
      title           : forced
    Stream #0:5(rus): Subtitle: subrip
    Metadata:
      title           : full
    Stream #0:6(eng): Subtitle: subrip
    Metadata:
      title           : forced
    Stream #0:7(eng): Subtitle: subrip
    Metadata:
      title           : full
    Stream #0:8(eng): Subtitle: subrip
    Metadata:
      title           : SDH #1
    Stream #0:9(eng): Subtitle: subrip
    Metadata:
      title           : SDH #2
    Stream #0:10(eng): Subtitle: subrip
    Metadata:
      title           : SDH-Colored
    Stream #0:11: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 396x500 [SAR 300:300 DAR 99:125], 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      filename        : poster.jpg
      mimetype        : image/jpeg
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (dts (dca) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Error creating Videotoolbox decoder.
videotoolbox hwaccel requested for input stream #0:0, but cannot be initialized.
[hevc @ 0x7feff2837000] Error parsing NAL unit #6.
[hevc @ 0x7feff2862000] Could not find ref with POC 0
Error while decoding stream #0:0: Operation not permitted
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf58.46.101
    Chapter #0:0: start 0.000000, end 672.213000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 672.213000, end 1210.501000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 1210.501000, end 1838.336000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 1838.336000, end 2481.562000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 2481.562000, end 3097.344000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 3097.344000, end 3714.920000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 3714.920000, end 4250.997000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 4250.997000, end 4827.489000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 4827.489000, end 5663.741000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 5663.741000, end 6275.102000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 6275.102000, end 7021.723000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 7021.723000, end 7578.196000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 7578.196000, end 8244.662000
    Metadata:
      title           : Chapter 13
    Stream #0:0(eng): Video: wrapped_avframe, yuv420p10le, 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc58.92.100 wrapped_avframe
    Stream #0:1(rus): Audio: pcm_s16le, 48000 Hz, 5.1(side), s16, 4608 kb/s (default)
    Metadata:
      title           : Dub, Blu-Ray
      encoder         : Lavc58.92.100 pcm_s16le
[matroska,webm @ 0x7feff3000000] File ended prematurelytrate=N/A speed=1.95x    
frame=  347 fps= 45 q=-0.0 Lsize=N/A time=00:00:14.59 bitrate=N/A speed= 1.9x    
video:182kB audio:8190kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Change History (4)

comment:1 by Carl Eugen Hoyos, 2 years ago

Why do you believe there is an issue that can be fixed in FFmpeg?

comment:2 by der_richter, 2 years ago

i really can't make a strong case here. for testing just now, copied the video stream via ffmpeg into an mp4 container and tagged the stream appropriately for quicktime (so it can decode and play it back). quicktime can only decode it via sw too, cpu utilisation is similar to ffmpeg.

if you were wondering why i didn't check that before. i didn't get this sample to playback in quicktime at all and jeeb mentioned one has to tag the video stream for it appropriately just now.

i guess this can most likely be closed because this seems to be a limitation of videotoolbox or related.

just in case anyone wants to know:

ffmpeg -i iVhY.mkv -map 0:0 -c copy -tag:v hvc1 iVhY.mp4

comment:3 by Balling, 2 years ago

Status: newopen

There is this crazy issue #7950 that is not actually fixed and is not fixed by method there. IMHO, it is the problem. All b-frame hevc nvenc middle and now finally each (each is VERY broken though by in itself in most apps) is broken like this. IMHO connected to this issue #7895.
Of course all those Blu-rays in m2ts also use b frames, are not they? Anyway it can also just be because of "ATEME Titan File 3.8.8" encoder.

comment:4 by Carl Eugen Hoyos, 2 years ago

Resolution: invalid
Status: openclosed
Note: See TracTickets for help on using tickets.