Hakkin / twitchpipe

Pipe your favorite Twitch streams to the media player of your choice, or a file to save them for later. Supports low-latency playback.
MIT License
35 stars 5 forks source link

Stream quality #3

Closed KauzDs closed 4 years ago

KauzDs commented 4 years ago

Is there a way to record a live stream (preferably with record.sh) using a video quality different from the source? Currently the script records the highest quality possible but I'd like to choose 720p60 instead of the source(1080p) for example. Is that possible?

Hakkin commented 4 years ago

Yes, I plan on adding this soon. I already have a branch that supports more complex stream selection, I have to work on it a little more though.

Hakkin commented 4 years ago

This is implemented in master now, you can check the available qualities with twitchpipe -G <username>, then select the quality using twitchpipe -g <group>.

The "best" group will automatically select the highest available quality, and is the default (note that this does not necessarily mean source quality, in some rare cases source quality is not available, so the next highest bitrate playlist will be selected).

For record.sh, you can select the group with the -g switch, note that not every stream has the same playlist groups, for example, non-partnered streamers will only have "chunked" (source quality) and "audio_only", no transcoded streams.

The default group for record.sh is chunked, which is source quality. This is guaranteed to exist on all streams (as far as I know), so it's a safe default.

Currently record.sh will keep attempting to record a stream in a loop even if the specified playlist group was not found, this obviously isn't ideal in a case where that group will never exist, but is necessary in some cases, because not all playlist groups are necessarily available right as the stream begins.

I think the best solution for this is to allow fallback groups, so that if a specific playlist group cannot be found, we will fall back to another (and so on). youtube-dl supports this kind of fallback, as well as stream selection based on stream metadata (resolution, bitrate, framerate, etc).

I'm going to close this issue, and open another one for tracking further quality selection improvements, since I don't think the current solution should necessarily be the final one.