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: 
SkipFire
Visitor

How to use H.264 TS Streams?

I have picked up one of the new SiliconDust tuners that spits out an H.264 TS stream and I have verified that the device works but I am having problems with trying to view it on my Roku. When I try to playback on my Roku it throws a message of type isRequestFailed and GetIndex returns -5, but I haven't been able to find anyplace that specifies what the problem is, aside from the fact that it is probably something I did. I have copy/pasted the URL and I know the URL does work. I have tried using 13%2E1 just incase the . was throwing it off but that did not result in any change. I would appreciate any pointers on what I've done wrong.

Sub ShowLiveTVScreen()
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
video = {
streamFormat: "mp4"
streams: [
{ url: "http://192.168.251.42:5004/auto/v13.2", bitrate: 1800, quality: false },
{ url: "http://192.168.251.42:5004/auto/v13.1", bitrate: 5500, quality: true }
]
}
screen.SetContent(video)
screen.SetMessagePort(port)
screen.Show()
While True
msg = wait(0, screen.GetMessagePort())
If type(msg) = "roVideoScreenEvent" Then
If msg.isScreenClosed() Then
Exit While
Else If msg.isStatusMessage() Then
Else If msg.isPlaybackPosition() Then
Else if msg.isFullResult() Then
Exit While
Else if msg.isPartialResult() Then
Exit While
Else if msg.isRequestFailed() Then
MessageBox("Playback Error", msg.GetMessage() + " (" + msg.GetIndex().ToStr() + ")")
Exit While
End If
End If
End While
End Sub
0 Kudos
13 REPLIES 13
RokuJoel
Binge Watcher

Re: How to use H.264 TS Streams?

If it is streaming live, I'm going to assume, possibly incorrectly that this is an HLS stream broadcast in real time from the device, in which case you need to set streamFormat: "hls"

However, in that case you would probably need to construct a master playlist file that includes those two bitrates in it and point the Roku at the playlist file, or just include a single stream in the video object, HLS streams take only a single playlist URL as the parameter.

Just out of curiosity, which model of Tuner are you working with?

- Joel
0 Kudos
SkipFire
Visitor

Re: How to use H.264 TS Streams?

It's the HDTC-2US, it's supposed to be spitting out an H264 stream in a TS container (that's what they have told me and put on their forums). It is a live ATSC feed. I did try it with hls as the streamFormat as well, but I'll strip out one of the stream entries and see if it works with hls.
0 Kudos
SkipFire
Visitor

Re: How to use H.264 TS Streams?

I gave it another try and still no go and it still gives -5 as the error index. Any other ideas?


Sub ShowLiveTVScreen()
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
video = {
streamFormat: "hls"
streams: [ { url: "http://192.168.251.42:5004/auto/v13%2E1", bitrate: 5500, quality: true } ]
}
screen.SetContent(video)
screen.SetMessagePort(port)
screen.Show()
While True
msg = wait(0, screen.GetMessagePort())
If type(msg) = "roVideoScreenEvent" Then
If msg.isScreenClosed() Then
Exit While
Else If msg.isStatusMessage() Then
Else If msg.isPlaybackPosition() Then
Else if msg.isFullResult() Then
Exit While
Else if msg.isPartialResult() Then
Exit While
Else if msg.isRequestFailed() Then
MessageBox("Playback Error", msg.GetMessage() + " (" + msg.GetIndex().ToStr() + ")")
Exit While
End If
End If
End While
End Sub
0 Kudos
RokuMarkn
Visitor

Re: How to use H.264 TS Streams?

Transport Stream is not a supported container format. However you might try changing streamFormat to "ts" and see how it works.

--Mark
0 Kudos
SkipFire
Visitor

Re: How to use H.264 TS Streams?

Changing to ts did not work, but unless I am reading the docs wrong ts is supposed to be supported.

http://sdkdocs.roku.com/display/sdkdoc/Encoding+Guide#EncodingGuide-25SupportedVideoFormats
0 Kudos
RokuMarkn
Visitor

Re: How to use H.264 TS Streams?

I'm a little suspicious whether this is really TS over http. Are you sure the protocol is http and not rtsp or something like that? What do you see if you point your browser to the address http://192.168.251.42:5004/auto/v13%2E1 ?

--Mark
0 Kudos
SkipFire
Visitor

Re: How to use H.264 TS Streams?

If I point IE to that address it opens in WMC and I see the video. If I use Chrome or C# I am able to save the stream to file and play it back in any video player without any modifications or plugins.
0 Kudos
RokuJoel
Binge Watcher

Re: How to use H.264 TS Streams?

We are not able to stream "live" video using progressive mp4 files. If you take the file you saved, change the extension to .mp4 and put in on a USB drive, change:

streamFormat: "hls"
streams: [ { url: "http://192.168.251.42:5004/auto/v13%2E1", bitrate: 5500, quality: true } ]


to

streamFormat: "mp4"
streams: [ { url: "ext1:/filename.mp4", bitrate: 5500, quality: true } ]


I'm thinking it might play that way.

- Joel
0 Kudos
SkipFire
Visitor

Re: How to use H.264 TS Streams?

The saved files play fine, I didn't have problems with that, but I was looking to try to play the live stream. Guess I will have to figure out some other way to do what I want.
0 Kudos