issue with higher bitrate content

Hi,
Our channel has mp4 h.264 content encoded with HandbrakeCLI in two bitrates; 600kbps and 2500kbps. Now we want to experiment with higher bitrates and I encoded one file with a 5000kbps stream and added it to the xml file, but roku only gets the 2500kbps stream even though we have 15mbps download speed, and the content is served from CDN.

I added it to the XML like this,

<media>
<streamQuality>SD</streamQuality>
<streamBitrate>600</streamBitrate>
<streamUrl>09512_600.mp4</streamUrl>
</media>
<media>
<streamQuality>HD</streamQuality>
<streamBitrate>2500</streamBitrate>
<streamUrl>09512_2500.mp4</streamUrl>
</media>
<media>
<streamQuality>HD</streamQuality>
<streamBitrate>5000</streamBitrate>
<streamUrl>09512_5000.mp4</streamUrl>
</media>

Can anyone suggest what might be going wrong? thank you in advance,
Joe

Connection speed is only one of many factors that can affect stream selection. The box maintains an average bandwidth measurement that it uses to choose a stream.

The isStreamStarted event will tell you what the current measured bitrate is. http://sdkdocs.roku.com/display/sdkdoc/ … layerEvent

Thanks RokuChris -
I’m back looking at this and I tried getting the values from ‘isStreamStarted’ but must be doing something wrong; I put this

            elseif msg.isStreamStarted()
                msgInfo = msg.GetInfo()
                ? "GOT Stream Info!!"
                ? "measured: "; msgInfo.MeasuredBitrate
                ? "stream avg: "; msgInfo.MeasuredBitrate
                ? "underrun?: "; msgInfo.IsUnderrun

in what seemed like the right place but I always get

measured:  39267
stream avg:  39267
underrun?: false

which can’t be right, since it plays a 2.5 mbps stream without trouble.

Ultimately I found that by reversing the media order in the XML, roku chooses the highest bitrate. I don’t understand why, but glad to have figured it out.

<media>
<streamQuality>SD</streamQuality>
<streamBitrate>5000</streamBitrate>
<streamUrl>09512_5000.mp4</streamUrl>
</media>
<media>
<streamQuality>HD</streamQuality>
<streamBitrate>2500</streamBitrate>
<streamUrl>09512_2500.mp4</streamUrl>
</media>
<media>
<streamQuality>HD</streamQuality>
<streamBitrate>600</streamBitrate>
<streamUrl>09512_600.mp4</streamUrl>
</media>

In that XML you have SD for the quality for the 5mbps stream. I think it should be HD for that bitrate.
One of your streams needs to be listed as SD so people with their roku device set to SD mode will have something to play.

As for your code you posted in regards to the numbers being the same, it’s because you are using the same variable for both.
elseif msg.isStreamStarted()
msgInfo = msg.GetInfo()
? “GOT Stream Info!!”
? "measured: "; msgInfo.MeasuredBitrate
? "stream avg: "; msgInfo.MeasuredBitrate
? "underrun?: "; msgInfo.IsUnderrun

Your stream avg line is using .measuredbitrate instead of .streambitrate to print a result.

Thanks destruk,
although repeating the var was in error, I was curious about the actual number - why is the measured bandwdith only 40k while we are watching a 2.5mbps stream?
best regards,
Joe

It’s in kilobits

39267 / 8 = 4908.375 kilobytes
4908.375 / 1024 =~ 4.7 megabytes/second

oh! I was looking at the description for StreamBitrate; “average bitrate of stream, in bits per second”
http://sdkdocs.roku.com/display/sdkdoc/ … layerEvent
Now I see it, “MeasuredBitrate measured network bandwidth in kibibits per second”
Thanks for clearing that up :slightly_smiling_face:

Well, I had another thread on this issue, but it hasn’t been answered yet. I think their descriptions or sdk is wrong for what each one is really doing. :disappointed_face:

What specifically do you think is wrong? I didn’t understand your other thread; I thought you were just objecting to the use of the word kibibits. The value is the measured bits per second divided by 1024.

–Mark

Mark I think he means this thread: viewtopic.php?f=34&t=64576&p=414382#p414382
I think that kibibits was another one?

Yes this thread - if you try to get a value for streambitrate in the event of isUnderrun it reports 0. Is it always supposed to report as 0 in that instance, or is it supposed to report the last known bitrate of the stream, or the bitrate specified in the xml or content list for the stream bitrate? Where does it get the value for the isunderrun .streambitrate?

viewtopic.php?f=34&t=64576&p=414382#p414382