streamlink / streamlink-twitch-gui

A multi platform Twitch.tv browser for Streamlink
https://streamlink.github.io/streamlink-twitch-gui/
MIT License
2.68k stars 202 forks source link

Low preset fails for Twitch streamers who are not partnered #481

Closed mimagind closed 5 years ago

mimagind commented 7 years ago

Checklist

Description

Low quality preset fails for Twitch streamers who are not partnered. As they don't get any quality options the stream has only "source" and "audio_only"

Expected / Actual behavior

Expected behaviour: Video player starts and loads the stream Actual behavior: error: The specified stream(s) 'low, best' could not be found. Available streams: audio_only, xx0p

Reproduction steps

  1. Go to Settings > Streams
  2. Leave all options as default except
  3. Set preferred quality > Low
  4. Open a stream that has single digit number of viewers

Environment details (operating system, etc.)

Windows 10 Streamlink 0.6.0

Comments, logs, screenshots, etc.

Invoking streamlink from the command line yields the correct behaviour streamlink https://www.twitch.tv/someunknownstreamer low,best [cli][info] Found matching plugin twitch for URL https://www.twitch.tv/someunknownstreamer [cli][info] Available streams: audio_only, xx0p (worst, best) [cli][info] Opening stream: xx0p (hls) [cli][info] Starting player: C:\Program Files\VLC\vlc.exe

bastimeyer commented 7 years ago

Since 1.3.0, the stream quality selection method has changed. Whole quality ranges are now being excluded in each preset instead of listing qualities explicitly. You don't see the exclusion in the log output, which make your reproduced CLI parameters invalid. What's actually being done when selecting "low" (in its default configuration) is this:

streamlink --stream-sorting-excludes ">360p30" twitch.tv/CHANNEL low,best

This will look for the "low" quality first and will then use the best available quality which is not higher than "360p30".

See here: https://github.com/streamlink/streamlink-twitch-gui/blob/v1.3.1/src/app/models/stream/qualities/streamlink.js

Or the wiki: https://github.com/streamlink/streamlink-twitch-gui/wiki/Streamlink-configuration#stream-qualities

If a streamer only has one quality available, you need to select the source preset, as it doesn't exclude any qualities. I don't know if there can be anything done to make the non-source presets work when a streamer only has one quality available and the preset excludes all qualities. I guess a parameter could be added to Streamlink itself that ignores the exclusion if only one quality is available, but I'm not sure if this is too specific to the usage of the Twitch GUI and doesn't make sense otherwise.

mimagind commented 7 years ago

Thank you for the explanation. I've fixed the issue by changing Settings > Streams > Quality presets > Low > ">1080p60" in the left column.

I still think this is a bug. The stream launcher should never fail to launch a stream if a stream is available, no matter the quality preset. The quality is a preference. I doubt anyone would rather have an error message than a stream of a different quality.

bastimeyer commented 7 years ago

I've fixed the issue by changing Settings > Streams > Quality presets > Low > ">1080p60" in the left column.

This breaks other valid quality exclusions for all other streams. You should set "source" as the default quality for the channel you're watching in its channel settings menu. This overwrites the default quality selection, in case it's not set to "source".

I still think this is a bug

Yes, it is, as I've said above. But there's nothing that can be done except adding a new parameter to streamlink or parsing the output and checking for no remaining qualities (which would be quite difficult since the output is similar to other error messages) and trying to relaunch the streamlink process (which would be a bad solution).

h1z1 commented 7 years ago

Unless the option required an explicit toggle to enable, it's quite a drastic change in behavior. You're requesting a quality that isn't available, I'd rather know that then think I'm on source when I'm not and complain to the streamer they're having problems.

mimagind commented 7 years ago

After further usage I found the complete fix involves changing Streams > Quality presets > Low > ">1080p60" in the left column and "worst" in the right column.

But there's nothing that can be done except [...]

The fix would be to allow the option of "Don't exclude stream qualities" for all quality presets instead of only having it as default for Audio Only and Source.

@h1z1 Like I said:

I doubt anyone would rather have an error message than a stream of a different quality.

If you disagree with that then there's nothing else to say.

bastimeyer commented 7 years ago

">1080p60" in the left column and "worst" in the right column

This only fixes the quality selection for your particular situation, where there is only one quality available. The "low" preset also has to work for other streams, where multiple qualities are available and "worst" simply means selecting the abolute minimum quality which is intended for horizontally held phones using the Twitch mobile app (160p). Using the "worst" selector doesn't make sense while removing the exclusion. You're basically working around the preset system.

"Source" doesn't mean high quality, it means best (or the original, non-reencoded quality), and when there's only one quality available, it will select this, no matter which resolution or bitrate is being used. So if there's a streamer with just one quality available, please select the "source" preset or go to the channel's settings menu and set the default quality to "source" over there, so that you can still use "low" as your global preset.

Yes, I am aware that the quality exclusion can possibly lead to having an empty selection and that it would be better to use a different quality instead of resulting in an error, but as I've already said, there is no better alternative yet and this issue can only be solved by the two methods I've talked about. We need to define quality range exclusions in Streamlink to be able to have these presets, so that people can set their preferred stream quality either globally or per channel.

Let me open a feature request on the streamlink repo for an exclusion fallback parameter, so that this can be fixed.

mimagind commented 7 years ago

The "low" preset also has to work for other streams

That's why I used "worst". Because using the default ("low, best") would always result in opening the source quality stream because there doesn't seem to be any "low" available any more. "Worst" is not actually my exact preference but it's the closest from the options that are guaranteed to be available (audio_only, worst, best).

So if there's a streamer with just one quality available, please select the "source" preset or go to the channel's settings menu and set the default quality to "source" over there, so that you can still use "low" as your global preset.

That's not a realistic option. I want any stream, even one I've never opened before and may never open again to start (close to or) at the lowest quality available. If that is source, so be it.

We need to define quality range exclusions in Streamlink to be able to have these presets, so that people can set their preferred stream quality either globally or per channel.

I completely understand that. I'm not suggesting the removal or change of any existing functionality. But what's stopping you from interpreting "0" for example in the quality exclusion field for Low, Medium and High the same way you interpret "" in the field for Audio Only and Source?

pquerner commented 6 years ago

This is still an issue, or I am not únderstanding it correctly. I'd like to watch streams on medium, but a streamer is not partnered (ie. only "Source" is available) and the stream wont even start. There needs to be a fallback imho.

Found matching plugin twitch for URL twitch.tv/xxx
Attempting to authenticate using OAuth token
Successfully logged in as xxxx
error: The specified stream(s) 'medium, best' could not be found.
Available streams: audio_only, 720p60
bastimeyer commented 6 years ago

@pquerner yes, this is still not fixed and requires a better quality selection in Streamlink which the Twitch GUI can then make use of. See streamlink/streamlink#1055

Just select the source quality for now, as there are no qualities being filtered out when selecting it. Streamlink will then pick the best available quality (the only available one).

bastimeyer commented 5 years ago

Forgot to post this here... I've added a fallback mechanic to Streamlink a few weeks ago that should fix this issue. This hasn't been added to the Twitch GUI though, because it requires a version bump of Streamlink first. Once a new Streamlink release has been published, I will add the new stream quality selectors to the Twitch GUI's default config and will bump the required Streamlink version. streamlink/streamlink#2127