Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Yuriy_OM
Level 7

SwitchingStrategy - has anyone seen Roku switch streams?

Hi Everyone,

Has anyone ever seen Roku switch HLS video stream seamlessly ( while playing video ) from higher<-> lower bitrates. So far I have never seen this happen. I did notice Roku switching streams on re-buffer or choosing streams when playback starts, but I have never ever seen a "full-adaptation" seamless switch. If you did, can you post your roku model and content type?

Another question - anyone knows how can I control SwitchingStrategy programmatically? Any way to force Roku to start playing low quality bitrate and then switch to high quality?

Thanks everyone
0 Kudos
11 Replies
Roku Employee
Roku Employee

Re: SwitchingStrategy - has anyone seen Roku switch streams?

By default, the device will start with the lower quality stream and move upward, as long as a obj.SwitchingStrategy="full-adaptation". Best to set the bitrate=[0] unless the highest bitrate is lower than 1500kbps, in which case you can use the lowest bitrate for the bitrate setting.

I see bitrate switching all the time when watching video at home and at the office, it is possible that if you have a high enough bandwidth internet connection you might not experience any bitrate switching.

- Joel
0 Kudos
Yuriy_OM
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

Hi Joel,

Couple of questions for you:

1. When you see bitrate switching, do you see a seamless switch or video->buffering->other quality video?
2. Do you see bitrate switching on video player implemented by SceneGraph Video component or roVideoPlayer? ( I am working with SceneGraph video component)
3. Are you seeing bitrate switching on live or on demand content?

I have tried absolutely everything (in SceneGraph) and I have never seen bitrate switch when playing from m3u8 manifest or when specifying video streams within streams array. Here is the example included with VEVO live stream in multiple bitrates. The player will always start playing the last stream in the array ( 06 in this case) and will never switch. Setting bitrate to "0" does not do anything either. When playing from main manifest (http://vevoplaylist-live.hls.adaptive.l ... leman.m3u8), I have never seen bitrate switching either. This was done from multiple locations on multiple internet connections, while usually the connection is good, I doubt after so many hours of watching I would never see bitrate switch, my take is - it just does not work. I have tried absolutely everything to "force-switch" or force Roku to play lower bitrate, but with no success.

Any suggestions? Can it be that bitrate switching works in roVideoPlayer but does not work in SceneGraph? If so, what are my options as my project is built using SceneGraph and roVideoPlayer can not be used within SceneGraph node on the same screen.



newContent = CreateObject("roSGNode", "ContentNode")
newContent.streams=[{ url : "http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/03/prog_index.m3u8",
bitrate : 1060,
contentid : "03",
quality: false
},
{ url : "http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/05/prog_index.m3u8",
bitrate : 2640,
contentid : "05" ,
quality: true
},
{url : "http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/06/prog_index.m3u8",
bitrate : 4000,
contentid : "06" ,
quality: true
}]
newContent.streamFormat = "hls"
newContent.maxBandwidth = 2640
newContent.SwitchingStrategy = "full-adaptation"
newContent.Live = true
m.video.content = newContent
m.video.ObserveField("errorMsg", "checkErrors")
m.video.ObserveField("bufferingStatus", "buffStat")
m.video.ObserveField("streamingSegment", "showBitrate")
m.video.ObserveField("duration", "checkPosition")
m.video.control = "play"
0 Kudos
TheEndless
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

Why are you specifying multiple HLS streams and multiple bitrates? That's not how HLS works. You should be using a single variant bitrate playlist that references the individual bitrate playlists. Specifying multiple streams the way you are will most likely treat it the same as if you were specifying multiple MP4, which would require re-buffering when switching streams
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)
0 Kudos
Yuriy_OM
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

According to the docs it is not the case, this is a legit way to declare multiple bitrates and stream-switching is supported. Anyways, this is just an example, I have posted a link to the manifest (containing individual streams) as well, you can just remove Streams variable and add "content" variable, but stream switching will not work either.
0 Kudos
Highlighted
TheEndless
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

"Yuriy_OM" wrote:
According to the docs it is not the case, this is a legit way to declare multiple bitrates and stream-switching is supported.

Declaring multiple bitrates like that treats them as individual streams, so it can't do seamless stream switching. That is typically for multiple MP4 streams. For HLS (or any of the other supported adaptive bitrate formats), it should be defined as a single stream, if you want seamless switching.
"Yuriy_OM" wrote:
Anyways, this is just an example, I have posted a link to the manifest (containing individual streams) as well, you can just remove Streams variable and add "content" variable, but stream switching will not work either.

I'm not seeing that link..?

How are you testing the stream switching? Are you throttling your network connection somehow to force it to switch down? It'll only switch if there's some sort of network congestion that warrants it.
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)
0 Kudos
Yuriy_OM
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

Hi, here is the code with a single manifest ( contains 6 streams):


newContent = CreateObject("roSGNode", "ContentNode")
newContent.url= "http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/appleman.m3u8"
newContent.streamFormat = "hls"
newContent.maxBandwidth = 2640
newContent.SwitchingStrategy = "full-adaptation"
newContent.Live = true
m.video.content = newContent
m.video.control = "play"


I am trying to control stream switching using min/max bandwidth, also leaving it on for hours and logging into console. I have never seen roku switch, it always plays the last url in the manifest list. Please try it for yourself
0 Kudos
TheEndless
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

"Yuriy_OM" wrote:
I am trying to control stream switching using min/max bandwidth, also leaving it on for hours and logging into console. I have never seen roku switch, it always plays the last url in the manifest list. Please try it for yourself

As noted in another thread, I don't think Min/MaxBandwidth work in SceneGraph currently, but even if they did, they don't control switching, only the minimum and maximum bitrates to allow switching to. To test the actual switching, you'd need to throttle your network connection somehow, perhaps by downloading something large on another device on the same network(?).

Stream 06 is the highest bitrate stream in that list. I don't think it matters what order the streams are in. It's just happens that it's the last one. Can you re-order them in the playlist to confirm that it's not just using the last stream? I know in firmware 6.x, HLS switching was changed, so that if your network connection supports it, you'd get a single segment of the lowest bitrate stream, with an immediate switch to the highest bitrate stream, so it'd be very difficult to see that switch.
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)
0 Kudos
Yuriy_OM
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

Hi, I have tried all that. I was logging all play chunks to console for hours and hours, reordered streams, turned on large downloads on other devices on the network, but I never seen roku switch. Thus I am asking here if anyone else can test and confirm.
0 Kudos
Yuriy_OM
Level 7

Re: SwitchingStrategy - has anyone seen Roku switch streams?

Bumping this issue.

Can anyone confirm any form of bit-stream switching within SceneGraph Video? I believe it simply does not work, I have never ever seen any bitstream switch.
Please try this stream, it has 4-5 bitrates: http://vevoplaylist-live.hls.adaptive.l ... leman.m3u8
0 Kudos