Advice for Debugging playback?

Roku's free SDK allows developers to build channels and applications and publish them to the Roku Channel Store. Register for the Developer Program at http://www.roku.com/developer

Moderators: RokuDouglas, RokuKen, RokuRyan, RokuJamesL, RokuChris, RokuJoel

Advice for Debugging playback?

Postby bcl » Sat Dec 19, 2009 5:29 pm

I'm playing with the simple video app example right now, streaming mp4 video from an Apache server. It works very well for around an hour's worth of video, and then it starts dropping to the 'loading, please wait' screen every few minutes.

In the apache logs I see the following:

Code: Select all
192.168.101.135 - - [19/Dec/2009:17:12:51 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 206 861020 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:13:21 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 206 578653421 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:15:30 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 200 1048543645 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:15:31 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 206 564835216 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:17:18 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 200 1048543645 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:17:18 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 206 555355769 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:17:19 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 206 555259925 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:18:49 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 200 1048543645 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:18:49 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 206 546965732 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:20:08 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 200 1048543645 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:20:09 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 206 539692743 "-" "Roku/DVP-2.4 (012.04E00350A)"
192.168.101.135 - - [19/Dec/2009:17:21:45 -0800] "GET /movies/Transformers_ws.mp4 HTTP/1.1" 200 1048543645 "-" "Roku/DVP-2.4 (012.04E00350A)"


Looking at my bandwidth graphs (on my Tomato router) at the start I would see a block of data transferred, then a long pause, then another block. When the problem happens I am seeing about a megabit, with peaks of 2 or 3 when the loading screen shows up.

I also tried going back to the info screen and re-starting it, then fast forwarding it to the same point and it still drops every minute or so.

The debug port doesn't log anything when this happens, the last thing it said was 'Displaying video:'

Is there anything else I can do to try to help debug this?

Thanks,

Brian
bcl
 
Posts: 111
Joined: Sat Dec 19, 2009 11:42 am
Location: Port Orchard, WA

Postby danstl » Sat Dec 19, 2009 6:48 pm

have you tried streaming the MP4 from another computer to see if it has the same issues?

Is the machine running apache doing anything else? Could there be a problem with the MP4, did you export the VOBs and then combine them, or something else when creating the mp4. I have seen odd streaming issues if you attempted to combine two different VOB conversions into a single file - some players will play them fine (VLC etc), but others have issues because it is not a compliant mp4 file anymore...

just wondering if it could be something with the file itself as that 1 hour mark is often around the time of a VOB break on the dvd...
danstl
 
Posts: 153
Joined: Tue Dec 01, 2009 2:22 pm

Postby bcl » Sat Dec 19, 2009 7:35 pm

danstl wrote:have you tried streaming the MP4 from another computer to see if it has the same issues?

Is the machine running apache doing anything else? Could there be a problem with the MP4, did you export the VOBs and then combine them, or something else when creating the mp4. I have seen odd streaming issues if you attempted to combine two different VOB conversions into a single file - some players will play them fine (VLC etc), but others have issues because it is not a compliant mp4 file anymore...

just wondering if it could be something with the file itself as that 1 hour mark is often around the time of a VOB break on the dvd...


The system is a Core2 Duo that is idle, it isn't a system load problem. It is actually the most un-loaded of my systems. I think I used Handbrake and only tweaked the file size option when creating these mp4s. I've seen it happen with the 2 movies I've tried so far.

I should go back and try creating a fresh mp4 and keep track of all the parameters.
bcl
 
Posts: 111
Joined: Sat Dec 19, 2009 11:42 am
Location: Port Orchard, WA

Postby danstl » Sat Dec 19, 2009 7:39 pm

Yeah I would also (if you have a free machine) just start the stream on the non roku box and see how it works - try VLC or something to stream.

Are you using the "high profile" in handbrake? and are you using handbrake to also rip the VOBs? cause I have seen issues with trying to use handbrake for everything - I usually rip the VOBs using something like DVD Decrypter, and then use handbrake to convert...

EDIT :
From the RokuDvp-Developer guide:

Run the application with the application debug console open. When you telnet to the Roku DVP on port 8085 (see section 8.1) you will see the debug console from your application. If there are any errors in your code, they will show up on this console. There is even a debugger attached to this port that will give you source file and line number information for script errors.
danstl
 
Posts: 153
Joined: Tue Dec 01, 2009 2:22 pm

Postby bcl » Sat Dec 19, 2009 8:21 pm

danstl wrote:Yeah I would also (if you have a free machine) just start the stream on the non roku box and see how it works - try VLC or something to stream.

Are you using the "high profile" in handbrake? and are you using handbrake to also rip the VOBs? cause I have seen issues with trying to use handbrake for everything - I usually rip the VOBs using something like DVD Decrypter, and then use handbrake to convert...

EDIT :
From the RokuDvp-Developer guide:

Run the application with the application debug console open. When you telnet to the Roku DVP on port 8085 (see section 8.1) you will see the debug console from your application. If there are any errors in your code, they will show up on this console. There is even a debugger attached to this port that will give you source file and line number information for script errors.


Oh, I see what you mean. Yes, it plays fine with vlc on different machines.

The debug console doesn't display much :)

I'm using handbrake for everything, using the Normal setting. Its the only thing I've found that work consistently for me. FYI this is using HandbrakeCLI on a Fedora 11 box.
bcl
 
Posts: 111
Joined: Sat Dec 19, 2009 11:42 am
Location: Port Orchard, WA

Postby danstl » Sun Dec 20, 2009 2:05 pm

What version of apache are you running, anything less than 2.2.x has a default 2GB limitrequestbody, so you will start getting errors once your roku starts requesting byte ranges over 2GB, unless you change the directive in your conf file for apache.
danstl
 
Posts: 153
Joined: Tue Dec 01, 2009 2:22 pm

Postby bcl » Sun Dec 20, 2009 2:31 pm

Apache 2.2.13 and my largest file is 1555974840 bytes. I've also seen the problem with shorter files.

I'm now feeding roVideoScreen the correct streamBitrate grabbed from the file using mp4info so maybe that will help.
bcl
 
Posts: 111
Joined: Sat Dec 19, 2009 11:42 am
Location: Port Orchard, WA

1 hr. rebuffering issue

Postby zimbra » Sun Jan 24, 2010 10:57 pm

I've run into this as well, after setting up an xml generator for my content, and hacking the videoPlayer example up to display the videos.

I'm running apache 2.2.13 on a mac-mini, and it seems to stream fine to the browser, itunes, etc - but I hit a rebuffering loop at around 1hr. into every video I've tried.

I saw some discussion of limited success by re-encoding with handbrake - is that the only solution that anyone has found? (With 2+ terabytes of media, that's likely to be a non-starter for me...)

The videos I've tested are all in mp4 containers, h.264 video. Bitrates all over the place, between 1 and 4 Mbps.
zimbra
 
Posts: 15
Joined: Sun Jan 24, 2010 10:52 pm

Re: 1 hr. rebuffering issue

Postby bcl » Mon Jan 25, 2010 8:46 am

zimbra wrote:I've run into this as well, after setting up an xml generator for my content, and hacking the videoPlayer example up to display the videos.

I'm running apache 2.2.13 on a mac-mini, and it seems to stream fine to the browser, itunes, etc - but I hit a rebuffering loop at around 1hr. into every video I've tried.

I saw some discussion of limited success by re-encoding with handbrake - is that the only solution that anyone has found? (With 2+ terabytes of media, that's likely to be a non-starter for me...)

The videos I've tested are all in mp4 containers, h.264 video. Bitrates all over the place, between 1 and 4 Mbps.


That's the only solution I found. I'm re-ripping my DVDs using Handbrake and the iPod-HiRez preset. I have had 0 problems with rebuffering on any of the new files.
bcl
 
Posts: 111
Joined: Sat Dec 19, 2009 11:42 am
Location: Port Orchard, WA

Postby TommyTheKid » Mon Jan 25, 2010 8:49 am

I saw a perhaps similar problem trying to stream some "helmet cam" video from my laptop to the Roku. It is in a MOV container, but h264... In my case the video is only about 5 minutes long, and it *constantly* re-buffers. It plays for maybe 10-15 seconds then buffers for about 30 (I don't have a stopwatch).

Code: Select all
$ mp4info RushCreek.mov
mp4info version 1.9.1
RushCreek.mov:
Track   Type   Info
1   video   H264 Main@4, 357.256 secs, 5593 kbps, 1280x720 @ 29.970105 fps
2   audio   MPEG-4 AAC LC, 357.056 secs, 64 kbps, 48000 Hz


I note that the video bitrate seems pretty high, but its on the local network, so I didn't figure it would really be a bandwidth issue. I did set the bitrate in the "simplevideoplayer" appMain.brs file. Should I set it to 5593 or 5593+64?

Tommy
TommyTheKid
 
Posts: 52
Joined: Wed Jan 20, 2010 8:50 pm

Re: 1 hr. rebuffering issue

Postby zimbra » Mon Jan 25, 2010 9:02 am

bcl wrote:That's the only solution I found. I'm re-ripping my DVDs using Handbrake and the iPod-HiRez preset. I have had 0 problems with rebuffering on any of the new files.


Ok, wow. The iPod preset is at 700 kbps, which gives me video with ridiculously low quality.

I've been looking at the requests the roku is making to my server, and I'm not sure there's not a problem there; it seems to request the full file, then a byte range, then the full file, then a byte range again
zimbra
 
Posts: 15
Joined: Sun Jan 24, 2010 10:52 pm

Postby TommyTheKid » Mon Jan 25, 2010 9:41 am

I also noticed that my "media library" doesn't play. I don't know if I am running into the "buffer" thing, as I have no picture, so I haven't spent a lot of time "watching" :).


Quality wise though, I found that I needed around 1000-1100 kbps on the video stream to make the picture mostly acceptable. I also did "Two pass" encoding, I think? such that it could get an idea where the bit rate could be lower for slower scenes and save some bits for the higher action parts.

Code: Select all
SuperFudge:Movies tommy$ mp4info Incredibles.mp4
mp4info version 1.9.1
Incredibles.mp4:
Track   Type   Info
1   video   MPEG-4 Simple @ L3, 6923.850 secs, 1049 kbps, 720x304 @ 29.970031 fps
2   audio   MPEG-4 AAC LC, 6922.913 secs, 128 kbps, 44100 Hz
3   od   Object Descriptors
4   scene   BIFS
SuperFudge:Movies tommy$ mp4info Finding\ Nemo.mp4
mp4info version 1.9.1
Finding Nemo.mp4:
Track   Type   Info
1   video   MPEG-4 Simple @ L3, 6033.027 secs, 1049 kbps, 720x400 @ 29.970030 fps
2   audio   MPEG-4 AAC LC, 6032.981 secs, 131 kbps, 48000 Hz
3   od   Object Descriptors
4   scene   BIFS
SuperFudge:Movies tommy$


I will also note that I made these like forever ago, and they don't say "h264" .. I also note that it looks like the "BIFS" are built into the file, maybe thats confusing it. I am sure I made these with handbrake, but I would never remember all the settings. They play fine in VLC. I use them to take movies on the airplane or whatever so I dont have a bunch of stupid DVDs to lose. It would be neat to be able to watch them on the big tv too :)

Tommy
TommyTheKid
 
Posts: 52
Joined: Wed Jan 20, 2010 8:50 pm

Retested at lower bitrate, no improvement

Postby zimbra » Mon Jan 25, 2010 10:14 am

I re-encoded one of my movies at 700kbs, and got the same buffering issue at about an hour. I'm going to do some debugging on the network this evening, and see if I can get a better picture of what exactly is being requested.

I may also try to re-encode with the web-optimized option set, see if that helps.
zimbra
 
Posts: 15
Joined: Sun Jan 24, 2010 10:52 pm

Postby DeftOne » Mon Jan 25, 2010 10:51 am

Wasn't it found that the 1-hour rebuffering issue that most people were running into was caused by a second audio stream that the Roku DVP didn't like? I could be wrong, but I do recall seeing it discussed previously. You might want to check into that.
DeftOne
 
Posts: 630
Joined: Tue Nov 17, 2009 4:27 pm

Postby zimbra » Mon Jan 25, 2010 11:10 am

DeftOne wrote:Wasn't it found that the 1-hour rebuffering issue that most people were running into was caused by a second audio stream that the Roku DVP didn't like? I could be wrong, but I do recall seeing it discussed previously. You might want to check into that.


The movie I'm testing with only contains one stream, AAC(CoreAudio) - Stereo mixdown at 128kbps.
zimbra
 
Posts: 15
Joined: Sun Jan 24, 2010 10:52 pm

Next

Return to Roku Developer Program

Who is online

Users browsing this forum: No registered users and 4 guests