Page 1 of 2

RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 12:55 pm
by J0hnny5
I've picked up several RPi 4s (2GB models) and I'm trying to play 4K60fps content through them to no avail. I am using Raspbian Buster Full (2019-06-20) and I used apt update & upgrade to get latest. I have tried using several H.265 encoded MP4 video files as well as a few H.264 files. I have been using VLC for playback. No love so far... Usually I can hear the audio but the video is blank. Sometimes the first frame loads but nothing after.

Can anyone point me to a guide or how-to for this? What are the circumstances necessary for 4K60 playback to work?

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 12:58 pm
by rpiMike

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 1:02 pm
by J0hnny5
Thanks, I've used LibreELEC with other SBCs successfully so I'll give it a try.

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 1:16 pm
by J0hnny5
rpiMike wrote:
Tue Jul 23, 2019 12:58 pm
Use LibreELEC

https://libreelec.tv/2019/06/libreelec- ... ha1-rpi4b/
LibreELEC plays the video but the logging overlay says its maxing at ~30FPS. System settings also say the display resolution of my screen (32UD60) is 30hz. I'll have to investigate a bit, standby...

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 1:32 pm
by dickon

Code: Select all

hdmi_enable_4k=1
in /boot/config.txt and reboot.

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 2:16 pm
by 6by9
dickon wrote:
Tue Jul 23, 2019 1:32 pm

Code: Select all

hdmi_enable_4k=1
in /boot/config.txt and reboot.
Renamed in the latest firmwares to "hdmi_enable_4kp60=1" as we were getting confused people with 4k30 and wondering why when they hadn't set that.

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 4:47 pm
by twrpi
6by9 wrote:
Tue Jul 23, 2019 2:16 pm
dickon wrote:
Tue Jul 23, 2019 1:32 pm

Code: Select all

hdmi_enable_4k=1
in /boot/config.txt and reboot.
Renamed in the latest firmwares to "hdmi_enable_4k60=1" as we were getting confused people with 4k30 and wondering why when they hadn't set that.
hdmi_enable_4k60 or hdmi_enable_4kp60?

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 4:55 pm
by 6by9
twrpi wrote:
Tue Jul 23, 2019 4:47 pm
6by9 wrote:
Tue Jul 23, 2019 2:16 pm
dickon wrote:
Tue Jul 23, 2019 1:32 pm

Code: Select all

