dim
dim copied to clipboard
Desktop App plan
We want to create a desktop app for Dim so that we can leverage native video players like mpv for broader compatibility with codecs. This would limit the cases where we need to transcode media to only when we need to alter the bitrate of videos.
Requirements
- Have almost the exact same UI as the webui, and the same, or better UX.
- Be able to leverage mpv for video playback, including being able to play HDR content on windows, or do clientside tonemapping.
Implementation
I believe we can implement the desktop app by using tauri. Tauri doesnt yet offer any features allowing for rendering external GPU texture, or rendering tauri itself into a GPU texture. As such we will need to use window embedding to overlay the native video player on top of the webui whenever we need it.
Mpv already supports this across multiple platforms but we will most likely not make use of it because we want to create our own OSD which will look the same as our future web player. For the OSD side, we can use iced, which allows us to render external opengl textures, so using it with mpv is easy.
Window embedding
On windows, it looks like all we have to do is when creating the player window, we specify a parent window-id:https://github.com/mpv-player/mpv/blob/master/video/out/w32_common.c#L1527.
On linux, we can use XEmbed.