Felmachersoft / StreamBuffRe

Public issue tracker for StreamBuffRe, see https://streambuffre.com/
5 stars 0 forks source link

Issue with having multiple streams open #2

Closed Zero3K closed 6 years ago

Zero3K commented 6 years ago

When I have 3 or more streams open, I lose connection to them over time and I also get "segment is missing" errors. The bandwidth isn't being maxed out when it happens.

Felmachersoft commented 6 years ago

I did not experience the problem yet. Does it only appear with twitch streams or other livestreams like the ones youtube, mixer and so on as well?

Zero3K commented 6 years ago

It seems to only be happening with Twitch Streams. I have 6 Youtube Streams open and only one closed for some reason that I don't know of.

Felmachersoft commented 6 years ago

Does several twitch streams work flawless if opened und playing in the browser? (Please manually set the quality to max in order to prevent twitch from automatically reducing quality)

Zero3K commented 6 years ago

I can't have multiple streams playing at one time in the browser. The player of a stream on Twitch.tv pauses the stream when I click on a different tab.

Felmachersoft commented 6 years ago

Strange, I just tested it with Firefox and Palemoon (an alternative browser). Both let me watch several streams in different tabs at the same time. Two ideas how to run several streams together:

  1. Try it again without being logged in, might be a setting on your twitch profile.
  2. Try a site like http://multitwitch.tv/, so you can watch several streams in the same tab (will use much CPU power though) to run several streams at once.
Zero3K commented 6 years ago

I just logged out and now they're not pausing automatically. It seems to be handling them better than StreamBuffRe does.

Felmachersoft commented 6 years ago

Even with highest quality for all streams? If so can you share an example list of streams so i can test them on my site and try to reproduce the behavior?

Zero3K commented 6 years ago

Yes. Here's a list of streams:

https://www.twitch.tv/twitchplayspokemon/ https://www.twitch.tv/backgroundguy02/ https://www.twitch.tv/finestko https://www.twitch.tv/scykoh

Felmachersoft commented 6 years ago

Ok, i can reproduce the behavior, will look closer into it.

Felmachersoft commented 6 years ago

Ok, the problem seams to only occur if the streams are actually being played. If the streams are only buffered, no segment got lost for me. Might be something with the internal pipeline, furter investigation is necessary.

Zero3K commented 6 years ago

