4K Video Playback on Raspberry Pi 4 with LibreELEC (Alpha)

In my short Raspberry Pi 4 review, I tested 4K video output and playback in Raspbian, and sadly neither are working properly, with video output stuck to 1080p60 even after selecting 4K HDMI in the settings and yes, I double checked for “hdmi_enable_4k=1” in config.txt, while H.265 video playback is still clearly using software decode in both VLC and omxplayer.

However, LibreELEC team announced support for Raspberry Pi 4 in LibreELEC 9.2 Alpha1 release based on Kodi 18.3 and Linux 4.19.x. So I downloaded LibreELEC-RPi4.arm-9.1.001.img.gz and flash it to a microSD card with balenaEtcher.

The good news is that I could manually set the resolution to 3840×2160 and confirm it works with my TV, but the refresh is limited to 30 Hz maximum. Other refresh rates currently available include 23.98 Hz, 24 Hz, 25 Hz, and 29.97 Hz. The hardware is capable if 4K 60Hz, so it’s just a question of time before this is fixed. Note LibreELEC for RPi4 is currently at the alpha stage of development.

Click for 4K Resolution Screenshot

Now I went on to play some H.265 4K videos stored in a hard drive connected to the USB 3.0 port of the single board computer:

  • MHD_2013_2160p_ShowReel_R_9000f_24fps_RMN_QP23_10b.mkv (10-bit HEVC) – OK, but some frame dropped as I set refresh rate to 30 Hz (and automatic frame rate switching is not yet supported)
  • BT.2020.20140602.ts (10-bit H.265, Rec.2020 compliant video; 36 Mbps; 59.97 Hz) – OK
  • ifa_WorldCup2014_Uruguay-Colombia_4K-x265.mp4 (4K, H.265, 60 fps) – OK, but could be a bit smoother

It’s a bit hit and miss, but it should improve over time. All were shown to be decoded by hardware with “ff-hevc-mmal (HW)” video decoder.

I went on to play some 4K H.264 and VP9 videos which are NOT supposed to be supported by the hardware:

  • HD.Club-4K-Chimei-inn-60mbps.mp4 (H.264, 30 fps) – Not smooth at all
  • big_buck_bunny_4k_H264_30fps.mp4 – Extremely choppy, A/V sync issues
  • tara-no9-vp9.webm (4K VP9 YouTube video @ 60 fps, Vorbis audio) – Not smooth at all

I was expecting this result, but even worse. What’s strange is that Kodi overlay window implies some sort of hardware decoder is used for both:

  • H.264 – ff-h264-mmal (HW) with only one CPU core used for decoding
  • VP9 – ff-vp9-mmal (HW) with only one CPU core used for decoding

H.264 is not so surprising since VideoCore VI GPU support H.264 up to 1080p60, but there’s no word about VP9 at all.

Raspberry Pi 4 is supposed to support HDR, but “software support has a dependency on the new Linux kernel frameworks merged by Intel developers (with help from Team LibreELEC/Kodi) in Linux 5.2 and a kernel bump will be needed to use them”.

Watch the video below where I try 4K videos in Raspberry Pi 4 SBC.

Share this:

Support CNX Software! Donate via cryptocurrencies or become a Patron on Patreon

26 Replies to “4K Video Playback on Raspberry Pi 4 with LibreELEC (Alpha)”

  1. I’ve just noticed that if pixel format is set to “rpi” videos play smootly, but when set to “yuv420p” video are choppy.

  2. The default firmware config will result in 4K30 max, but if you set “hdmi_enable_4k=1” in config.txt the 4K60 mode will show up. Also “Big Buck Bunny” is 4K H264 which is CPU decoded (H264 hardware decode is supported to 1080p) so it will stutter like crazy. 4K content needs to be HEVC.

    1. I’ve added “hdmi_enable_4k=1” to config.txt as follows:

      and rebooted the board:

      But I’m still unable to select anything above 30 Hz.

      About “Big Buck Bunny” oops… I don’t know why I really thought it was H.265 when I played it.

      1. You might need to stop Kodi, edit guisettings.xml and remove “videoscreen.screenmode” and “videoscreen.whitelist” and restart. I’m definitely looking at 4K modes 🙂

        1. Just to add 4:2:2 10-bit isn’t a valid HDMI 2.0 output. HDMI 2.0 only supports 4:2:2 12-bit at 2160p50-60 (and from memory also 2160p24-30). If you output 10-bit at 4:2:2 it will be padded to 12-bit.

          My Pi 4B is currently outputting RGB 8-bit 2160p50-60 with hdmi_enable_4k=1 and a thread at the Pi Forums confirms that 4:2:0 output is currently not supported (only valid in HDMI for 2160p50-60) – and there are question marks about the vertical chroma subsampling processing this would require.

          SDR 4K TVs that came to market early often only support 4:2:0 8-bit flavours of HDMI 2.0 (as it’s an HDMI 1.4b bandwidth standard and didn’t require HDMI 2.0 18Gbs rates to be supported) Also some UHD TVs only support the higher bitrate HDMI 2.0 flavours on certain HDMI inputs and not all of them.

    2. > H264 hardware decode is supported to 1080p

      This is still the old VideoCore IV IP block handling h.264?

  3. It’s important that it correctly decodes 2160p HEVC HDR 10bit 60Hz in hardware, possibly with hdmi mirroring (setup with TV+VPR). Only if so it’ll a very good media Player for today’s best content, for the living room

    1. 2160p HEVC HDR 10bit 60Hz video decoding should eventually work. HDR will need more time as explained in the post.

      If by mirroring you mean using the two micro HDMI ports @ 4K 60Hz, then it’s not going to happen. The hardware can’t handle it. For dual display setup only 2x 1920×1080 @ 60 Hz is currently supported, and they are working on having 2x 4K @ 30 Hz to work.

      1. The Pi Devs have confirmed that 2 x 2160p60 (i.e. 2 x 4K60) output is technically possible, but in some desktop scenarios you may run out of scalers causing corruption. That’s why they are currently supporting 2 x 2160p30, 2 x 1080p60, 1 x 2160p6 + 1 x 1080p60, 2 x 1440p60 etc. only.

        (After all the Pi 3B supports 2160p25 output with custom modelines 🙂 )

      2. Hi Jean-Luc, no I only mean video mirroring between the 2 HDMI connections, even with one of them at 1080p. I don’t think that all TV+VPR users need 4K for both (example: if you see a ~50 inch TV from 10 foot, you’ll loose the 4K benefit I think), so one of them may be 1080P. I’ve just installed LibreElec beta and it works pretty well (4K files, HDR files are played like a charm) but I didn’t found any settings regarding the two connections, mirroring and so on. But we’ve also have to consider that it’s still an alpha release … the first release for PI4, that at the end of the jokes was announced only a few weesk ago! 🙂

        This wonderful RPI4 give me the chance to take away from my hall an Intel Kaby Lake system I used for mediaplaying (the amlogic STB soffered for HDMI blanks in my setup); Intel still didn’t supports HDMI-CEC (Raspberry does!) and now I can use this Kaby as a PC … good! 😛

        1. Do you mean HDR is already working? Or just that the RPI4 can play HDR video files, but not process the HDR data just yet?

          1. It can process them with hardware decoding; I only have a 1080p setup, so I can’t verify if it really plays them with HDR.

  4. 4K? Well, I do not have such requirements. I immediately suspected that this is a marketing gimmick with this 4k and GPU from Broadcom. I have a 2k monitor but I do not use it for video playback. GPUs from such companies as Vivante, Broadcom, ARM-Mali are simply too weak at SBC and do not go beyond FullHD. Even G52 in Odroid N2 is still not enough. This is not what Nvidia from TX series or Qualcolm adreno or even Imagination product.

    1. Look, it’s not the GPU doing video playback, that’s for 3D acceleration. Most ARM based processors have a dedicated VPU or video processor that handles video decoding, transcoding and encoding. ARM offers a range of solutions, but there are also a range of 3rd party solutions. For ARM’s solutions, have a look here https://developer.arm.com/ip-products/graphics-and-multimedia/mali-video-processors
      There are two problems with these, one is that the hardware manufacturers tend to use older video processors and/or the most basic version they can get away with, so even though the solution from ARM is capable of say 4K120 suck as the Mali-V52 in an MP4 design, the MP1 only does 4K30 decoding. The other problem being lack of drivers, closed or open source available without a license, as without this, the VPU isn’t of much use.

  5. This story is very interesting. However, I have the following question: is it possible to have dual display using one HDMI and the DSI port.
    Indeed, I wish to build a TV box (and more) that can also control and send audio files to my receiver without having to switch on my 55′ TV set to select the album or playlist that I want to listen to.
    Using a Raspberry Pi Touch Display to control the access would be ideal. I would switch the Tv only for videos.
    Thanks for your answer.

    1. I haven’t seen DSI + HDMI demonstrated, but Pimoroni have shown HDMI + DPI (which uses a lot of GPIO) working in Raspbian with a Desktop extended over both displays. They used their Hyperpixel as the DPI screen.

  6. My experiences are same as you, I have tested 4k playback on Raspberry Pi 4, with latest Raspbian Buster. Both built-in omxplayer and VLC are failed to play, only Kodi can play.

    But for some reasons, I have to play video via Python scripts, and Kodi doesn’t provide good connection with Python scripts (please correct me if I am wrong), so I am waiting for upgrade of OMXplayer or VLC player.


  7. I’m considering getting the Pi 4B for 4k h265 playback but… what does it do with 4k HDR (Rec 2020) content on a 4k SDR screen? Does it convert the colorspace or does it show full colours?

Leave a Reply

Your email address will not be published. Required fields are marked *