bcl
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2009
01:07 PM
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!
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!
38 REPLIES 38
danstl
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2009
01:35 PM
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)
S/N: J0A07F000104
Location: St. Louis, MO
ISP: At&t 12Mb (primary) -- Charter 20Mb (secondary)
bcl
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2009
02:11 PM
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.
bcl
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2009
04:49 PM
Re: Home video streaming
Here's a Mercurial repository of my code at bitbucket.
fimion
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2009
01:08 AM
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?
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?
fimion
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2009
01:26 AM
Re: Home video streaming
just answered my own question. if i label the HD file as SD it works fine.
bcl
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2009
07:59 AM
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 😞
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.
./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.

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2009
08:59 AM
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
--Mark
bcl
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2009
09:45 AM
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
jhanson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2009
05:56 PM
Re: Home video streaming
I see the same problem on mine. It appears to happen starting around the 1 hour mark for me too.