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.75k stars 1.05k forks source link

Pausing livestreams makes stream no longer "live" when unpaused #331

Open robbely opened 3 years ago

robbely commented 3 years ago

I am currently using Lively to stream a youtube livestream webcam. If Lively is paused (either manually or with a fullscreen window), or if the PC is suspended/put to sleep for a period, the livestream continues where it left off and so is no longer live. I have disabled the pause on fullscreen, but the issue is still there for PC sleeping.

Is it possible (if it doesnt already exist somewhere) to have a setting to allow a youtube livestream to resume from a live position rather than where it was when paused?

EDIT: The livestream also loses sync if there is a break in internet connection - sometimes making a big jump backwards

rocksdanister commented 3 years ago

@hooke007 any comments? 🙂

hooke007 commented 3 years ago

https://github.com/mpv-player/mpv/issues/7022 The solution is a black box.

rocksdanister commented 3 years ago

Tried adding --untimed arg, regular videos sped up.. but no effect on streams (probably because its pause-resume.) Looks like this is not easy to fix.

robbely commented 3 years ago

Using livelycu, I found using a setwp command for the current wallpaper will "refresh" it and bring it back into sync. A solution might then be to do the equivalent of this following certain triggers (network resumed, video unpaused, or wake from sleep). If it is possible, then having this as a selectable option would be necessary to avoid restarting non-live youtube videos unless the app can distinguish between the two. (EDIT - having a "refresh" option in the systray menu might be a solution, or at would also help for when the stream slowly creeps out of sync).

I tried using setwp to do this with a batch file but unfortuantely it means I need to creat/edit a new batch file whenever I change wallpaper. Is there a setwp command that will reload the current wallpaper without specifying what it is, or alternatively an opposite command to closewp that remembers the last wallpaper?

rocksdanister commented 3 years ago

Using livelycu, I found using a setwp command for the current wallpaper will "refresh" it and bring it back into sync.

Its not refreshing, its just creating a new mpv process instance.

A solution might then be to do the equivalent of this following certain triggers (network resumed, video unpaused, or wake from sleep).

No, restarting a process is not a solution.. so I won't be doing that.

I tried using setwp to do this with a batch file but unfortuantely it means I need to creat/edit a new batch file whenever I change wallpaper. Is there a setwp command that will reload the current wallpaper without specifying what it is, or alternatively an opposite command to closewp that remembers the last wallpaper?

setwp is for setting wallpaper, not to fix issues with the app.. adding commands for reloading for bugfix is not the purpose of command line controls, so I won't be adding that command.

robbely commented 3 years ago

No, restarting a process is not a solution.. so I won't be doing that. ... so I won't be adding that command.

I was hoping you'd at least help with a workaround if hooke007's suggestions aren't going to work, rather than be so dismissive and negative. Anyway I have found my own workaround now.

rocksdanister commented 3 years ago

I don't think I was being negative, I simply stated why I won't be doing that and instead will be looking at a proper fix.

I don't get the dismissive comment, you already have a workaround using setwp.. I won't be adding special workarounds for every issue users have.. not only will it complicate the code base, maintaining and testing that code is a big problem; its just not practical.

Some things take time, I have fixed issues over year old.. this unfortunately looks like one of those cases.

hooke007 commented 3 years ago

Looks like this is not easy to fix.

Have you tried the common solution like: --profile=low-latency

mpv is not designed for watching livestreams, it will always try to buffer more data. So I think reducing the cache time may help (before the upstream would start to change it). Does the libvlc core have any advantage on livestreams? I haven't used it.