-
Notifications
You must be signed in to change notification settings - Fork 28
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
Do not create a new live archive if external ID is already in queue #192
Comments
Dealing with network interruptions or interruptions in the stream in general is not the easiest. The current way it works is if Streamlink (what downloads the video stream) is unable to fetch new playlist segments after a few seconds, it will exit which in turn kills the chat download. Then the queue will post process the video, and render the chat. If the stream were to come back up again in a few minutes, a new queue item is created because the old stream was ended as far as Ganymede in concerned. This is the easiest and I believe best way to handle it. If you have any suggestions or improvements let me know. |
Ah, got it. Do you have any debug logs around the time the stream ended and the two queue items got created? Does this happen every time a stream is abruptly ended? |
Hi again, sorry I was away for a few days. It happened again today and here's my idea of why it's doing it (correct me if I'm wrong):
I'm not sure of it but that's most likely what's happening. I saw it happen in the queue after I was curious to know if it would do it after a stream restarted very quickly. |
That sounds about right, but your second point, "Stream end and is restarted instantly". Streamlink needs to detect the stream is down which takes ~5-10 seconds then the channel gets marked as "not live". This means that in theory the channel should still "marked as live" for those 5-10 seconds until Streamlink exits. Your explanation is probably happening, but I need to find out where / how. Debug logs around the time this happens will help as I need to see exactly what's being logged |
I turned debug to true in the settings, I'll reply here when I have logs of this happening again |
@Zibbp I'm back with debug logs. it happened again yesterday and I've be able to catch a part of the logs when it's doing it:
|
I think I see what's happening. The live channel check is detecting the stream is down before Streamlink ends. The live check then re-adds the new live stream before Streamlink ends. Once streamlink ends, the channel is marked as "not live" once again, which gets picked up again by the live check function. I think the best way to fix this is to get rid of one of the functions that declares the channel as offline. I'm thinking the Streamlink one is probably the best one to get rid of but it will need to be tested. One issue I know that may happen with removing that one if the Stream goes down (Streamlink ends) but Twitch doesn't update in time to mark the stream as offline. If the stream is never marked as offline and the stream comes back up the new stream will not be archived. I can push a commit to the repository that removes the Streamlink "not live" update if you're willing to test it. |
Sure, let me know when it's available. |
Change is available on the |
It's up and running on my cluster now, I'll report back with results. |
@Zibbp I have some results, It made things worse than before. When a stream have a network issue for a few seconds and then return (without restarting the stream) it closes the live download and render what was downloaded while the stream continue to run. I reverted back to the last version until we can find another way, maybe it needs a timeout or something? |
I reverted that change and added a function to check if there is a queue item with the same external ID that is downloading a video. If that is true, then the "live check" will not add the stream again. This has been merged in #206 and is available in the |
I'm back on the main branch, I'll report back once I have some results again. |
I've released this fix in v1.3.0. Any updates on how well it's working? |
Sorry for the late answer. I think it's fixed, at least I didn't get any duplicate or issues since the last commit you did. I'll report here again if I find anything wrong but for now it seems stable. |
Hi,
I have an issue with the queue system. When the stream have some lags and stops for some reason (ex: network issues coming from the streamer), it creates a duplicate for the next stream that downloads and renders the same thing. I noticed that both have the same live external ID but not the same UUID (the first part is different), so I guess it would be good to check if it's already in queue based on that ID and if that's the case, then don't add another archive.
The text was updated successfully, but these errors were encountered: