jazzfool / iced_video_player

Video player component for Iced
Apache License 2.0
127 stars 18 forks source link

Add libmpv support #8

Closed ALEZ-DEV closed 4 months ago

ALEZ-DEV commented 4 months ago

Hey there,

First thanks for the great work you made here, It would be cool if we can use libmpv to render the video, it will be more simple to cross plateform app between windows, linux and macos, and MPV have great built-in features that we could use directly in Iced if this would be implemented!

I made some research on my side and someone made a rust abstraction on the libmpv.c library : https://github.com/kohsine/libmpv2-rs I don't really know if this is really feasible, because libmpv render.rs use OpenGL to render the video and Iced change their backend from glow to WGPU some times ago (and if I saw right, WGPU don't really support OpenGL), so tell me what you think about that!

I would be happy to help! even if my knowledge are limited in that area (I want to learn more on graphics related things)

jazzfool commented 4 months ago

Hi, thanks for your interest in this project. The problem with using libmpv is, as you said, the fact that libmpv targets OpenGL, whereas Iced uses WGPU (and for which we have no way to control the backend WGPU selects without changes in Iced). So, I don't think it would be feasible to use libmpv.

Having said that, are there features you feel are missing in this library or platforms that you found don't work? In general, gstreamer supports quite a lot of features and should work across MacOS, Windows, and Linux.

ALEZ-DEV commented 4 months ago

This is a little example, but you could customize your experience by using custom .glsl shaders files For example I have this repo which upscale in realtime the video I watch. I don't know if this would be possible too here ?

ALEZ-DEV commented 4 months ago

I made some research and found naga, which is a tool you can use to translate from a certain shader format to another, so I think I can now close this as the request is no longer valid, I will probably make a PR to add the support to load .wgsl on the fly