Maybe looking at the source of Streamlink (which is available at https://github.com/streamlink/streamlink) will help you in fixing it.

Felmachersoft commented 6 years ago

Not really, StreamBuffRe uses a completely different way of receiving, handling and providing streams. This way streams can be used in several ways at once, like watching in several players, saving them to disc, converting them etc. etc. without redownloading them. The bug should not occur due to the independence of the stream source (downloading the stream to the buffer) and the actual provider (here several providers to watch the streams). It will take some time to figure this one out.

Zero3K commented 6 years ago

It seems like the issue is able to be "fixed" by using Proxifier (https://www.proxifier.com/) to have StreamBuffre be proxied through Privoxy (https://www.privoxy.org/).

EDIT: Nope, its still happening even when being proxied.

Zero3K commented 6 years ago

Is there anything that I can do to help get it fixed?

Felmachersoft commented 6 years ago

Not yet. I need more free time to really check everything in depth. I do have some ideas what causes it, but the testing if everything works after changing things is very time consuming.

After a fix is available test results from others are highly appreciated.

Zero3K commented 6 years ago

Well, I can help test it.

Zero3K commented 6 years ago

Any fixes that you can apply that you want me to help test?

Felmachersoft commented 6 years ago

This will be the next big thing I'm looking into. Any fixes to this will be part of the regular updates. I will leave a message here when fixes for this bug are available.

Zero3K commented 6 years ago

Its even happening when only one stream is being viewed.

Felmachersoft commented 6 years ago

I'm aware of that and as described in #9 this is caused by the player (please next time add which player you use). As long as the player doesn't read a new segment, the download of new segments is blocked thus they time out. MPV and VLC are faster than MPC at reading new segments provided by StreamBuffRe (but get slower as more instances of them running, what causes the download timeouts when running several Players).

The actual problem is StreamBuffRe blocks the download of new segments until the old ones are taken by a consumer (a player for example). You can check this by saving livestreams. Writing the streams to disk is so much faster that you can simple download several streams parallel without any timeout ever happening.

Long story short: When the fix is provided this will no longer happen.

Zero3K commented 6 years ago

I hope that it is the actual cause of the issue and there's nothing else that can be causing it.

Felmachersoft commented 6 years ago

Not the fix to the real problem but rather a workaround was introduced with version 0.5.9.1. It doesn't prevent segment downloads from failing, but it should recover better. A test with ten streams (seven of them 360p, two of them 720p 60 fps, running in 3 MPC-HCs and 7 MPV instances) ran for 30 minutes without problems (the log still shows the failed downloads, but not noticeable anymore in any player). Another test with four 720p 60 fps and one 1080p 60 fps stream, two running in MPC-HCs and the rest in MPV instances ran also flawless for 30 minutes.

More feedback is necessary to tell if the workaround is sufficient.

Zero3K commented 6 years ago

I doesn't work for me. I am using MPC-BE and will try MPC-HC soon and will edit this comment with my findings.

EDIT: The issue also occurs with MPC-HC.

Zero3K commented 6 years ago

Any more thoughts regarding this issue?

Felmachersoft commented 6 years ago

I still have some other things to test, but all tests are very time consuming. I will report back if something comes up.

Felmachersoft commented 6 years ago

I'm very confident the problem is fixed now. Please check release 0.5.10.1 and report back if you still encounter errors.

Zero3K commented 6 years ago

Its still not fixed.

Felmachersoft commented 6 years ago

I tested with 8 Streams (2 x 1080p 60 fps, 6 x 720p 60fps) using 2 instances of MPC-HC and 6 instances of MPV. I had a medium bandwidth usage of 3,7 MB over 45 minutes without a single segment download fail. That test result shows the previous bug causing segment downloads failing too soon is fixed now.

Be more precise with your current problems: Does the log still report failed segment downloads due to timeouts? Which player, how many streams and how long did they run?

Zero3K commented 6 years ago
  1. Yes.
  2. I was using MPC-BE with 4 streams. They ran for 30+ minutes before being disconnected.
Felmachersoft commented 6 years ago
  1. Can you provide the log of the timeouts? Especially the time between timeouts is interesting.
  2. MPC-BE is not officially supported, please try again with MPC-HC and report back.
Zero3K commented 6 years ago
  1. The log is attached.
  2. I tried it with MPC-HC and only one stream. It still occurred.

log.txt

Felmachersoft commented 6 years ago

The log shows on the one hand the problem occurs for you even with only one stream playing, on the other hand the segment download errors occur all in a very short time.

Both indicate it is not the bug from before, where over long time the more players where running, the more segments failed download due to invalid timeout checks. It more looks like a bad connection, maybe weak a Wi-Fi signal or not enough bandwidth due to a download.

In order to double check, I played the same stream you did with MPC-HC for about an hour without any failed segments.

Zero3K commented 6 years ago
  1. I am using a wired connection.
  2. It happened even when nothing major was being transmitted.
Felmachersoft commented 6 years ago

To ensure it is not a connection issue and really part of StreamBuffRe please create a .bat file with following content:

@ECHO OFF
echo check pinglog.txt for results

echo _ >> pinglog.txt
echo Started new ping log at %time% >> pinglog.txt
echo _  >> pinglog.txt

:LOOPSTART
for /f "delims=" %%a in ('ping -n 1 www.titch.tv ^| find "Minimum"') do (
     echo %time% %%a >> pinglog.txt
)
echo pinged once
timeout 1
GOTO LOOPSTART

It will check your ping to twitch every second and create a logging file in the same directory it was started in. After an error with a Stream occurred just close the window of this program and post the log of both, StreamBuffRe and the .bat file here.

Zero3K commented 6 years ago

Here are both logs as requested.

log.txt pinglog.txt

Zero3K commented 6 years ago

Any news regarding it?

Felmachersoft commented 6 years ago

First of the pinglog shows you do have a very high average ping. For testing I use a 50mbit connection and the ping to twitch averages at 14 ms even with some streams running.

From 11:09:33 AM on, when the first two disconnects happened, the pinglog shows a peak which indicates high bandwidth usage thus a connection problem most likely caused by another download (windows update in the background for example).

Prior to the problems starting at 11:12:47 AM there is a peak in the pinglog as well. Strange is that the the high ping goes back to the average value, but the segment downloads fail anyway. Although I can't explain that, the times show that StreamBuffRe correctly waits few seconds before the segment downloads time out.

In conclusion it looks like a connection problem. Just in case, did you check if the same problems occur with mpv and what type of connection (16 mbit, 20mbit or so) do you have?

Zero3K commented 6 years ago
  1. Yes, it happened with MPV.
  2. I have a 25ish mbit connection provided by AT&T's Uverse service.

I am attaching the log of StreamBuffRe.

log.txt

Felmachersoft commented 6 years ago

Happening independant of the player indicates even more that it is the connection. Have your tried using lower quality settings like 480p or 360p ?

Zero3K commented 6 years ago
  1. Yes, 480p works without any issues.
  2. Its weird that it still happens with 720p+ when only one stream is being played.
  3. There should still be a way to fix it so 720p+ streams can play without any issues.
Felmachersoft commented 6 years ago

Everything speaks for a poor connection on your end and the actually bug in StreamBuffRe is already fixed as well hence closing the issue.

Zero3K commented 6 years ago

Its weird that it still happens randomly. What OS are you testing it on?

Felmachersoft commented 6 years ago

It's tested with windows 7 and windows 10. If you experience the problems under windows 10 try to limit the bandwidth used by windows update (https://fossbytes.com/limit-download-speed-windows-update/).

Zero3K commented 6 years ago
  1. Windows Update isn't downloading any updates.
  2. How can it be a bandwidth issue when it happens even when viewing only one stream?
Felmachersoft commented 6 years ago
  1. It is often downloading stuff in the background.
  2. 720p not working when 480p works is an indication it caused by missing bandwidth.

Although not changing things in the tests (since it already works there) I added a possible fix in the next release. It might help in your situation.

Zero3K commented 6 years ago

Thanks for adding another fix. I also hope that it works.

Zero3K commented 6 years ago

Any news regarding the new version?

Felmachersoft commented 6 years ago

I found a machine having the issues you described with multiple (and sometimes single) streams. The previously mentioned fix (the one included in the next release) indeed helped with it. The next release will be soon so you can test it yourself.

Felmachersoft commented 6 years ago

Please check 0.5.11.0. The applied fix should prevent problems with segment downloads occurring with some (still not sure why it happens only on some and not all windows 10 installations) windows 10 configurations.

Zero3K commented 6 years ago

I wonder if its because of the servers I am connecting to. Can you please give me links that are used when you use it to play Twitch streams? Here are the ones that I am currently viewing:

https://video-weaver.atl01.hls.ttvnw.net/v1/playlist/CsMCIhf1-NVaY4opAGyz_2f1Y_mK1wCwj1YgB0IoRjgj8lebuktxWRQ8vlngbnsLzXydVJxiLTd0YJe9BJzp-nDpXuxgjLx0xY-2OCC7Ma_eWqI1mpkb3rF-E6AJs5E53kIzqyC1FX1NLRupgfhpVayOUREfG9t71FRXuqt8rNnO8xbrQn2YoIN-CNux8w2ASRyFmx3Lgj6SgEmK0R7YBH1bfE25xnINSpjJeegCSuuzObo5AKH88c3qUfCPqhSsZ36HRMQ_Hk5cMh-QoHUDoc0sZTDoCs13HHW_3QHgAYpXLg9qJsNf5PDI3b1JEE0UOQTBCmnRStrj17dWAxFFGRsU4kA5sYHJa4opQ0eb44YJvW2W8dJ0ZZf4FtKGnkYbcPQ020nCsJ5xzXmvXaAwKgYUY58KhsN4u-vSM3zzw48xFRZ3RtMSEH4yL9hNHOHU8eBDHgGmm-UaDDK1mfb2j2cII5inAg.m3u8 https://video-weaver.atl01.hls.ttvnw.net/v1/playlist/Cv0C8sYutcTdk1t6x3ujaDnSXfnQKeoVt2xWMbM8Oolga_LMmkQJEFv9H1SvBxkxvSl52ggq8n5rxlK0lHqXlAmtOwhgyHvRgIXiGhY-cST5CZy6hLs96yXjWV-awxFGf60Sj7GyfUeNNQAalJE64Dbd-urkwS2VwhUbHmf77s8FbaoRRAzNTHPj8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