rocksdanister / lively

Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
https://rocksdanister.com/lively
GNU General Public License v3.0
14.38k stars 1.03k forks source link

Better video wallpaper synchronization in multiple mpv instances on multiple screens #2255

Closed Msprg closed 1 month ago

Msprg commented 1 month ago

Is your feature request related to a problem? Please describe. When using the same video as a lively wallpaper on multiple screens, the video is usually significantly out of sync, which doesn't look nice at all.

Describe the solution you'd like I have found one possible solution of utilizing multiple IPC sockets to make mpv instances A/V synced.

Describe alternatives you've considered As an alternative, maybe there is some inspiration to be found in the https://syncplay.pl/ project

rocksdanister commented 1 month ago

The current duplicate behavior is startup is synced and if pausing is turned off or Display pause rule set to All screen(s) videos should stay synced.

What are you asking for is cloning I think, making it identical (even webpages) but I haven't figured out how to do that yet.

Msprg commented 1 month ago

I see, the wallpaper however often starts not in sync on my screens whether it's on boot or when switching between video wallpapers. It however might be an issue on my system only.

I have tried

Display pause rule set to All screen(s)

And it seems to me the videos now start much more in sync as well. Due to the observed behavior, I believe there might be something 'stealing focus' for a short period of time when the wallpapers are being launched in mpv on my system, causing ~1sec sync difference between them.

What are you asking for is cloning I think, making it identical (even webpages) but I haven't figured out how to do that yet.

This would be indeed a much more general approach. While I am unfortunately unable to provide concrete suggestions, maybe there's a way to wrap any content (mpv/webpage renderer) into some window frame with duplicated view. Although this is just a pure speculation on my part as I do not have experience dealing with this.

I guess I'll try to solve my particular case by either disabling pausing or always pausing on all screens, as you have suggested. Still, to conserve resources it'd be great to be able to have pause-per-screen rule enabled, while lively would use some mpv controls to make the wallpapers be synced even after being paused for a while. I'm not sure, however, how difficult would this be to implement, so I'll just compromise for now, I think.

Thank you for the lightning-fast response, and all your hard work put into this amazing piece of software~❤️

rocksdanister commented 1 month ago

I see, the wallpaper however often starts not in sync on my screens whether it's on boot or when switching between video wallpapers. It however might be an issue on my system only.

Are you using latest Lively v2.1? there is code that sync video. https://github.com/rocksdanister/lively/blob/3af119dfdb69e89eb4d62de9cab18d0f37ea70b6/src/Lively/Lively/Core/WinDesktopCore.cs#L228-L237

Msprg commented 1 month ago

I'm not sure if I was on 2.0 or 2.1 before, but there was some update just as I checked, and it seems it's now starting synced as well so I guess that works~!