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
Support for HLS Streams #43
Comments
Can you provide us with some links to the relevant parts in their new API and some info on when the change is going to happen? What kind of video are they serving right now via HLS? Greetings, Chris |
HSL is already live and used for mobile streams and for the consoles. Details are here: http://blog.twitch.tv/2013/12/service-update-major-video-system-update-and-prague-is-online/ RiotGames LCS Streams seem to use HLS as well, at least I am receiving data via port 80 and its "buffering" from time to time which seems to be a feature from HLS. |
Every stream I've watched in the last few days was delivered via HLS, no matter if they had 1 or 100k viewers (I'm in the EU, may differ for NA).
Sure! They already switched most if not all streams to be served via HLS, at least for EU servers. Their new API URL is http://usher.twitch.tv/select/$CHANNEL.json?nauthsig=&nauth=&allow_source=true It will either send you a HLS playlist (m3u8) containing links to playlists for the different qualities or in rare cases the data for rtmp you currently get. Note that currently it does not require a token and signature, it may do in the future, you can get both from here: http://api.twitch.tv/api/channels/$CHANNEL/access_token (the token has to be urlencoded) Non-partnered channels or channels that just don't have enough viewers will only have one URL in the response, channels that are partnered/have enough viewers and are transcoded will contain URL's for "Source", "High", "Medium", "Low" and "Mobile" quality levels. Example for responses: Transcoded channel:
Example for non-transcoded channel:
I don't know how XBMC works internally, but you probably just need to pass the url of the desired quality to it's video player. |
Thanks for the round up, derrod!
Transcoding will be available for non-partnered Streams as well in future, depending on the current load of the servers. Not sure if this will make any difference for the implementation tho. |
It shouldn't, the playlists should be the same as for partnered/transcoded channels now. |
Thanks for your detailed investigation :) I will try to implement HLS-support during the holidays, as my days are pretty packed with other things until then. |
I sent a request to " http://usher.twitch.tv/select/$CHANNEL.json?nauthsig=&nauth=&allow_source=true" URL. I've got many streams (Source, High, Medium, Low, Mobile) and i past the Source (Or High) URL to a .strm file. I played this .strm file in XBMC and it works! |
Thanks Dthibault just tried that and it worked for me too. Not the most efficient way to watch twitch but will do for now. |
After a long pause, I'm planing to get back working on the twitch plugin. Since I recently finished my bachelor's degree, there is a little more time to work on the plugin. |
That's good to hear as the twitch app is currently unusable because of the switch to HLS. RTMP is completely disabled as it seems. |
With HLS, the processor work less! It's a good news ;) |
@GrimD @Dthibault which part are you folks copying into the strm file? Just tried it and it's not working for me 👎 |
When you go to http://usher.twitch.tv/select/$CHANNEL.json?nauthsig=&nauth=&allow_source=true it should down load a file. I just changed the extension to .strm, copied it up to my raspberry pi and then opened the file in XBMC. |
I write a tutorial: For example, i want to view this stream on XBMC (Raspberry Pi, etc..) : http://fr.twitch.tv/yellowstarr
EDIT: The GrimD method is functionnal, but by default, XBMC load the Source quality :/ |
Interesting, even without changing the channel name and using your method I'm unable to start a stream. My log;
|
Mine didn't load the source by default. When opening the file it then took me to a menu with several options to chose from. They are all the same name as the file doesn't contain what ever XBMC is expecting to name them correctly but they are the different stream qualities listed in the file with source at the top then high etc going down to mobile. Personaly I found this use full as my contention ratio on my ADSL is pants so I keep going back from the stream to the menu to change the quality up and down depending on how well its streaming |
GrimD: Hum, yes, your method is better than mine finally 👍 |
@Dthibault I regenerated the link for my connection :) |
My log for this stream:
I use Raspbmc (Latest Version) on my Raspberry Pi. |
Interesting, I'm on the latest nightly of OpenELEC :( (The stream URL is working because I'm able to play it through VLC) |
Personally I just put
in the .strm file, so you don't need to redo it when the stream is restarted and your URL is not vaild anymore. I use OpenELEC on my Raspberry Pi btw. Edit: ooops hit the wrong button, accidently closed the issue... Edit 2: In most cases my raspberry pi seems to select "source", but not always. |
@derrod brilliant, that works! Thanks buddy. |
Hey Guys, I took the liberty of making a temporary fix for the addon until it is properly updated. I hope that's okay CCaspers (feel free to incorporate any part of my fix into your next version or even release it on the git hub). To implement my fix:
Merry Christmas Guys! Dave |
Thanks for your temporary fix! 👍 |
If the temporary fix is something interesting, there's now a pull for it. #47 |
I've created a much improved fix with Quality options working and Auth added in as a future proofing solution. There's now a pull for this. #49 |
MrSprigsters fix is now merged into this repository. As the feedback so far states, it seems to be working for most people. A code clean up will follow |
Hello,
I'm currently using your awesome plugin on my Raspberry Pi to watch streams on my TV without having to use my PC, but sometimes there are issues with lag.
Twitch will be switching to HLS in the future, but it's already available so I would like to have a switch in the settings to switch to HLS when RTMP streams are lagging.
The twitch beta page uses a new API to get stream content, it responds either with a m3u8 playlist containing different quality (source, high, medium, low, mobile) playlists for HLS or the same response you'd get with the old API that your plugin currently uses. This is probably due to balancing but on most streams with higher viewercounts (~1000+) I would constantly get HLS playlists.
There's also a distinct API that always will give you HLS content because it is for the mobile app, this will also work for very small channels.
XBMC supports HLS since Frodo so I think it's reasonable to support HLS for twitch in the future.
~Rodney
The text was updated successfully, but these errors were encountered: