Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joetesta
Roku Guru

XML help?

I've been looking through the documents with no luck so far. What is the correct order of media in the XML?
Should HD go before SD, or will this cause SD-configured rokus to not play at all?
Should higher bitrates go before lower? I think so or the roku will settle for a lower bit stream than it should.
Can anyone please advise?
aspiring
0 Kudos
7 REPLIES 7
RokuJoel
Binge Watcher

Re: XML help?

The order doesn't matter, just make sure the bitrates are reasonably accurate and associated with the correct video stream.

- Joel
0 Kudos
joetesta
Roku Guru

Re: XML help?

In the tests I've been doing, the order seems somewhat crucial. If I list a 5000 kbps file after a 2500 kbps file, it never played in my tests. Whereas if I list the 5000 first, it will play (given sufficient bandwidth). I don't know why but this is what I found, so now I list the higher bitrates first.

If I list the same mp4 file with both 'SD' and 'HD' designations, it seems like often (but not always?! maybe depends on the roku model?) only the first instance will be chosen. SD-configured devices may not be able to play the title if HD is listed first, whereas if SD is listed first, the 'HD' branding logo does not ever appear. The former is a real problem!

Perhaps you'll say there's no reason to ever list the same file as both 'HD' and 'SD' but our goal is to have the 'HD' branding logo display where appropriate (2500 kbps file encoded from HD source). This may lead to a whole nuther discussion about how our content is not true HD and shouldn't be branded as such. What we've found is that a 720 wide mp4 encoded at 2500kbps looks fabulous and incredible on a 4K (as well as every other) TV and we don't see the point in spending more resources to produce, store and distribute a larger file which looks marginally better if any difference is noticeable at all.
aspiring
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: XML help?

"joetesta" wrote:
If I list the same mp4 file with both 'SD' and 'HD' designations, it seems like often (but not always?! maybe depends on the roku model?) only the first instance will be chosen. SD-configured devices may not be able to play the title if HD is listed first, whereas if SD is listed first, the 'HD' branding logo does not ever appear. The former is a real problem!


If you're including multiple streams with the same bitrate value, it's not altogether surprising that one might be ignored. Best practice is to not duplicate renditions like that.

Have you experimented with the BrightScript that's parsing your XML? That's the better place to make these types of tweaks. Add a check to the parsing logic to see if the box is in HD mode and build the content-meta-data structure in the way best suited to that situation.
0 Kudos
joetesta
Roku Guru

Re: XML help?

Thanks Chris, I haven't done that yet but will look into that for setting HD / SD.

Now we have some users reporting problems when we list the higher bitrate first, they are getting terrible buffering.
But as I mentioned, if I list the lower bitrate first my roku never chooses the 5mbps stream.
So I'm at a loss as to the correct way to handle it. Thanks for any suggestions.
aspiring
0 Kudos
destruk
Streaming Star

Re: XML help?

Could you post your current xml (just a sample for 1 item with multiple bitrates) and your parsing subroutine? Maybe it's only taking the first one, or something is misnamed?
0 Kudos
joetesta
Roku Guru

Re: XML help?

Thanks destruk! I haven't looked at this code since I created the channel but now that I look, it seems to assume there will only be 2 media elements; in the interest of brevity, here's the relevant parsing code:

        item.UserRating = 0

'media may be at multiple bitrates, so parse and build arrays
for idx = 0 to 1
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

showCount = showCount + 1
feed.Push(item)

skipitem:

next


So if I'm not mistaken, I just need to change the one on this line to be one less than the maximum number of elements.
for idx = 0 to 1


This really explains it; why the 5mbps stream won't play unless it's listed first, etc. I can't thank you enough for pointing me to this. cheers,
aspiring
0 Kudos
destruk
Streaming Star

Re: XML help?

You're welcome Joe.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.