# Home video streaming

**URL:** <https://forum.developer.roku.com/t/home-video-streaming/764>\
**Category:** Archived\
**Tags:** roku-developer-program\
**Created:** [December 20, 2009, 9:07pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764 "2009-12-20T21:07:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 20, 2009, 9:07pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/1 "2009-12-20T21:07:18Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![danstl](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@danstl](https://forum.developer.roku.com/u/danstl)\
**Post date:** [December 20, 2009, 9:35pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/2 "2009-12-20T21:35:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 20, 2009, 10:11pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/3 "2009-12-20T22:11:33Z")

</div>

> “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:

```auto

' ************************************************************' ** 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.

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 21, 2009, 12:49am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/4 "2009-12-21T00:49:49Z")

</div>

Here’s a Mercurial repository of my [code at bitbucket](http://bitbucket.org/bcl/homevideo/).

---

<div class="post-metadata">

**Author:** ![fimion](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@fimion](https://forum.developer.roku.com/u/fimion)\
**Post date:** [December 21, 2009, 9:08am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/5 "2009-12-21T09:08:35Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![fimion](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@fimion](https://forum.developer.roku.com/u/fimion)\
**Post date:** [December 21, 2009, 9:26am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/6 "2009-12-21T09:26:12Z")

</div>

just answered my own question. if i label the HD file as SD it works fine.

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 23, 2009, 3:59pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/7 "2009-12-23T15:59:59Z")

</div>

Thanks to a post on [my blog](http://blog.brianlane.com) 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 😞

```auto
./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.

---

<div class="post-metadata">

**Author:** ![RokuMarkn](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@RokuMarkn](https://forum.developer.roku.com/u/RokuMarkn)\
**Post date:** [December 23, 2009, 4:59pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/8 "2009-12-23T16:59:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 23, 2009, 5:45pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/9 "2009-12-23T17:45:28Z")

</div>

> “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

---

<div class="post-metadata">

**Author:** ![jhanson](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jhanson](https://forum.developer.roku.com/u/jhanson)\
**Post date:** [December 24, 2009, 1:56am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/10 "2009-12-24T01:56:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 24, 2009, 3:44am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/11 "2009-12-24T03:44:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![RokuMarkn](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@RokuMarkn](https://forum.developer.roku.com/u/RokuMarkn)\
**Post date:** [December 24, 2009, 4:07am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/12 "2009-12-24T04:07:47Z")

</div>

If the file is on a public server, I can take a look at it. Send me a PM with the URL and the time at which the problem occurs.

–Mark

---

<div class="post-metadata">

**Author:** ![jhanson](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jhanson](https://forum.developer.roku.com/u/jhanson)\
**Post date:** [December 24, 2009, 4:42am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/13 "2009-12-24T04:42:28Z")

</div>

My file isn’t on a public server, unfortunately.

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.

---

<div class="post-metadata">

**Author:** ![jhanson](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jhanson](https://forum.developer.roku.com/u/jhanson)\
**Post date:** [December 24, 2009, 6:15am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/14 "2009-12-24T06:15:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![danstl](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@danstl](https://forum.developer.roku.com/u/danstl)\
**Post date:** [December 24, 2009, 6:28am UTC](https://forum.developer.roku.com/t/home-video-streaming/764/15 "2009-12-24T06:28:01Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 24, 2009, 3:22pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/16 "2009-12-24T15:22:17Z")

</div>

> “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).

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 24, 2009, 3:53pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/17 "2009-12-24T15:53:20Z")

</div>

> “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…)

Brian

---

<div class="post-metadata">

**Author:** ![jhanson](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@jhanson](https://forum.developer.roku.com/u/jhanson)\
**Post date:** [December 24, 2009, 4:19pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/18 "2009-12-24T16:19:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bcl](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@bcl](https://forum.developer.roku.com/u/bcl)\
**Post date:** [December 24, 2009, 8:49pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/19 "2009-12-24T20:49:01Z")

</div>

> “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.

---

<div class="post-metadata">

**Author:** ![pjoshua5000](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@pjoshua5000](https://forum.developer.roku.com/u/pjoshua5000)\
**Post date:** [December 24, 2009, 8:56pm UTC](https://forum.developer.roku.com/t/home-video-streaming/764/20 "2009-12-24T20:56:46Z")

</div>

Try DVD Decrypt

Its out of Developed, so I don’t think it will work with Windows vista or 7.

[Next page](https://forum.developer.roku.com/t/home-video-streaming/764.md?page=2)
