Roku Developer Program

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

HLS playback issue

We are trying to playback AES-128 encrypted HLS playlist, attaching the Playlist below
CODE: SELECT ALL
#EXTM3U
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=164000,CODECS="mp4a.40.2,avc1.66.30",RESOLUTION=320x136
0001/renditions.m3u8
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=496000,CODECS="mp4a.40.2,avc1.66.30",RESOLUTION=400x170
0003/renditions.m3u8
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=696000,CODECS="mp4a.40.2,avc1.66.30",RESOLUTION=480x204
0004/renditions.m3u8
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=1328000,CODECS="mp4a.40.2,avc1.4d001f",RESOLUTION=640x272
0006/renditions.m3u8
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=1928000,CODECS="mp4a.40.2,avc1.4d001f",RESOLUTION=800x340
0007/renditions.m3u8
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=3128000,CODECS="mp4a.40.2,avc1.4d001f",RESOLUTION=1024x434
0009/renditions.m3u8
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=4128000,CODECS="mp4a.40.2,avc1.64001f",RESOLUTION=1280x544
0010/renditions.m3u8
#EXT-X-STREAM-INFSmiley TongueROGRAM-ID=1,BANDWIDTH=5128000,CODECS="mp4a.40.2,avc1.640028",RESOLUTION=1920x816
0011/renditions.m3u8


We are not able to playback the above playlist, but if we are playing the master file for each resolutions directly giving the path for that file, that playback works but passing the above playlist is not working can you please help or point why this is happening..?

Appreciate any help/input as this is critical for us to get it working as adaptive streams.

Error which Roku throws up is : Media Format not detected, before throwing this message it tries to download segments but fails and eventually throws the Error message.

Thanks,
Abhi
0 Kudos
6 Replies
RokuRobB
Level 7

Re: HLS playback issue

Can you send the URL of the top level manifest?
0 Kudos
psatish
Level 7

Re: HLS playback issue

Hi,

I am colleague of Abhi. Here is the top level url which you requested.

http://hls.spuul.com/debug/unprotected/ ... aster.m3u8


Satish
0 Kudos
Roku Employee
Roku Employee

Re: HLS playback issue

I put your URL into the SimpleVideoPlayer example in the sdk, and it played. Make sure you are setting the StreamFormat to "hls".



' ********************************************************************
' ** Sample PlayVideo App
' ** Copyright (c) 2009 Roku Inc. All Rights Reserved.
' ********************************************************************


Function main(args As Dynamic)
print "Displaying video: "
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")
video.setMessagePort(p)

'bitrates = [0] ' 0 = no dots, adaptive bitrate
'bitrates = [348] ' <500 Kbps = 1 dot
'bitrates = [664] ' <800 Kbps = 2 dots
'bitrates = [996] ' <1.1Mbps = 3 dots
'bitrates = [2048] ' >=1.1Mbps = 4 dots
bitrates = [0]


'HLS test stream
urls=["http://hls.spuul.com/debug/unprotected/mickeyvirus-opt-vbr/master.m3u8"]
'urls = ["http://185.73.239.20:8000/live/egnlwiaLky/4fYLAeGFGY/322.m3u8"]
qualities = ["HD"]
streamformat = "hls"
title = "Test Stream"
srt=""




videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = bitrates
videoclip.StreamUrls = urls
print "URL: ";urls
videoclip.StreamQualities = qualities
videoclip.StreamFormat = StreamFormat
videoclip.Title = title
print "srt = ";srt
if srt <> invalid and srt <> "" then
videoclip.SubtitleUrl = srt
end if

video.SetContent(videoclip)
video.show()

lastSavedPos = 0
statusInterval = 10 'position must change by more than this number of seconds before saving

while true
msg = wait(0, video.GetMessagePort())
if type(msg) = "roVideoScreenEvent"
if msg.isScreenClosed() then 'ScreenClosed event
print "Closing video screen"
exit while
else if msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
if nowpos > 10000

end if
if nowpos > 0
if abs(nowpos - lastSavedPos) > statusInterval
lastSavedPos = nowpos
end if
end if
else if msg.isRequestFailed()
print "play failed: "; msg.GetMessage()
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
end if
end while
End Function

0 Kudos
psatish
Level 7

Re: HLS playback issue

Hi,

Unfortunately we are still unable to playback the video. The app just freezes after showing part of the progress bar. We are using a Roku 3 with software version 6.2
We are able to play most other streams both encrypted and non encrypted, not sure what is unique about this one. Also we have ruled out any network related issues since the same is playing back on other devices. Is there anything else you suspect

Thanks
Satish


Following is the log.
//////////////////////////////
Displaying video:

URL: http://hls.spuul.com/debug/unprotected/ ... aster.m3u8



srt =

Unknown event: 20 msg: Stream started.

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started











Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

Unknown event: 37 msg: Segment download started

Unknown event: 31 msg: Download segment info

Unknown event: 31 msg: Download segment info

//////////////////////////////
0 Kudos
renojim
Level 8

Re: HLS playback issue

"psatish" wrote:
Hi,

Unfortunately we are still unable to playback the video. The app just freezes after showing part of the progress bar. We are using a Roku 3 with software version 6.2

With version 7.0 of the firmware it crashes the box hard, so be happy it just freezes. Smiley Very Happy

I can play back each rendition separately, but it appears to crash when it switches streams. I'm no expert on encryption in HLS, but I noticed that each rendition uses the same key, but a different IV. I wonder if that could be causing the problem. :?:

By the way, you might want to add System Logging to your code to see what's going on:
log = CreateObject("roSystemLog")
log.SetMessagePort(port)
log.EnableType("http.connect")
log.EnableType("http.error")


I haven't looked at the example code, so you may need to add something to the event loop to print the roSystemLogEvent events.

-JT
0 Kudos
psatish
Level 7

Re: HLS playback issue

The output from the Syslog is the following


-- SYSLOG -----------------------------------------
Log type: http.error
HTTP error, no more information available
---------------------------------------------------

Also getting an event

Unknown event: 11 msg: Unspecified or invalid track path/url.
play failed:

Satish
0 Kudos