[RPi4] Can't get Hardware HEVC Decoding

  • I have attempted all the things to get HEVC hardware decoding. Edited boot flags for 'dtoverlay=rpivid-v4l2' and 'dtoverlay=vc4-kms-v3d-pi4', but no luck with ffmpeg.

    Anyone have HEVC hardware decoding working? And help?

    Code
    ffmpeg -hwaccel drm -v debug -i file.mp4 -f null -
    Code
    Successfully opened the file.
    Device creation failed: -12.
    No device available for decoder: device type drm needed for codec hevc.
    Stream mapping:
     Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
     Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
    Device setup failed for decoder on input stream #0:0 : Cannot allocate memory
    [AVIOContext @ 0x14907bb0] Statistics: 1278699 bytes read, 4 seeks

    Reference:

    HEVC hardware decoder support for raspberry pi 4 · Jellyfin Feature Requests
    I am not sure if it is technically feasible. But now that Jellyfin has switch to V4L2 for hardware decoding/encoding starting from 10.8.0, is it possi
    features.jellyfin.org
  • Go to Best Answer
  • Followed those examples and similar output - looks like that 'drm' device now found?

    Code
    Device creation failed: -12.
    No device available for decoder: device type drm needed for codec hevc.
    Stream mapping:
     Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_v4l2m2m))
     Stream #0:1 -> #0:1 (copy)
    Device setup failed for decoder on input stream #0:0 : Cannot allocate memory

    Also could this be part of the problem?

    Code
    libreelec:~/ # dtoverlay rpivid-v4l2
    DTOVERLAY[error]: overlay 'rpivid-v4l2' is deprecated: no longer necessary
    * Failed to load 'rpivid-v4l2'
  • ffmpeg from the ffmpeg-tools-addon is built from plain upstream source without any RPi patches, so you won't get hardware acceleration on RPi with it.

    Getting rid of the separate ffmpeg build and shipping a ffmpeg binary in the image (which will then have all patches, like in kodi) is on my TODO list but I didn't find the time to dig into this yet.

    so long,

    Hias

  • Thanks HiassofT - One suggestion I think would powerful addition to LibreELEC, if HEVC hardware decoding support for RPI4b could be added into Jellyfin server addon.

    Kodi+Jellycon+Jellyfin+HEVC would be quite the homerun for the RPI4b platform.