Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HEVC Failing to decode on HDHomeRun Flex 4k #529

Open
williamthrilliam opened this issue Jan 24, 2025 · 5 comments
Open

HEVC Failing to decode on HDHomeRun Flex 4k #529

williamthrilliam opened this issue Jan 24, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@williamthrilliam
Copy link

When trying to decode HEVC (I think without the correct bitstream from this reddit post), ffmpeg fails to start encoding. This is any HEVC ATSC 3.0 Channels using the HDHomeRun Flex 4k by silicon dust (network tuner).

Steps To Reproduce

  1. Enable play Live HEVC channels
  2. Notice playing fails to start on web and androidtv
  3. Check logs reveal "Error parsing NAL unit # 4 and "PPS id out of range: 0" and "Failed to end picture decode issue: 23 (internal decoding error)."

Expected Behavior
HEVC live streams can be decoded and encoded using ffmpeg.

System (please complete the following information):

Ubuntu 24.04.1 LTS (GNU/Linux 6.8.0-48-generic x86_64)
Server version 10.10.4
Web version 10.10.4
Build version 10.10.4
Hardware Acceleration: QSV
CPU & GPU Model: Intel N6005

MediaInfo

FFmpeg Logs

{"Protocol":1,"Id":"native_bb89b94a78919553a440cd7481210990_9bd74ef4e6a5237225e66a53427f8dd2","Path":"http://192.168.87.128:8096/LiveTv/LiveStreamFiles/6b55cc26b2994eb89bbc88f3a9cb6c6b/stream.ts","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"ts","Size":null,"Name":null,"IsRemote":false,"ETag":null,"RunTimeTicks":null,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":false,"IsInfiniteStream":true,"UseMostCompatibleTranscodingProfile":true,"RequiresOpening":true,"OpenToken":null,"RequiresClosing":true,"LiveStreamId":"e2329f4997b378e64ccf8fa396deb76e_af999c25a00715699361240d4c6c7a53_native_bb89b94a78919553a440cd7481210990_9bd74ef4e6a5237225e66a53427f8dd2","BufferMs":0,"RequiresLooping":false,"SupportsProbing":true,"VideoType":null,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"hevc","CodecTag":null,"Language":null,"ColorRange":"tv","ColorSpace":"bt709","ColorTransfer":"bt709","ColorPrimaries":"bt709","DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Rotation":null,"Comment":null,"TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":1,"VideoRangeType":1,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"1080p HEVC SDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":20000000,"BitDepth":10,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":1080,"Width":1920,"AverageFrameRate":59.94006,"RealFrameRate":59.94006,"ReferenceFrameRate":59.94006,"Profile":"Main 10","Type":1,"AspectRatio":"16:9","Index":-1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p10le","Level":123,"IsAnamorphic":false},{"Codec":"ac4","CodecTag":"AC-4","Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Rotation":null,"Comment":null,"TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Default","LocalizedForced":null,"LocalizedExternal":"External","LocalizedHearingImpaired":null,"DisplayTitle":"AC4 - 5.1","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"5.1","BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":46034,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"ReferenceFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":-1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":20000000,"FallbackMaxStreamingBitrate":30000000,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":0,"TranscodingContainer":null,"AnalyzeDurationMs":3000,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null,"HasSegments":false}

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 3000000 -probesize 1G -fflags +igndts -f mpegts -init_hw_device vaapi=va:,vendor_id=0x8086,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i "http://192.168.87.128:8096/LiveTv/LiveStreamFiles/6b55cc26b2994eb89bbc88f3a9cb6c6b/stream.ts" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 h264_qsv -low_power 1 -preset veryslow -b:v 9616000 -maxrate 9616000 -bufsize 19232000 -profile:v:0 high -level 51 -g:v:0 180 -keyint_min:v:0 180 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=w=1280:h=720:format=nv12:extra_hw_frames=24,hwmap=derive_device=qsv,format=qsv" -flags -global_header -codec:a:0 libfdk_aac -ab 256000 -af "pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3,volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_base_url "hls/c493f0b15ae761d299d72d9393923bc1/" -hls_segment_filename "/var/lib/jellyfin/transcodes/c493f0b15ae761d299d72d9393923bc1%d.ts" -hls_playlist_type event -hls_list_size 0 -y "/var/lib/jellyfin/transcodes/c493f0b15ae761d299d72d9393923bc1.m3u8"


ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
[hevc @ 0x593f114efe80] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x593f114efe80] Error parsing NAL unit #4.
Input #0, mpegts, from 'http://192.168.87.128:8096/LiveTv/LiveStreamFiles/6b55cc26b2994eb89bbc88f3a9cb6c6b/stream.ts':
  Duration: N/A, start: 54616.027778, bitrate: N/A
  Program 3 
  Stream #0:0[0x31]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn
  Stream #0:1[0x32](eng): Audio: ac4 (AC-4 / 0x342D4341), 46034 Hz, 5.1(side), fltp
  Stream #0:2[0x39](eng): Data: bin_data (STPP / 0x50505453)
  Stream #0:3[0x33](spa): Audio: ac4 (AC-4 / 0x342D4341), 46034 Hz, stereo, fltp
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_qsv))
  Stream #0:1 -> #0:1 (ac4 (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[hevc @ 0x593f11507800] Could not find ref with POC -2
[hevc @ 0x593f11507800] Could not find ref with POC 0
[hevc @ 0x593f11507800] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f11507800] hardware accelerator failed to decode picture
[hevc @ 0x593f114a5c40] Could not find ref with POC 0
[hevc @ 0x593f114a5c40] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f114a5c40] hardware accelerator failed to decode picture
[hevc @ 0x593f116af500] Could not find ref with POC 0
[hevc @ 0x593f116af500] Could not find ref with POC 4
[hevc @ 0x593f116af500] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116af500] hardware accelerator failed to decode picture
[hevc @ 0x593f116b31c0] Could not find ref with POC 0
[hevc @ 0x593f116b31c0] Could not find ref with POC 2
[hevc @ 0x593f116b31c0] Could not find ref with POC 4
[hevc @ 0x593f116b31c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116b31c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f1147c4c0] Could not find ref with POC 2
[hevc @ 0x593f1147c4c0] Could not find ref with POC 4
[hevc @ 0x593f1147c4c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f1147c4c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f11507800] Could not find ref with POC 4
[hevc @ 0x593f11507800] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f11507800] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f114a5c40] Could not find ref with POC 4
[hevc @ 0x593f114a5c40] Could not find ref with POC 8
[hevc @ 0x593f114a5c40] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f114a5c40] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116af500] Could not find ref with POC 4
[hevc @ 0x593f116af500] Could not find ref with POC 6
[hevc @ 0x593f116af500] Could not find ref with POC 8
[hevc @ 0x593f116af500] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116af500] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116b31c0] Could not find ref with POC 6
[hevc @ 0x593f116b31c0] Could not find ref with POC 8
[hevc @ 0x593f116b31c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116b31c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f1147c4c0] Could not find ref with POC 8
[hevc @ 0x593f1147c4c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f1147c4c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f11507800] Could not find ref with POC 8
[hevc @ 0x593f11507800] Could not find ref with POC 12
[hevc @ 0x593f11507800] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f11507800] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f114a5c40] Could not find ref with POC 8
[hevc @ 0x593f114a5c40] Could not find ref with POC 10
[hevc @ 0x593f114a5c40] Could not find ref with POC 12
[hevc @ 0x593f114a5c40] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f114a5c40] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116af500] Could not find ref with POC 10
[hevc @ 0x593f116af500] Could not find ref with POC 12
[hevc @ 0x593f116af500] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116af500] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116b31c0] Could not find ref with POC 12
[hevc @ 0x593f116b31c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116b31c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f1147c4c0] Could not find ref with POC 12
[hevc @ 0x593f1147c4c0] Could not find ref with POC 16
[hevc @ 0x593f1147c4c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f1147c4c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f11507800] Could not find ref with POC 12
[hevc @ 0x593f11507800] Could not find ref with POC 14
[hevc @ 0x593f11507800] Could not find ref with POC 16
[hevc @ 0x593f11507800] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f11507800] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f114a5c40] Could not find ref with POC 14
[hevc @ 0x593f114a5c40] Could not find ref with POC 16
[hevc @ 0x593f114a5c40] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f114a5c40] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116af500] Could not find ref with POC 16
[hevc @ 0x593f116af500] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116af500] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116b31c0] Could not find ref with POC 16
[hevc @ 0x593f116b31c0] Could not find ref with POC 20
[hevc @ 0x593f116b31c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116b31c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f1147c4c0] Could not find ref with POC 16
[hevc @ 0x593f1147c4c0] Could not find ref with POC 18
[hevc @ 0x593f1147c4c0] Could not find ref with POC 20
[hevc @ 0x593f1147c4c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f1147c4c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f11507800] Could not find ref with POC 18
[hevc @ 0x593f11507800] Could not find ref with POC 20
[hevc @ 0x593f11507800] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f11507800] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f114a5c40] Could not find ref with POC 20
[hevc @ 0x593f114a5c40] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f114a5c40] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116af500] Could not find ref with POC 20
[hevc @ 0x593f116af500] Could not find ref with POC 24
[hevc @ 0x593f116af500] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116af500] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f116b31c0] Could not find ref with POC 20
[hevc @ 0x593f116b31c0] Could not find ref with POC 22
[hevc @ 0x593f116b31c0] Could not find ref with POC 24
[hevc @ 0x593f116b31c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f116b31c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f1147c4c0] Could not find ref with POC 22
[hevc @ 0x593f1147c4c0] Could not find ref with POC 24
[hevc @ 0x593f1147c4c0] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f1147c4c0] hardware accelerator failed to decode picture
[vist#0:0/hevc @ 0x593f114e7340] [dec:hevc @ 0x593f1148a680] Error submitting packet to decoder: Input/output error
[hevc @ 0x593f11507800] Could not find ref with POC 24
[hevc @ 0x593f11507800] Failed to end picture decode issue: 23 (internal decoding error).
[hevc @ 0x593f11507800] hardware accelerator failed to decode picture

Additional Context
I tried turning off HW acceleration and there was no difference in logs or behavior.

@williamthrilliam williamthrilliam added the bug Something isn't working label Jan 24, 2025
@gnattu
Copy link
Member

gnattu commented Jan 24, 2025

I tried turning off HW acceleration and there was no difference in logs or behavior.

In the tuner setting or globally? The Tuner setting does nothing to the server transcoding pipeline, it is only used to hint the tuner to use its own decoder or not. I think turning off hardware decoder globally could workaround this issue as the software decoder is more robust to streams from livetv where not everything is reliable.

@williamthrilliam
Copy link
Author

I turned off global hardware transcoding to test. It actually doesn't get as far with HW transcoding turned off, it just hangs:

{"Protocol":1,"Id":"native_bb89b94a78919553a440cd7481210990_9bd74ef4e6a5237225e66a53427f8dd2","Path":"http://192.168.87.128:8096/LiveTv/LiveStreamFiles/f642d869382a431994cadda0b3c49207/stream.ts","EncoderPath":null,"EncoderProtocol":null,"Type":0,"Container":"ts","Size":null,"Name":null,"IsRemote":false,"ETag":null,"RunTimeTicks":null,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":false,"IsInfiniteStream":true,"UseMostCompatibleTranscodingProfile":true,"RequiresOpening":true,"OpenToken":null,"RequiresClosing":true,"LiveStreamId":"e2329f4997b378e64ccf8fa396deb76e_af999c25a00715699361240d4c6c7a53_native_bb89b94a78919553a440cd7481210990_9bd74ef4e6a5237225e66a53427f8dd2","BufferMs":0,"RequiresLooping":false,"SupportsProbing":true,"VideoType":null,"IsoType":null,"Video3DFormat":null,"MediaStreams":[{"Codec":"hevc","CodecTag":null,"Language":null,"ColorRange":"tv","ColorSpace":"bt709","ColorTransfer":"bt709","ColorPrimaries":"bt709","DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Rotation":null,"Comment":null,"TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":1,"VideoRangeType":1,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":null,"LocalizedForced":null,"LocalizedExternal":null,"LocalizedHearingImpaired":null,"DisplayTitle":"1080p HEVC SDR","NalLengthSize":null,"IsInterlaced":false,"IsAVC":null,"ChannelLayout":null,"BitRate":20000000,"BitDepth":10,"RefFrames":1,"PacketLength":null,"Channels":null,"SampleRate":null,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":1080,"Width":1920,"AverageFrameRate":59.94006,"RealFrameRate":59.94006,"ReferenceFrameRate":59.94006,"Profile":"Main 10","Type":1,"AspectRatio":"16:9","Index":-1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":"yuv420p10le","Level":123,"IsAnamorphic":false},{"Codec":"ac4","CodecTag":"AC-4","Language":null,"ColorRange":null,"ColorSpace":null,"ColorTransfer":null,"ColorPrimaries":null,"DvVersionMajor":null,"DvVersionMinor":null,"DvProfile":null,"DvLevel":null,"RpuPresentFlag":null,"ElPresentFlag":null,"BlPresentFlag":null,"DvBlSignalCompatibilityId":null,"Rotation":null,"Comment":null,"TimeBase":"1/90000","CodecTimeBase":null,"Title":null,"VideoRange":0,"VideoRangeType":0,"VideoDoViTitle":null,"AudioSpatialFormat":0,"LocalizedUndefined":null,"LocalizedDefault":"Default","LocalizedForced":null,"LocalizedExternal":"External","LocalizedHearingImpaired":null,"DisplayTitle":"AC4 - 5.1","NalLengthSize":null,"IsInterlaced":false,"IsAVC":false,"ChannelLayout":"5.1","BitRate":null,"BitDepth":null,"RefFrames":null,"PacketLength":null,"Channels":6,"SampleRate":46034,"IsDefault":false,"IsForced":false,"IsHearingImpaired":false,"Height":null,"Width":null,"AverageFrameRate":null,"RealFrameRate":null,"ReferenceFrameRate":null,"Profile":null,"Type":0,"AspectRatio":null,"Index":-1,"Score":null,"IsExternal":false,"DeliveryMethod":null,"DeliveryUrl":null,"IsExternalUrl":null,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Path":null,"PixelFormat":null,"Level":0,"IsAnamorphic":null}],"MediaAttachments":[],"Formats":[],"Bitrate":20000000,"FallbackMaxStreamingBitrate":30000000,"Timestamp":null,"RequiredHttpHeaders":{},"TranscodingUrl":null,"TranscodingSubProtocol":0,"TranscodingContainer":null,"AnalyzeDurationMs":3000,"DefaultAudioStreamIndex":null,"DefaultSubtitleStreamIndex":null,"HasSegments":false}

/usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 3000000 -probesize 1G -fflags +igndts -f mpegts  -i "http://192.168.87.128:8096/LiveTv/LiveStreamFiles/f642d869382a431994cadda0b3c49207/stream.ts" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 libx264 -preset veryslow -crf 18 -maxrate 9616000 -bufsize 19232000 -profile:v:0 high -level 51 -x264opts:0 subme=0:me_range=16:rc_lookahead=10:me=hex:open_gop=0 -force_key_frames:0 "expr:gte(t,n_forced*3)" -sc_threshold:v:0 0 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,1280)/2)*2:trunc(ow/a/2)*2,format=yuv420p" -flags -global_header -codec:a:0 libfdk_aac -ab 256000 -af "pan=stereo|c0=0.5*c2+0.707*c0+0.707*c4+0.5*c3|c1=0.5*c2+0.707*c1+0.707*c5+0.5*c3,volume=2" -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_base_url "hls/8877b7c3ab0d214365d6ae08025eb4b8/" -hls_segment_filename "/var/lib/jellyfin/transcodes/8877b7c3ab0d214365d6ae08025eb4b8%d.ts" -hls_playlist_type event -hls_list_size 0 -y "/var/lib/jellyfin/transcodes/8877b7c3ab0d214365d6ae08025eb4b8.m3u8"


ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.3.0-6ubuntu2~24.04)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[hevc @ 0x5d3dcc55b580] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x5d3dcc55b580] Error parsing NAL unit #4.
[hevc @ 0x5d3dcc55b580] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x5d3dcc55b580] Error parsing NAL unit #4.
[hevc @ 0x5d3dcc55b580] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x5d3dcc55b580] Error parsing NAL unit #4.

