since we get our videos from XML, how do we pass the StreamBitrates, streamURLS and and StreamContentIDs to roku to create the array for the multiple bitrates?
the one issue i see is that some videos may have 2 bit rates some have 4 . so its not as easy as just adding -500k.mp4 or -2000k.mp4 in the roku code.
we will have to send these to roku from the xml. but how do we do that when we don’t have uniformity on these bit rates etc? cause when looking over the code in the showfeed.brs it dont see how i can do this, as it seems it must be hadrcoded in there the bitrate.
any help would be appreciated
In the XML file defining the content, you’ll define multiple media tags for each bitrate.
could you explain a bit more and maybe show an example?
i am using the video player example, i just wish the videos were more uniform in each types of bitrate etc, but i dont have that coming from the DB some are 500, 2000 or 4000 etc some maybe older nad have different bitrate i dont know
Look at the videoplayer code in the SDK. In the XML file identifying each video, there’s the tag containing etc. etc.. Simply create multiple media tags within the same tag to identify different formats, bitRates, etc.
yes dynamically send the urls that way. is no problem
but the issue is since there is no set amount of urls/bitrates coming from the server. how does Roku handle that? or do we just call them all the same?
like this ?
<streamBitrate>500</streamBitrate>
<streamBitrate>2000</streamBitrate>
<streamBitrate>4000</streamBitrate>
<streamUrl>500</streamUrl>
<streamUrl>2000</streamUrl>
<streamUrl>4000</streamUrl>
and then Roku will understand that? I know how to send them its what gets done with them is my question or is that what this is doing?
'media may be at multiple bitrates, so parse an build arrays
for idx = 0 to 4
e = curShow.media[idx]
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
next idx
Thanks for your help
For example:
I’ve got HD and SD versions of the same video; I specify the bitRate, streamUrl etc for it. Based on the end-users display settings for their box, The app will choose the appropriate settings and the video will play. The xml file for your content and the code that parses it will determine in what format and settings your content gets played.
Pardon if this sounds confusing but I think you need to review the code and understand how it parses the xml content files and determines the appropriate bit rate
thanks for your help, i had it right before in my logic but changed it. i didn’t realize that it was doing all of it already and i didnt have to alter the ROKU code…
BTW what channel(s) do you have?? would like to check them out… you seem new here
I’m haarrrrd at work developing it as you read this. Yes I am new to Roku started a couple days ago.
for anyone that ever gets stuck on this and is searching the forum for a answer… here is what our xml looks like, you can test by adding the followin Bitrate Debug Info on screen: Home 5x, Rew 3x, FF 2x
<item>
<contentId>4407</contentId>
<contentQuality>SD</contentQuality>
<streamFormat>mp4</streamFormat>
<media>
<streamBitrate>500</streamBitrate>
<streamQuality>SD</streamQuality>
<streamUrl>http://yoursite.com/videos/4407.mp4</streamUrl>
</media>
<media>
<streamBitrate>1000</streamBitrate>
<streamQuality>SD</streamQuality>
<streamUrl>http://yoursite.com/videos/4407-hires.mp4</streamUrl>
</media>
<media>
<streamBitrate>2000</streamBitrate>
<streamQuality>HD</streamQuality>
<streamUrl>http://yoursite.com/videos/4407-2000.mp4</streamUrl>
</media>
<media>
<streamBitrate>4000</streamBitrate>
<streamQuality>HD</streamQuality>
<streamUrl>http://yoursite.com/videos/4407-4000.mp4</streamUrl>
</media>
</item>
So good luck to anyone that may have or will be stuck on this, this should help you out… thanks for the folks that helped me understand this as well
This is useful information! Thanks!
Great I hope it helps someone, it had me stuck and its crazy cause once you see it, it is like how did i not get that…
sometimes you just have to see it to understand it, i can read the docs or forums all day but i need to see it to see what its doing sometimes to REALLY understand it…
So I like to add code on all my posts, so it may help someone like it does me.
I’m having difficulty getting the variable bitrates to work correctly from this example. Here’s my XML (I’ve removed the full URL to the content and left just the file names):
<item sdImg="l_195255.jpg"
hdImg="h_195255.jpg">
<title>Big Bunny Variable bitrates</title>
<contentId>10011</contentId>
<contentType>Video</contentType>
<contentQuality>SD</contentQuality>
<streamFormat>mp4</streamFormat>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>600</streamBitrate>
<streamUrl>600kbps_full_movie.mp4</streamUrl>
</media>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>800</streamBitrate>
<streamUrl>800kbps_full_movie.mp4</streamUrl>
</media>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>1200</streamBitrate>
<streamUrl>1200kbps_full_movie.mp4</streamUrl>
</media>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>1600</streamBitrate>
<streamUrl>1600kbps_full_movie.mp4</streamUrl>
</media>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>2000</streamBitrate>
<streamUrl>2Mbps_full_movie.mp4</streamUrl>
</media>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>2500</streamBitrate>
<streamUrl>2500_full_movie.mp4</streamUrl>
</media>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>3000</streamBitrate>
<streamUrl>3Mbps_full_movie.mp4</streamUrl>
</media>
<synopsis>This is a test video. We can put details here once we find them.</synopsis>
<genres>Newly Added</genres>
<runtime>468</runtime>
</item>
When I try it over a T1, the debugging info tells me I have a 8mbps network and that it’s playing the 2.0mbps stream
When I try it over 5mbps fiber connection, it tells me I have 10mbps network and it’s also playing the 2.0mbps stream.
Questions:
- How does roku determine the speed of the network (and why does it seem so wrong)?
- Why does the roku not play the fastest stream that fits in the available bandwidth (3mbps from this XML, esp over the 5mb fiber)?
thank you very much in advance,
joe
I just found this in my ‘showFeed.brs’ and this is why it was only choosing the 5th option when more bandwidth is available:
'media may be at multiple bitrates, so parse an build arrays
for idx = 0 to 4
Changed that ‘4’ to a ‘6’ and now (over the T1) I see “Playing 3mbps stream over your 6.8 mbps network”
And what I thought was T1 must be something else since a speedtest just showed me having 8+mbps download but 1.5mbps up. OK, nevermind! 
I know this thread is old, but I just wanted to chime in here and give my appreciation to you all for not only working through this problem, but posting your code along the way. A lot of people simply leave when they’ve found a solution to their own problem, which isn’t helpful to others – but your willingness to share what you’ve learned has helped me out a lot. Multiple streams within a single XML ‘item’ has been troubling me on and off for a while now – and I’ve finally found the solution thanks to you. Thank you all.
I have a quick question about ROKU automatically “switching” to a different stream.
I’ve created a XML file that works – the ROKU will select the correct file based on the available bandwidth. But it never seems to check the bandwidth again after that point.
For example – I have the ROKU play a video… it sees that I have plenty of bandwidth so it will play the high-quality version. If I “choke” my bandwidth the ROKU will load and play the lower-bandwidth stream… but then it just stays there forever, regardless if my bandwidth returns to it’s normal state. It just keeps playing the low-quality stream no matter how long I wait.
There there something I can do to make the ROKU check bandwidth more often?