ionatan
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2012
11:41 AM
HLS auto-switch
Would this work on a Roku Channel? Is working auto-switch with hls? Thanks!
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>0</streamBitrate>
<streamUrl>http://server...../streamSD/playlist.m3u8</streamUrl>
</media>
<media>
<streamQuality>HD</streamQuality>
<streamBitrate>0</streamBitrate>
<streamUrl>http://server...../streamHD/playlist.m3u8</streamUrl>
</media>
20 REPLIES 20

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2012
02:02 PM
Re: HLS auto-switch
You would have to have something to parse it like:
and then feed that into your video playback function. But you should ideally have more data than just the videos, such as title, shortdescriptionLine1 and thumbnail images.
also, you need to check the device mode - if SDTV mode you would override the streamQuality with ["SD"] or playback will fail in SDTV mode.
- Joel
if xml.parse(data)
videos=[]
for each object in xml.media
video={}
video.streamquality=[object.streamquality.gettext()]
video.streambitrate=[object.streambitrate.gettext().toint()]
video.streamurl=[object.streamurl.gettext]
videos.push(video)
end for
end if
video.SwitchingStrategy="full-adaptation"
and then feed that into your video playback function. But you should ideally have more data than just the videos, such as title, shortdescriptionLine1 and thumbnail images.
also, you need to check the device mode - if SDTV mode you would override the streamQuality with ["SD"] or playback will fail in SDTV mode.
- Joel

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2012
03:07 PM
Re: HLS auto-switch
Actually for HLS, you should NOT specify multiple URLs. You should put the URLs for the different streams in the top-level m3u8 as specified by the HLS spec, and pass that one URL to the video player. This allows the player to dynamically switch bitrates.
--Mark
--Mark
ionatan
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2012
02:03 AM
Re: HLS auto-switch
Thanks!
videodev
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2012
02:06 PM
Re: HLS auto-switch
Hello,
I am new to ROKU and using SampleVideoPlayer code to test my HLS streams. Even though, I have 6 different bit rates in my playlist.m3u8 file, ROKU picks the low quality stream and is not switching to high bit rate. I have enough internet bandwidth to use high quality stream.
Below is the section of code, which loads the streams from XML file:
Below is the XML for an item:
And below is the streams in playlist.m3u8 file:
Any suggestions?
Thank you!
I am new to ROKU and using SampleVideoPlayer code to test my HLS streams. Even though, I have 6 different bit rates in my playlist.m3u8 file, ROKU picks the low quality stream and is not switching to high bit rate. I have enough internet bandwidth to use high quality stream.
Below is the section of code, which loads the streams from XML file:
e = curShow.media[0]
if e <> invalid then
item.StreamBitrates.Push(strtoi(validstr(e.streamBitrate.GetText())))
item.StreamQualities.Push(validstr(e.streamQuality.GetText()))
item.StreamUrls.Push(validstr(e.streamUrl.GetText()))
endif
Below is the XML for an item:
<item sdImg="http://xxxzzz.com/images/gh.png" hdImg="http://xxxzzz.com/images/gh.png">
<title>My Test Stream 2</title>
<contentId>10053</contentId>
<contentType>Movies</contentType>
<contentQuality>SD</contentQuality>
<streamFormat>hls</streamFormat>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>0</streamBitrate>
<streamUrl>http://yyyzzz.com/playlist.m3u8</streamUrl>
</media>
<synopsis></synopsis>
<subtitleUrl></subtitleUrl>
<genres></genres>
<runtime>9600</runtime>
<hdBifUrl></hdBifUrl>
</item>
And below is the streams in playlist.m3u8 file:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=200000
http://yyyzzz.com/mp4:n_150k.mp4/playlist.m3u8?wowzasessionid=1937835477
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=400000
http://yyyzzz.com/mp4:n_300k.mp4/playlist.m3u8?wowzasessionid=1937835477
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=600000
http://yyyzzz.com/mp4:n_500k.mp4/playlist.m3u8?wowzasessionid=1937835477
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000000
http://yyyzzz.com/mp4:n_800k.mp4/playlist.m3u8?wowzasessionid=1937835477
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1500000
http://yyyzzz.com/mp4:n_1200k.mp4/playlist.m3u8?wowzasessionid=1937835477
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2300000
http://yyyzzz.com/mp4:n_1800k.mp4/playlist.m3u8?wowzasessionid=1937835477
Any suggestions?
Thank you!

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2012
02:18 PM
Re: HLS auto-switch
Make sure you are setting the SwitchingStrategy value. A bug was introduced a few firmwares ago that would prevent HLS from switching to a higher bitrate if the SwitchingStrategy wasn't set. I don't know if that bug was ever fixed, but it's best to always set that value.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
videodev
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2012
02:52 PM
Re: HLS auto-switch
Thank you for quick reply!
I will add that code and will test again!
I will add that code and will test again!
videodev
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2012
05:39 PM
Re: HLS auto-switch
"TheEndless" wrote:
Make sure you are setting the SwitchingStrategy value. A bug was introduced a few firmwares ago that would prevent HLS from switching to a higher bitrate if the SwitchingStrategy wasn't set. I don't know if that bug was ever fixed, but it's best to always set that value.
Thank you. It worked. I am using SwitchingStrategy as "full-adaptation".
Another question - As I mentioned above, I am using HLS streams from Wowza server, which has 6 variants from 150k to 3600k. I read in the documentation that, the dots/HD symbol is not displayed, if the stream is HLS. Is there any way to display HD if any of the variant is of HD quality?
I am using "0" as StreamBitrates in XML.
Any other suggestions for quick switching/buffering/scrubbling?
Thank you!

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2012
10:30 AM
Re: HLS auto-switch
If you set HDBranded=true the HD logo should show.
- Joel
- Joel
danesor12
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2012
09:21 PM
Re: HLS auto-switch
Hi Joel,
Do you have a simple live streaming zip, an example which I can build on for live streaming studies? Similar to simple video player?
Sometimes, solutions have a way of staring in my face and I am not able to see it.
Appreciate all the help!
Thanks,
Do you have a simple live streaming zip, an example which I can build on for live streaming studies? Similar to simple video player?
Sometimes, solutions have a way of staring in my face and I am not able to see it.
Appreciate all the help!
Thanks,