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!
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?
“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.
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?
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.
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.
“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.
I just switched to using lighttpd instead of Apache and it is still happening, so it is the file, not the server (I didn’t expect it to be, but just to be sure).
What are you using to make your mp4 files? Handbrake?
As for what I’m using to encode, I’m using Handbrake to make an M4V file. I used the AppleTV preset, and then ran it through FFMPEG to strip out the secondary audio stream.
I’m trying some other encoding settings now to see if they make a difference.
I might have found something. In Handbrake, I made a custom preset in which I checked “Web optimized”, set the average bitrate to 1500 (instead of constant quality), set the audio to stereo AAC 48khz 192kbps, unchecked “create chapter markers”, and set anamorphic mode to none. The movie I encoded with this did not rebuffer after the 1 hour mark. I am now trying to re-encode the same movie that was giving me trouble earlier with these settings to see if they make a difference.
what is your original source, are you ripping directly from a DVD with handbrake? If so I would try using a different program to extract the VOBs and combine them, and then just use handbrake to convert the VOBs…
“danstl” wrote:
what is your original source, are you ripping directly from a DVD with handbrake? If so I would try using a different program to extract the VOBs and combine them, and then just use handbrake to convert the VOBs…
Do you have any suggestions for other programs? I’m using an older version of Handbrake with libdvdcss included in it (I haven’t had much luck with the newer versions).
“jhanson” wrote:
I might have found something. In Handbrake, I made a custom preset in which I checked “Web optimized”, set the average bitrate to 1500 (instead of constant quality), set the audio to stereo AAC 48khz 192kbps, unchecked “create chapter markers”, and set anamorphic mode to none. The movie I encoded with this did not rebuffer after the 1 hour mark. I am now trying to re-encode the same movie that was giving me trouble earlier with these settings to see if they make a difference.
Ok, I’m re-trying my rip with the parameters I posted above without the -m and -O (markers and web optimized) options. When I added -O mp4info could no longer read the details of the mp4.
I’ll post results as soon as the rip is finished (hmm, time for a quad core system…)
Well, the settings didn’t help with the other videos. It still rebuffers. Per the docs, the video should work, and it works on every other device I’ve tried it on, so I think I’m just going to forget about it. Trying to get this to work was a fun little diversion, but I don’t care enough to spend any more time on it right now.
“jhanson” wrote:
Well, the settings didn’t help with the other videos. It still rebuffers. Per the docs, the video should work, and it works on every other device I’ve tried it on, so I think I’m just going to forget about it. Trying to get this to work was a fun little diversion, but I don’t care enough to spend any more time on it right now.
Same results here. If I can figure out how to rip the VOB and combine it into one before doing the encode I will try that.
I think what we need from Roku is some better debug info from the player when it decides to rebuffer.