You are not logged in.
I have a new HDR monitor and want to try playing some HDR video content. I downloaded a sample HDR video from youtube and after switching to a different TTY I used this:
mpv video.webm --no-config --gpu-context=drm --vo=gpu-next
From ffprobe I get: color_transfer=smpte2084 which indicates HDR as far as I know. pix_fmt is yuv420p10le
The video plays fine but it's quite apparent that it isn't playing in HDR. The image is still very dim and the monitor does not change brightness. I can set --target-peak=1000, but that also makes no difference.
My display is capable of HDR and I have been able to use HDR before with Valve's gamescope (which makes it quite clear when it's working).
Is there anything else I need to do or is mpv not capable of playing HDR content? Online information is a little sparse but from what I have found it should be able to do it when using drm.
Thanks.
Last edited by themusicalduck (2023-11-19 18:40:12)
Offline
Don't have any idea, but more info might be of use.
What GPU are you using? That is the the interface to the monitor?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
GPU is an AMD 5700XT with amdgpu and I'm using DisplayPort.
Last edited by themusicalduck (2023-11-20 18:51:11)
Offline
Gamescope is the only thing I know of that does HDR on Linux. To the best of my knowledge no video player actually supports it, certainly not mpv. The only thing you can do is tone-map the video, and it does allow some settings to tweak that.
It's a topic I'm greatly interested in myself
Last edited by topcat01 (2023-11-20 22:50:28)
Offline
Ah it's a shame! I was only finding random comments suggesting maybe HDR could work, but it seems like the work for it hasn't actually been merged.
I wonder if gamescope can somehow be made to playback HDR video, but I guess with no player properly supporting it to run in gamescope then probably not.
Offline
I realised (with extreme sadness) that the only way to play HDR movies on a computer is to either use Windows (where apparently mpv works, and also many HTPC enthusiasts use MPC + MadVR) or macOS. I currently use a mac along with Optimus Player for my computer based HDR content, because I happen to have an M1 Mini to play with.
Offline
I've been using MacOS too in a virtual machine for video.
Gamescope in a TTY for games and MacOS in a VM for video. Gotta jump through those hoops to use HDR, haha. At least progress is being made towards general support eventually.
I was a little surprised to read mpv HDR works in Windows already and not Linux.
Offline
I was a little surprised to read mpv HDR works in Windows already and not Linux.
I have not tested this myself but have read reports of it working on Windows online. macOS OTOH has absolutely seamless support for HDR, and I suspect it's going to take a long time for Wayland/X to get there unfortunately. Oh well.
Last edited by topcat01 (2023-11-21 01:58:52)
Offline
Did you tried ffplay from terminal (ffmpeg) or VLC?
Offline
All of that will be tonemapping, a lot of underlying stuff is not yet there for HDR support, mpv is the closest to having it available.
You need a patched kernel for the amdgpu integration in a gamescope context in the first place: https://wiki.archlinux.org/title/HDR_monitor_support
Last edited by V1del (2023-11-22 10:13:45)
Offline
I have a new HDR monitor and want to try playing some HDR video content. I downloaded a sample HDR video from youtube and after switching to a different TTY I used this:
mpv video.webm --no-config --gpu-context=drm --vo=gpu-next
neither x11 nor wayland can do HDR at this point in time, although the DRM stack does, your only options for HDR passthrough on linux are with gamescope or VK_KHR_display with AMDVLK driver. I'd recommend the former with mpv. The following should work
gamescope --hdr-enabled -- mpv --vo=gpu-next --target-colorspace-hint --fs [video_file]
(note that the --fs flag is needed because mpv will be "windowed" then upscaled by gamescope). This should allow you to get HDR passthrough on linux given your kernel is new enough.
To the best of my knowledge no video player actually supports it, certainly not mpv
This is incorrect, mpv has supported HDR passthrough for almost 2 years now on Windows. X11 or Wayland need to implement their bits to have proper HDR passthrough on linux.
Offline
gamescope --hdr-enabled -- mpv --vo=gpu-next --target-colorspace-hint --fs [video_file]
No luck sadly with that command.
I tried a few combinations, but I could only hear the video, there was no video playback.
DXVK_HDR=1; STEAM_GAMESCOPE_HDR_SUPPORTED=1; ENABLE_GAMESCOPE_WSI=1; gamescope --hdr-enabled --hdr-itm-enable -e -W 3440 -H 1440 --disable-color-management -- mpv --vo=gpu-next --target-colorspace-hint --fs hdr.webm
Since I needed those env variables set for gamescope plus the extra gamescope flags to get steam working in HDR, I tried adding those in as well.
As another experiment I tried adding mpv as a non-steam game to the steam client, and launched it while it was running in gamescope HDR mode. I put
mpv --vo=gpu-next --target-colorspace-hint --fs /home/theo/hdr.webm
in the launch options on steam.
Again I could hear the sound from the video, but there was no video output, just an endless spinning steam logo.
Edit: as a note just in case, I am using linux-zen which is patched for HDR support (HDR definitely works in Steam and Cyberpunk).
Forgot to mention too that I'm seeing these messages on the TTY:
wlserver: [backend/headless/backend.c:68] Creating headless backend
wlserver: [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
wlserver: [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
Not sure why it's starting as headless or if that's relevant to video not showing..
Last edited by themusicalduck (2023-11-22 20:42:56)
Offline