Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmpv renderer backend #15

Closed
tsl0922 opened this issue Jan 31, 2023 · 7 comments
Closed

libmpv renderer backend #15

tsl0922 opened this issue Jan 31, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@tsl0922
Copy link
Owner

tsl0922 commented Jan 31, 2023

libmpv provides OpenGL renderer API only, but it does not perform best on all platforms:

Upstream feature requests: D3D11, Vulkan

Luckily, we can use translation layer like ANGLE, which may translate OpenGL ES API calls to a faster hardware-supported APIs to improve performance. Also, ANGLE makes ImPlay work on Virtual Machines that doesn't have a OpenGL 3 driver (example: HyperV vm has D3D driver only). The downside is, it may break HDR: mpv-player/mpv#8530

I've implemented OpenGL ES 2.0 support on the latest main branch, and it's now built in actions (tested the windows version).

NOTE: EGL and GLESv2 dynamic libraries is required to run the GLES2 version of ImPlay, but not needed at build time.

@tsl0922 tsl0922 added the enhancement New feature or request label Jan 31, 2023
@tsl0922 tsl0922 pinned this issue Jan 31, 2023
@tsl0922 tsl0922 changed the title libmpv renderer backend issues libmpv renderer backend Jan 31, 2023
@tsl0922
Copy link
Owner Author

tsl0922 commented Feb 1, 2023

The GLES2 version is now built as default on windows in actions.

@tsl0922 tsl0922 self-assigned this Feb 2, 2023
@tsl0922 tsl0922 unpinned this issue Feb 2, 2023
@tsl0922
Copy link
Owner Author

tsl0922 commented Nov 15, 2023

Thanks. I don't want to use a patched mpv, and ANGLE works fine.

@tsl0922 tsl0922 closed this as completed Nov 15, 2023
@dragonflylee
Copy link

But hwaccel didn't work correctly on my Yoga730 (i5-8250u UHD620), and fallback to dxva2-copy,
Test log below

ImPlay.com --terminal=yes --gpu-context=angle "D:\[Sakurato] Spy x Family S2 - 01.mkv"
[libmpv_render/dxva2-egl] Failed to create EGL surface
Cannot load nvcuda.dll
 (+) Video --vid=1 (*) (hevc 1920x1080 23.976fps)
 (+) Audio --aid=1 --alang=jpn (*) 'Audio' (aac 2ch 44100Hz)
 (+) Subs  --sid=1 --slang=chi (*) '[桜都字幕组] Simplified Chinese' (ass)
     Subs  --sid=2 --slang=chi '[桜都字幕组] Traditional Chinese' (ass)
File tags:
 Comment: Auto Video Processor 3.0.04 @Sakurato
Using hardware decoding (dxva2-copy).
AO: [wasapi] 48000Hz stereo 2ch float
VO: [libmpv] 1920x1080 p010
[libmpv_render] after creating texture: OpenGL error INVALID_FRAMEBUFFER_OPERATION.
Option af-remove: item label @aeq not found.

@tsl0922
Copy link
Owner Author

tsl0922 commented Nov 15, 2023

You don't need to specify gpu-context, it should select d3d11va-copy automatically.

@tsl0922
Copy link
Owner Author

tsl0922 commented Nov 15, 2023

Currently, both the video and gui are rendering with OpenGL. To add another backend for mpv, we need to add it for imgui too. It means a lot of work to me, so I'm also considering to use the window embeding feature of mpv (--wid).

@teohhanhui
Copy link

They don't have a way to make --wid work with Wayland yet...

mpv-player/mpv#10810 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants