You are not logged in.

#1 2023-11-19 18:39:16

themusicalduck
Member
Registered: 2011-07-04
Posts: 129

Unable to playback HDR with mpv in a TTY.

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

#2 2023-11-20 15:39:44

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,260

Re: Unable to playback HDR with mpv in a TTY.

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

#3 2023-11-20 18:50:43

themusicalduck
Member
Registered: 2011-07-04
Posts: 129

Re: Unable to playback HDR with mpv in a TTY.

GPU is an AMD 5700XT with amdgpu and I'm using DisplayPort.

Last edited by themusicalduck (2023-11-20 18:51:11)

Offline

#4 2023-11-20 22:48:12

topcat01
Member
Registered: 2019-09-17
Posts: 136

Re: Unable to playback HDR with mpv in a TTY.

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 big_smile

Last edited by topcat01 (2023-11-20 22:50:28)

Offline

#5 2023-11-21 00:26:31

themusicalduck
Member
Registered: 2011-07-04
Posts: 129

Re: Unable to playback HDR with mpv in a TTY.

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

#6 2023-11-21 00:57:17

topcat01
Member
Registered: 2019-09-17
Posts: 136

Re: Unable to playback HDR with mpv in a TTY.

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

#7 2023-11-21 01:16:30

themusicalduck
Member
Registered: 2011-07-04
Posts: 129

Re: Unable to playback HDR with mpv in a TTY.

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

#8 2023-11-21 01:53:20

topcat01
Member
Registered: 2019-09-17
Posts: 136

Re: Unable to playback HDR with mpv in a TTY.

themusicalduck wrote:

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

#9 2023-11-21 17:29:23

xerxes_
Member
Registered: 2018-04-29
Posts: 815

Re: Unable to playback HDR with mpv in a TTY.

Did you tried ffplay from terminal (ffmpeg) or VLC?

Offline

#10 2023-11-22 10:10:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,447

Re: Unable to playback HDR with mpv in a TTY.

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

#11 2023-11-22 19:57:04

llyyr
Member
Registered: 2023-11-22
Posts: 1

Re: Unable to playback HDR with mpv in a TTY.

themusicalduck wrote:

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.

topcat01 wrote:

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

#12 2023-11-22 20:36:27

themusicalduck
Member
Registered: 2011-07-04
Posts: 129

Re: Unable to playback HDR with mpv in a TTY.

llyyr wrote:
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

Board footer

Powered by FluxBB