kompot / nhl-tv-geeky-streams

Best way to download NHL games. NHL.TV, NHL LIVE, or WatchESPN account is required.
MIT License
35 stars 7 forks source link

Stream download speed is slow? #30

Closed chiroptical closed 5 years ago

chiroptical commented 5 years ago

Using this tool earlier with a game from yesterday was perfectly fine, but I am getting really slow download speeds for streaming games. Is this expected?

For example, I just speed tested 100 Mb/s connection but streamlink writes at about 60 KB/s. I tried --hls-segment-threads n where n = {1..4}, but the speed didn't change at all. Any help is greatly appreciated.

chiroptical commented 5 years ago

It's possible I don't fully understand how these streams work, but if I choose a --hls-start-offset close to the current stream length I get decent download speeds. I guess this 60 KB/s is the actual new data from the stream.

Going to play around some more to figure this all out, but cool tool!

chiroptical commented 5 years ago

Ok, so I did some more snooping and for some reason mpv won't open after the streamlink process is started. So, I hacked your code a bit and wrote a wrapper to launch mpv manually. This is so great!

The "hack" was basically sanitizing the filename (contained () characters) and simply writing the command to a file. I then read the file from a bash script, launch streamlink, wait 5 seconds (seems to be necessary to get the .mp4 written), open mpv, and clean up the streamlink process and remove the .mp4 files.

kompot commented 5 years ago

I did some more snooping and for some reason mpv won't open after the streamlink process is started

How is that? Some streamlink option to start media player? I was always just starting downloading and then run mpv manually.

chiroptical commented 5 years ago

Honestly I have no idea. Even if I added --player=mpv it would never open.

I was always just starting downloading and then run mpv manually.

This is what I did too. Just to make sure I understand, this is how your tool was intended to be used. It launches streamlink and you manually open the stream?

kompot commented 5 years ago

Even if I added --player=mpv it would never open. you have mpv in your path, right? didn't test it, just curious

anyway, if you find a way to launch media player right away - feel free to add it in config comments and make a PR; might be a good option for someone

It launches streamlink and you manually open the stream?

Yep, exactly.

chiroptical commented 5 years ago

That is helpful. I will see if I can figure it out.