Roku Developer Program

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

Multiple stream qualities, what am I doing wrong?

Hi,
I'm trying to setup my content with two stream qualities, SD and HD.

My content meta data looks like this (set from result of parsed JSON from HTTP GET):

title, description, posters, contenttype, length etc
---
StreamBitrates: [900, 4000]
StreamQualities: ["SD", "HD"]
StreamFormat: "mp4"
StreamUrls: [sd_url, hd_url ]
StreamContentIDs: ["tvn-1-1-900.mp4", "tvn-1-1-4000.mp4"]
IsHD: true
HDBranded: true

I get the following error when I select one from the poster screen to load in the video screen:
An unexpected problem (but not server timeout or HTTP error) has been detected.

However, when I change this code up to use just a single HD URL (with all the arrays having just one element) it works fine and plays the video, same with just a single SD URL.

I can confirm that both sd_url and hd_url work just fine. They are signed/protected CloudFront urls to MP4s hosted in S3.

I'm also assuming that StreamContentIDs are just unique IDs and don't have to match the file names or URLs in any particular convention, is that correct?

What am I doing wrong?

Thanks
0 Kudos
5 Replies
Highlighted
Level 11

Re: Multiple stream qualities, what am I doing wrong?

without more information I'd guess you aren't defining your arrays properly. For example you listed "StreamFormat" only once even though you should have two (albeit identical) values.
Do you have debug running on your box? If not turn it on and if yes, add more debug output so you can clearly see what's being requested and why it's failing.
aspiring
0 Kudos
Highlighted
Level 9

Re: Multiple stream qualities, what am I doing wrong?

"joetesta" wrote:
without more information I'd guess you aren't defining your arrays properly. For example you listed "StreamFormat" only once even though you should have two (albeit identical) values.
Do you have debug running on your box? If not turn it on and if yes, add more debug output so you can clearly see what's being requested and why it's failing.

StreamFormat should only be defined once. There is no array for it, as you can't mix formats.

OP, I'd recommend using the newer single Streams array instead of the multiple aligned arrays like you are now. That way you can be sure you're defining everything appropriately for each stream. (You are correct about the ContentIDs, btw.)
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
Highlighted
Level 7

Re: Multiple stream qualities, what am I doing wrong?

I figured out the problem.

Apparently Roku does not like URLs that use SSL (HTTPS). The signed URLs generated through the Ruby AWS API use HTTPS by default. Changing this over to plain HTTP fixed the playback problem.

After getting it working I converted it over to use the new Streams format that I was unaware of at the time and it still works.

Thanks,
Seth
0 Kudos
Highlighted
Level 9

Re: Multiple stream qualities, what am I doing wrong?

"tvn" wrote:
I figured out the problem.

Apparently Roku does not like URLs that use SSL (HTTPS). The signed URLs generated through the Ruby AWS API use HTTPS by default. Changing this over to plain HTTP fixed the playback problem.

After getting it working I converted it over to use the new Streams format that I was unaware of at the time and it still works.

Thanks,
Seth

You said in your first post that they worked as individual URLs. Were you mistaken, or were you using the non-HTTP URLs in that test?

Either way, HTTPS streams should work fine. You just need to be sure to set the certificates file on the screen component first:
screen.SetCertificatesFile("common:/certs/ca-bundle.crt")
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
Highlighted
Level 7

Re: Multiple stream qualities, what am I doing wrong?

The previous URL was just HTTP (generated by another method). That's how I figured out it was the problem.

I don't need HTTPS for this but it nice to know you can set that on the screen object.

Thanks
0 Kudos