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

Home video streaming

I thought I'd pass on this weekend's success. I tweaked the videoplayer example so that I can enter a hostname or IP of a local server to grab the XML from.

I slapped together a quick python app to generate a feed xml file from a directory of mp4 files (really ugly, no images, no descriptions, title is the filename).

So I can now play my collection of videos. Or try to anyway.

I am still having issues with things rebuffering way too much. That may be the videos or I may have something set wrong (hard coded the stream bitrate to 1500, etc.

I have also managed to crash the box multiple times. It seems very sensitive to the video file, and even ones that play partially can crash it. So far it has rebooted every time, so a big kudo to the engineers for making it hard to brick the device!
0 Kudos
38 Replies
Highlighted
Level 7

Re: Home video streaming

do you have it so you can enter the IP or hostname from the Roku player itself, or is it hardcoded? If you can enter the information from the roku - do the settings stay after a reboot?
Model: 2050X - wired
S/N: J0A07F000104
Location: St. Louis, MO
ISP: At&t 12Mb (primary) -- Charter 20Mb (secondary)
0 Kudos
Highlighted
Level 7

Re: Home video streaming

"danstl" wrote:
do you have it so you can enter the IP or hostname from the Roku player itself, or is it hardcoded? If you can enter the information from the roku - do the settings stay after a reboot?


Yes, I used a roKeyboardScreen for it, and it saves it to the registry. Here's the code:


'************************************************************
' ** Check the registry for the server URL
' ** Prompt the user to enter the URL or IP if it is not
' ** found and write it to the registry.
'************************************************************
Function checkServerUrl() as Void
serverURL = RegRead("ServerURL")
if (serverURL = invalid) then
print "ServerURL not found in the registry"
serverURL = "video.local"
endif

screen = CreateObject("roKeyboardScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetTitle("Video Server URL")
screen.SetText(serverURL)
screen.SetDisplayText("Enter Host Name or IP Address")
screen.SetMaxLength(25)
screen.AddButton(1, "finished")
screen.Show()

while true
msg = wait(0, screen.GetMessagePort())
print "message received"
if type(msg) = "roKeyboardScreenEvent"
if msg.isScreenClosed()
return
else if msg.isButtonPressed() then
print "Evt: ";msg.GetMessage();" idx:"; msg.GetIndex()
if msg.GetIndex() = 1
searchText = screen.GetText()
print "search text: "; searchText
RegWrite("ServerURL", searchText)
return
endif
endif
endif
end while
End Function


Right now it always shows the screen -- I haven't added any setup screen to the player yet.
0 Kudos
Highlighted
Level 7

Re: Home video streaming

Here's a Mercurial repository of my code at bitbucket.
0 Kudos
Level 7

Re: Home video streaming

I've been working on something similar though I've been making the files setup a little more complicated...

I like the entering the IP address, i might use that

you can check out the basic layout of my files here:
http://fimii.net/roku

though i'm having problems with getting an HD video to play SD. I'm guessing I need a separate sd video? or do i just define the hd video as SD and it'll figure it out?
0 Kudos
Highlighted
Level 7

Re: Home video streaming

just answered my own question. if i label the HD file as SD it works fine.
0 Kudos
Highlighted
Level 7

Re: Home video streaming

Thanks to a post on my blog I have a solution to my aspect ratio problem. I have to rerip with anamorphic turned off and set the height to 480. Then things look correct when played. Now I have to rerip my collection though Smiley Sad

./HandBrakeCLI -i /dev/dvd1 -o video.mp4 -e x264 -b 1500 -B 160 -R 48 -E faac -f mp4 -m -O -l 480 -2 -T -x ref=2:bframes=2:subme=5:me=umh 


I also added the -O Optimize for HTTP Streaming flag in the hopes that it would solve the rebuffer problem, but it didn't. It really would be helpful if there were some more verbose debugging options so we could see why it was deciding to rebuffer at that point.
0 Kudos
Highlighted
Level 7

Re: Home video streaming

Does it rebuffer reproducibly at the same point in the stream every time? If that's the case, one possibility is the audio/video interleave is too large at that point. It's best to keep the interleave fairly short, ideally less than 5 seconds.

--Mark
0 Kudos
Highlighted
Level 7

Re: Home video streaming

"RokuMarkn" wrote:
Does it rebuffer reproducibly at the same point in the stream every time? If that's the case, one possibility is the audio/video interleave is too large at that point. It's best to keep the interleave fairly short, ideally less than 5 seconds.

--Mark


Yes, it is reproducible by skipping to approximately an hour into the movie. I'd have expected the interleave to be fairly short, but I'll see if I can find any way to tweak that with x264.

Thanks.

Brian
0 Kudos
Highlighted
Level 7

Re: Home video streaming

I see the same problem on mine. It appears to happen starting around the 1 hour mark for me too.
0 Kudos