hdmi_enable_4k=1
in /boot/config.txt and reboot.
Renamed in the latest firmwares to "hdmi_enable_4kp60=1" as we were getting confused people with 4k30 and wondering why when they hadn't set that.
hdmi_enable_4k60 or hdmi_enable_4kp60?
hdmi_enable_4kp60=1
Thanks for correcting me (I've edited my other post).

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 6:28 pm
by J0hnny5
6by9 wrote:
Tue Jul 23, 2019 2:16 pm
hdmi_enable_4kp60=1
Thanks. Switching back to Raspbian Buster with "hdmi_enable_4kp60=1" added into my /boot/config.txt did make my desktop environment less jittery. xrandr looks to confirm my current resolution and frame rate;

Code: Select all

$ xrandr --listactivemonitors
Monitors: 1
0: +*HDMI-1 3840/600x2160/340+0+0	HDMI-1
Unfortunately I'm still not able to play 4K video using VLC. Is there an alternate player or method I should use? I have the same behavior I mentioned before, I can hear audio but the video is blank. 1 of the videos I try the first 1 or 2 frames load (it might be H.264 encoded) but nothing plays after. Lower resolution 720p videos play fine.

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 9:23 pm
by gkreidl
The H264 decoder can only decode resolutions up to 1080p60.
The H265 decoder isn't working yet in any Raspbian application.

Re: RPi 4: 4K60 Video Playback Help

Posted: Tue Jul 23, 2019 9:36 pm
by andrum99
gkreidl wrote:
Tue Jul 23, 2019 9:23 pm
The H265 decoder isn't working yet in any Raspbian application.
Indeed. Although it is working in LibreElec. (That's just a note for folk browsing this thread).

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 12:01 pm
by J0hnny5
andrum99 wrote:
Tue Jul 23, 2019 9:36 pm
gkreidl wrote:
Tue Jul 23, 2019 9:23 pm
The H265 decoder isn't working yet in any Raspbian application.
Indeed. Although it is working in LibreElec. (That's just a note for folk browsing this thread).
Thanks. I have tried LibreELEC too (suggested to me near the start of the thread). In LibreELEC my monitor runs @ 30Hz instead of 60, so in KODI my videos are limited to 30 fps. I couldn't simply force a higher frequency in the UI. The 4K60 demo I have plays but stutters and skips. I remember going through this when I picked up an ODROID C2, I'll just have to figure it out again. My preference would be to just use Raspbian but that will have to wait I guess. :(

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 12:12 pm
by dickon
You need to add the hdmi_enable_4k=1 / hdmi_enable_4kp60=1 to LibreELEC's config.txt (probably mounted as /flash), the same as Raspbian. For some reason, it isn't on by default in the current build.

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 12:44 pm
by J0hnny5
dickon wrote:
Wed Jul 24, 2019 12:12 pm
You need to add the hdmi_enable_4k=1 / hdmi_enable_4kp60=1 to LibreELEC's config.txt (probably mounted as /flash), the same as Raspbian. For some reason, it isn't on by default in the current build.
Thanks. I tried but no dice. I also have tried adding a custom HDMI mode, nothing has worked so far. I have added the following to my config.txt;

Code: Select all

hdmi_enable_4kp60=1
#hdmi_drive=2
#config_hdmi_boost=4
#hdmi_cvt=3840 2160 60 <aspect> <margins> <interlace> <rb>
#hdmi_group=2
#hdmi_mode=87
Everything that is currently commented out has, at one point, been uncommented in some combination.

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 12:47 pm
by J0hnny5
J0hnny5 wrote:
Wed Jul 24, 2019 12:44 pm
#hdmi_cvt=3840 2160 60 <aspect> <margins> <interlace> <rb>
When uncommented the line looks like;

Code: Select all

hdmi_cvt=3840 2160 60
Just in case I get some comments.

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 12:51 pm
by dickon
Have you tried hdmi_enable_4k=1 ? The last version I tried had firmware that needed that option, rather than the p60 variant.

My Pi4 now has both, for when I update the firmware...

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 12:52 pm
by jamesh
dickon wrote:
Wed Jul 24, 2019 12:12 pm
You need to add the hdmi_enable_4k=1 / hdmi_enable_4kp60=1 to LibreELEC's config.txt (probably mounted as /flash), the same as Raspbian. For some reason, it isn't on by default in the current build.
Power. p60 requires a LOAD more power than p30, and hence makes the device hotter. All down to clock frequencies. So don't enable 4kp60 unless you are using it.

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 1:07 pm
by J0hnny5
dickon wrote:
Wed Jul 24, 2019 12:51 pm
Have you tried hdmi_enable_4k=1 ? The last version I tried had firmware that needed that option, rather than the p60 variant.

My Pi4 now has both, for when I update the firmware...
Do I need to explicitly add "hdmi_enable_4k=1"? I already get 3840x2160 resolutions in both Raspbian & LibreELEC/KODI @ 30Hz, I just dont get 60Hz (or anything else nearby it).

Either way I'll try the suggestion though... my last attempt had a config.txt like so;

Code: Select all

hdmi_enable_4k60=1
hdmi_enable_4kp60=1
hdmi_drive=2
config_hdmi_boost=4
#hdmi_cvt=3840 2160 60 <aspect> <margins> <interlace> <rb>
hdmi_cvt=3840 2160 60
hdmi_group=2
hdmi_mode=87
My config is getting convoluted though, I dont really know what (if any) of the above arguments are working, if any are trumping others, etc...

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 1:18 pm
by dickon
Yes, which is why they renamed it. It's confusing.

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 1:21 pm
by 6by9
hdmi_enable_4k60=1 will do nothing (that was my typo).

hdmi_cvt=3840 2160 60
hdmi_group=2
hdmi_mode=87
on a recent kernel will limit you to only 4k60. DRM/KMS parses the EDID and supports dynamic resolution switching to any of the modes that are advertised by the display. Remove all of these unless you have a very good reason not to.

hdmi_drive=2 won't do a great deal as again audio support should be read from the EDID.

config_hdmi_boost=4 isn't supported on Pi4 yet.

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 2:40 pm
by J0hnny5
Here is what tvservice reports in LibreELEC;

Code: Select all

RPi4LibreELEC:~ # tvservice -s
state 0xa [HDMI CUSTOM RGB lim 16:9], 3840x2160 @ 30.00Hz, progressive
RPi4LibreELEC:~ # tvservice -m CEA
Group CEA has 11 modes:
           mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive
           mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive
           mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive
           mode 4: 1280x720 @ 60Hz 16:9, clock:74MHz progressive
           mode 5: 1920x1080 @ 60Hz 16:9, clock:74MHz interlaced
  (native) mode 16: 1920x1080 @ 60Hz 16:9, clock:148MHz progressive
           mode 32: 1920x1080 @ 24Hz 16:9, clock:74MHz progressive
           mode 34: 1920x1080 @ 30Hz 16:9, clock:74MHz progressive
           mode 93: 3840x2160 @ 24Hz 16:9, clock:297MHz progressive
           mode 94: 3840x2160 @ 25Hz 16:9, clock:297MHz progressive
  (prefer) mode 95: 3840x2160 @ 30Hz 16:9, clock:297MHz progressive
Here is what tvservice reports in Raspbian (after modifying /boot/config.txt);

Code: Select all

pi@raspberrypi:~ $ tvservice -s
state 0xa [HDMI CUSTOM RGB lim 16:9], 3840x2160 @ 60.00Hz, progressive
pi@raspberrypi:~ $ tvservice -m CEA
Group CEA has 13 modes:
           mode 1: 640x480 @ 60Hz 4:3, clock:25MHz progressive
           mode 2: 720x480 @ 60Hz 4:3, clock:27MHz progressive
           mode 3: 720x480 @ 60Hz 16:9, clock:27MHz progressive
           mode 4: 1280x720 @ 60Hz 16:9, clock:74MHz progressive
           mode 5: 1920x1080 @ 60Hz 16:9, clock:74MHz interlaced
  (native) mode 16: 1920x1080 @ 60Hz 16:9, clock:148MHz progressive
           mode 32: 1920x1080 @ 24Hz 16:9, clock:74MHz progressive
           mode 34: 1920x1080 @ 30Hz 16:9, clock:74MHz progressive
           mode 93: 3840x2160 @ 24Hz 16:9, clock:297MHz progressive
           mode 94: 3840x2160 @ 25Hz 16:9, clock:297MHz progressive
           mode 95: 3840x2160 @ 30Hz 16:9, clock:297MHz progressive
           mode 96: 3840x2160 @ 50Hz 16:9, clock:594MHz progressive
  (prefer) mode 97: 3840x2160 @ 60Hz 16:9, clock:594MHz progressive
if I copy the clock over maybe I can get it going...

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Jul 24, 2019 2:41 pm
by noggin
To precis - on the Pi4B

4K h.264/AVC video has no hardware acceleration and is unlikely to play with software decoding
4K h.265/HEVC video has hardware decoding - but only currently within LibreElec

4K30 and below modes are enabled by default when connected to a monitor that supports 4K30 and below video.
4K50-60 modes are only enabled when 'hdmi_enable_4kp60=1' (formerly 'hdmi_enable_4k=1') is added to the config.txt in the BOOT partition of the uSD card on the Pi4B.

HOWEVER - the Pi4B currently supports RGB 8-bit output at 4K50-60, but not 4:2:0 YCrCb output. Some UHD TVs - particularly early SDR models - don't support any 4K50-60 modes other than 4:2:0, so won't work at 4K50-60 with a Pi 4B. (This is because early HDMI 2.0 UHD TVs only had HDMI 1.4b hardware, and the only 4K50-60 HDMI 2.0 mode that fits into HDMI 1.4b bandwidth is 4:2:0)

4:2:2 YCrCb output may well be supported in future (it may work now - my TV is running RGB with my Pi4B) - but 4:2:0 (which requires vertical subsampling and filtering) may not be.

Also - HDMI 0 (nearest to the USB Type-C power connector) should be used NOT HDMI 1 (nearest to the Composite video and audio output)

Re: RPi 4: 4K60 Video Playback Help

Posted: Mon Jul 29, 2019 2:21 pm
by J0hnny5
so to recap I'm still not able to do 4K60 playback on a RPi4. In Raspbian I can get 4K60 in the desktop environment, but not video playback. In LibreELEC I'm not able yet force 4K60 but 4K30 playback works.

I'll try again in a few weeks.

Re: RPi 4: 4K60 Video Playback Help

Posted: Wed Dec 11, 2019 8:18 am
by seraser
Install kodi with sudo apt-get install kodi and test, for me fine.

Re: RPi 4: 4K60 Video Playback Help

Posted: Thu Jun 18, 2020 10:37 pm
by DMMG
seraser wrote:
Wed Dec 11, 2019 8:18 am
Install kodi with sudo apt-get install kodi and test, for me fine.
can you point me to a good tutorial for that? i have raspbian and i don`t want reinstall all ...just for sake of osmc or LibreELEC :(