Forum Discussion

joetesta's avatar
joetesta
Roku Guru
12 years ago

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?

3 Replies

  • 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.
  • 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.
  • 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,