Open iainsaxonhome opened 2 years ago
Also found this is related to https://github.com/jellyfin/jellyfin-media-player/issues/139.
I forgot to mention in my previous comment that JMP is using Mesa (org.freedesktop.Platform.GL.default
) branch 20.08 version 21.1.8 whereas MPV is using branch 21.08 version 21.3.8.
Like issue #139 I think the key issue is the embedded MPV can't use the vaapi
decoder and is falling back to vaapi-copy
.
(Sorry, didn't mean to close ticket, accidentally tapped on mobile while typing).
Has there been any progress into resolving this issue? I am on the latest Jellyfin media player deb package on Pop OS, and I am experiencing the same issue with 4K SDR content as well.
I am running on Gen 9 Intel integrated graphics, and with hardware decoding in JMP set to decode.enabled, I get dropped frames and frame rate drops when trying to play 4K content. Looking at intel_gpu_top, I am getting low encoder utilization and very high CPU utilization. Checking the JMP logs shows in fact that JMP is using vaapi-copy as the decoding device rather than vaapi, as it could not create the device, resulting in very poor playback.
If I copy the stream URL, and open it up in MPV, the video plays perfectly! There are no dropped frames or frame rate issues at all, looking at intel_gpu_top shows high encoder utilization, and there is practically no CPU utilization at all!
Is there something we could add to our JMP config files or MPV config files to force JMP to use vaapi?
Looking at the logs also shows something else that may be interesting, libmpv-render fails to load hedec-driver 'vaapi-egl', stating
2022-07-02 12:12:48 [ DEBUG ] PlayerComponent.cpp @ 588 - libmpv_render/vaapi-egl: VAAPI hwdec only works with OpenGL or Vulkan backends.
Could this have anything to do with why vaapi is not working correctly under JMP?
jellyfinmediaplayer.log
I have the same issue: JMP is unable to use vaapi
and falls back to vaapi-copy
, but vaapi
works fine with plain MPV if I copy the stream URL there.
Could this MPV issue be related: https://github.com/mpv-player/mpv/issues/10424
I must say, I didn't really understand how to use the solution they had in that issue, but maybe it could be applied here too somehow?
Hmm.. Running JMP with:
QT_XCB_GL_INTEGRATION="xcb_egl" jellyfinmediaplayer
Seems to enable vaapi:
2022-10-27 14:45:16 [ DEBUG ] PlayerComponent.cpp @ 588 - libmpv_render: Loading hwdec driver 'vaapi'
2022-10-27 14:45:16 [ DEBUG ] PlayerComponent.cpp @ 588 - libmpv_render/vaapi: using EGL dmabuf interop
2022-10-27 14:45:16 [ DEBUG ] PlayerComponent.cpp @ 588 - libmpv_render/vaapi: Trying to open a x11 VA display...
2022-10-27 14:45:16 [ DEBUG ] PlayerComponent.cpp @ 588 - libmpv_render/vaapi/vaapi: Initialized VAAPI: version 1.15
2022-10-27 14:45:16 [ DEBUG ] PlayerComponent.cpp @ 588 - libmpv_render/vaapi: Going to probe surface formats (may log bogus errors)...
2022-10-27 14:45:16 [ DEBUG ] PlayerComponent.cpp @ 588 - libmpv_render/vaapi: Done probing surface formats.
EDIT: Yep, works perfectly for me now. I wonder if this should/could be added to JMP itself somewhere in the code?
I can confirm that running jellyfinmediaplayer using QT_XCB_GL_INTEGRATION="xcb_egl" jellyfinmediaplayer
does indeed enable vaapi decode for me and playback of 4k video content for me using Jellyfin Media Player is far improved and on par now with MPV.
QT_XCB_GL_INTEGRATION="xcb_egl" jellyfinmediaplayer
I can confirm too
How do is set QT_XCB_GL_INTEGRATION="xcb_egl" on jellyfinmediaplayer flatpak?
Describe the bug Playback of 4K HDR videos is choppy running around 10-15 FPS and
intel_gpu_top
will show activity on theVideoEnhance/0
engine whereas the latest version of MPV via Flatpak with correct decoding support runs smoothly and uses noVideoEnhance/0
resources.Playing back a 4K high-bitrate file using only SDR works correctly and plays back smoothly so it appears to be specifically HDR that causes the problem. 4K is simply because that's when HDR was introduced.
I've attached the log for the working version of MPV and Jellyfin Media Player where it lags.
The detail that I think makes the difference is the version of OpenGL that each detects and it appears that JMP lacks Vulkan support and is referring to an older version of OpenGL that also lacks the ES features.
MPV (smooth):
JMP (choppy):
This is related to https://github.com/jellyfin/jellyfin-media-player/issues/182.
It also seems related to https://github.com/jellyfin/jellyfin-media-player/issues/179 however I am not sure what the successful fix was for that issue.
Is it possible to update the JMP Flatpak manifest to use similar flags and dependencies to a more recent version of MPV? MPV: https://github.com/flathub/io.mpv.Mpv/blob/master/io.mpv.Mpv.yml#L431 JMP: https://github.com/flathub/com.github.iwalton3.jellyfin-media-player/blob/master/com.github.iwalton3.jellyfin-media-player.json#L53
I hope this is enough information and I've followed the right debugging path :) .
To Reproduce Steps to reproduce the behavior:
hardwareDecoding
todecode.enable
support (notdecode.copy
)vaapi-copy
and notvaapi
requiring more CPU power than normalExpected behavior The embedded version of MPV should use the non-copy version of the VAAPI decoder.
Desktop:
Additional context I suspect the detail that is missing is Vulkan support that is present in the latest version of MPV via Flatpak.
Logs jellyfinmediaplayer.log mpv.log