Skip to content
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

Not able to pick the "source" streams from Twitch #4972

Closed
realnc opened this issue Feb 17, 2015 · 3 comments
Closed

Not able to pick the "source" streams from Twitch #4972

realnc opened this issue Feb 17, 2015 · 3 comments

Comments

@realnc
Copy link

@realnc realnc commented Feb 17, 2015

youtube-dl is not able to pick the best possible stream from Twitch on its own. On their on-site Flash player, Twitch marks that stream as "Source". Though I doubt they use that name in the actual stream data anywhere.

For example, here's the output from the -F option:

$ youtube-dl -F http://www.twitch.tv/badnewsbaron
[twitch:stream] badnewsbaron: Downloading stream JSON
[twitch:stream] badnewsbaron: Downloading channel access token
[twitch:stream] badnewsbaron: Downloading m3u8 information
[info] Available formats for 13191279808:
format code extension resolution  note 
m3u8-meta   mp4       multiple    Quality selection URL 
m3u8-164    mp4       unknown      164k 
m3u8-596    mp4       unknown      596k 
m3u8-928    mp4       unknown      928k 
m3u8-1609   mp4       1280x720    1609k 
m3u8-1760   mp4       unknown     1760k  (best)

In this case, the "best" as marked by ytdl is actually a lower quality transcoded version (limited to 30FPS), while the actually highest quality stream (the "source" one, which is non-transcoded and can be 60FPS) can only be selected manually with:

$ youtube-dl -f 'best[height=720]' -g http://www.twitch.tv/badnewsbaron

It might be worth inspecting livestreamer to see how it selects the "source" stream by default.

@phihag
Copy link
Contributor

@phihag phihag commented Feb 17, 2015

-f 'best[height=720]' should be identical to -f m3u8-1609 in this case. Are you saying that that's not the case and youtube-dl somehow sneaks in the original format? No offense, but that sounds a lot like a conspiracy theory.

@jaimeMF jaimeMF closed this in 4cd95bc Feb 17, 2015
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Feb 17, 2015

The problem is that the hls manifest says that the source version has a lower bitrate than the m3u8-1760 format, and since we give higher priority to the tbr field it's placed second.

@realnc
Copy link
Author

@realnc realnc commented Feb 17, 2015

Yeah, I noticed that the bitrates reported by Twitch for their lower quality transcoded streams are static (they're always the same) and very often are lower than the actual, non-transcoded source stream (what the person who streams is uploading). In reality, the source stream has a higher bitrate than the transcoded ones (which is the whole point of providing the transcodes; so that people can choose them if they have a slow connection.)

It seems Twitch just picks "safe" static bitrate values for the transcodes and only reports real values for the source stream.

In any event, many thanks for fixing this issue :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.