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: 

HLS: Error while determining media format

I've got an HLS stream that Roku won't play: http://content.uplynk.com/ext/21885d134 ... ys=efgabcd. I've edited the displayVideo() function from the simplevideoplayer example from the SDK to log a bit more info as below:

Function displayVideo(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]

'Swap the commented values below to play different video clips...
urls = ["http://content.uplynk.com/ext/21885d134fa441488df8e1d7acee8c66/DEPB1325.m3u8?rays=efgabcd"]
title = "Disney Channel Bumper"

'urls = ["http://content.uplynk.com/c6e41f94818e46af8b755113ad7a4c07.m3u8"]
'title = "Finding Dory Ad"

qualities = ["HD"]
StreamFormat = "hls"
srt = "file://pkg:/source/empty.srt"

if type(args) = "roAssociativeArray"
if type(args.url) = "roString" and args.url <> "" then
urls[0] = args.url
end if
if type(args.StreamFormat) = "roString" and args.StreamFormat <> "" then
StreamFormat = args.StreamFormat
end if
if type(args.title) = "roString" and args.title <> "" then
title = args.title
else
title = ""
end if
if type(args.srt) = "roString" and args.srt <> "" then
srt = args.StreamFormat
else
srt = ""
end if
end if

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

video.SetContent(videoclip)
video.SetCertificatesFile("common:/certs/ca-bundle.crt")
video.SetCertificatesDepth(3)
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
print "msg.isRequestFailed: "; msg.GetIndex(); msg.GetMessage(); msg.GetType()
inf = msg.GetInfo()
for each key in inf
print key ": " inf[key]
end for
print

else if msg.isStreamSegmentInfo()
print "Segment Info: "; msg.GetMessage()
print "Segment Info: "; msg.GetInfo().SegUrl

else if msg.isStatusMessage()
print "Status: "; msg.GetMessage()

else if msg.isDownloadSegmentInfo()
print
print "DownloadSegmentInfo: "
print msg.GetInfo()
print

else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
end if
end while
End Function


The Finding Dory ad that's commented out above plays just fine

When connected to the telnet port, this following is displayed when trying to play:

------ Running dev 'Simple Video Player' main ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/empty.srt
Unknown event: 20 msg: Stream started.
Unknown event: 37 msg: Segment download started

DownloadSegmentInfo:
Bitrate: 415961
Sequence: 0
Status: 0
SegBitrate: 415
DownloadDuration: 273
SegUrl: http://stg-ec-ore-u.uplynk.com/slices/b ... 0000000.ts
SegSize: 153984
BufferSize: 0
BufferLevel: 0
SegType: 0
IPAddress:


Status: Error while determining media format.

msg.isRequestFailed: -5 9
MediaFormat:

Closing video screen


Can anyone think of a reason why the Roku can't determine the media format for one asset but not the other?
0 Kudos