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: 
jedashford
Channel Surfer

HLS on Firmware 3.1

I've created a channel with HLS streaming working perfect on a roku 3, streaming stick, and roku 2. I ordered an old 2100x to try the channel on firmware 3.1. I've got everything working except the actual streaming. It downloads the first file listed in the playlist, but then continues to download the playlist over and over... You'll see from the roVideoScreen debug statements that its pulling down the correct playlist, and the first bumper file, but looks like it may be choking at the #EXT-X-DISCONTINUITY tag, as it doesnt seem to get any further, it just tries to download the original playlist again. I'm out of options and at the point where we'll just remove the option for older devices unless I can find a solution. Any thoughts?

The files are filtered by IP ranges, so let me try to better show the issue with debug statements:

File fed into the roVideoScreen (playlist.tv-or-mobile.15278-2.m3u8):

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=4080000,RESOLUTION=1920x1080
https://s3.amazonaws.com/livestream.vid ... 1424745328

HD Stream playlist: (https://s3.amazonaws.com/livestream.vid ... 1424745328)

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:NO
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:409
#EXTINF:4.09,
https://s3.amazonaws.com/livestream.vid ... k_2040k.ts

#EXT-X-DISCONTINUITY
#EXT-X-KEY:METHOD=AES-128,URI="https://d1msoxza8sji89.cloudfront.net/15170/encryption-2040.key?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMW1zb3h6YThzamk4OS5jbG91ZGZyb250Lm5ldC8xNTE3MC9lbmNyeXB0aW9uLTIwNDAua2V5IiwiQ29uZGl0aW9uIjp7IklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiIxNzIuOC4xNzQuMjUwLzMyIn0sIkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNDI0NzY2NzczfX19XX0_&Signature=He9HoPMq9ySKNuA5FdAzvTO6oojBWoCiTDQC6m~etD-0S0BUzDtyJ0EeNJ0ubJ98WIrtRvBYIZ-J34X7vGovpQz-ruMRPNPwDHm0JZ-NuKOWp2kNNsdqc~NpadJha38n9ivZ4s3yhOErQDJPDniC1pBgMIwarok3jF27g2cjWu9qu~0R1Vt2d2HfDh2KZ1C5Ox6H~eDT9xbm6Ehi-RVpeyA51o8-QKXBsEgVoCIGeuk8vDlhXdanHow~GFa7ZCNlgy9ytmL-I22SRlNnd-tRP50sZbwXSj-VKj8nYWmzSgSCxwo1nTc1CBNz7EGdZshf5AXut2aM9gcE~kqskPFlQw__&Key-Pair-Id=APKAJMUHX4YSHTV2E7LQ"
#EXTINF:8.6359,
htps://s3.amazonaws.com/encrypted-strea ... 40-0000.ts
#EXTINF:8.6359,
...




Here is the roVideoScreen events:

Button pressed: 0 0
Button pressed: 1 0
Displaying video:
---- AA ----
streamformat: HLS
streamurls: (list of 1)...
List(0)= https://s3.amazonaws.com/livestream.vid ... 278-2.m3u8
streamqualities: (list of 1)...
List(0)= HD
streambitrates: (list of 1)...
List(0)= 0
title: Apple BipBop Test Stream
------------
GetType: 21
typeName: roSystemLogEvent
GetInfo: Status: ok
LogType: http.connect
TargetIp: 54.231.8.248
HttpCode: 200
Datetime: <Component: roDateTime>
OrigUrl: https://s3.amazonaws.com/livestream.vid ... 278-2.m3u8
Method: GET

GetMessage:
GetType: 20
typeName: roVideoScreenEvent
GetInfo: StreamBitrate: 0
MeasuredBitrate: 9765
Url: https://s3.amazonaws.com/livestream.vid ... 278-2.m3u8
IsUnderrun: false

GetMessage: Stream started.
Unknown event: 20 msg: Stream started.
GetType: 21
typeName: roSystemLogEvent
GetInfo: Status: ok
LogType: http.connect
TargetIp: 54.231.8.248
HttpCode: 200
Datetime: <Component: roDateTime>
OrigUrl: https://s3.amazonaws.com/livestream.vid ... 1424989027
Method: GET

GetMessage:
GetType: 21
typeName: roSystemLogEvent
GetInfo: Status: ok
LogType: http.connect
TargetIp: 54.231.8.248
HttpCode: 200
Datetime: <Component: roDateTime>
OrigUrl: https://s3.amazonaws.com/livestream.vid ... ck_640k.ts
Method: GET

GetMessage:
GetType: 21
typeName: roSystemLogEvent
GetInfo: Status: ok
LogType: http.connect
TargetIp: 54.231.8.248
HttpCode: 200
Datetime: <Component: roDateTime>
OrigUrl: https://s3.amazonaws.com/livestream.vid ... 1424989027
Method: GET
0 Kudos
4 REPLIES 4
jasonbio
Visitor

Re: HLS on Firmware 3.1

As far as I know, Roku doesn't support encrypted m3u8 (#EXT-X-KEY:METHOD=AES-128)
Use query string authentication instead and just have the token change hourly - keep the verification server side, not Roku side.
0 Kudos
TheEndless
Channel Surfer

Re: HLS on Firmware 3.1

"jasonbio" wrote:
As far as I know, Roku doesn't support encrypted m3u8 (#EXT-X-KEY:METHOD=AES-128)
Use query string authentication instead and just have the token change hourly - keep the verification server side, not Roku side.

Roku definitely does support AES-128 encryption, so it's unlikely that's the issue here.

I wonder if it's the TARGETDURATION and segment duration values. The header indicates a TARGETDURATION of 409, which is crazy high, as that value should be in seconds. Your individual segments are using floats as their durations, which I've never seen in an HLS before. It may be legal, I've just never run across it before. Any chance you're able to adjust those values to see if it makes a difference?
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
belltown
Roku Guru

Re: HLS on Firmware 3.1

The floats should be okay. I use FFMPEG's stream segment output muxer, which generates floats for the #EXTINF values with no issues for the Roku. The #EXT-X-TARGETDURATION:409 looks very suspicious though, like it's off by a factor of 100. All my #EXTINF durations are within a second of the #EXT-X-TARGETDURATION value.
0 Kudos
jedashford
Channel Surfer

Re: HLS on Firmware 3.1

We'll look into the #EXINF value. Your help is much appreciated.
0 Kudos