@gnattu
Copy link
Member

gnattu commented Jan 24, 2025

Do you have something with faster cpu to tests with? Trying hevc decoding with CPU on N6005 is not fun and it might hang even for normal videos.

If it still fails on a fast CPU the I don’t really know what to do if even ffmpeg cannot understand the stream from the tuner.

@jagadam97
Copy link

@gnattu
I am also facing this issue, i have tested with all the below hardware acc. methods and results as metioned.

Image

AMD AMF
NVIDIA NVENCV
VIDEO ACC. API
ROCKChip
APPLE
the above ones are not transcoing the video doesnt expect to work

None Worked fine -> lags a little

INTEL QUICKSYNC -> Not working Now used to work before
Video4Linux -> Works (Not as fast as quick sync but works.) 17FPS for the same video file that used to transcode art 170+ fps in quicksync

System:
Debian Container inside proxmox.
quicksync used to work great before having issues now.

i can revert the packages and test the same if need

@gnattu
Copy link
Member

gnattu commented Jan 25, 2025

@gnattu I am also facing this issue, i have tested with all the below hardware acc. methods and results as metioned.

Image

If you are not using HDHomeRun Flex 4k you are not having “similar” issue.

Also blindly choosing methods won’t help. It looks like you are very unfamiliar with hardware acceleration setup so I suggest you to ask in our forum or the matrix channel for help.

@gnattu gnattu changed the title HEVC Failing to decode HEVC Failing to decode on HDHomeRun Flex 4k Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants