tivostream - video streaming server for Series 3 Tivos

Discussion in 'TiVo Home Media Features & TiVoToGo' started by moyekj, Aug 22, 2008.

  1. Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008

    Advertisements

    And since qt-faststart.py is a python script, it doesn't need to be compiled. It will run anywhere that has python installed. Mac OS X has python preinstalled. Though there isn't a nice GUI, just bring up Terminal and type: python qt-faststart.py <filename>
     
  2. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    I think that's right. At the time I believe I de-muxed and re-muxed with Womble and that fixed the trick play problem but I think it introduced audio/video sync problem. Since I wasn't that bothered about it and don't watch anything recorded from RTVs anymore I left it at that.
     
  3. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    For those that may need to build qt-faststart there are a couple of defines needed for gcc in order for it to work properly:
    gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o qt-faststart qt-faststart.c

    (I will add this as a comment in qt-faststart.c file included with tivostream).
     
  4. windracer

    windracer joined the 10k club

    12,308
    232
    Jan 3, 2003
    St. Pete, FL
    I'm able to run v0p8 through Galleon now. The config.ini needs to be in Galleon's bin directory (where Galleon is started from) so I just created a symlink to the file located elsewhere.

    So the steps are:

    - drop tivostream*.jar into galleon/hme/
    - put config.ini into galleon/bin (or galleon/hme and then create a symlink on Linux)
    - add the following line to galleon/hme/launcher.txt: com.hme.tivo.videostream.videostream
    - restart galleon
    - tivostream's log will be written into galleon/logs/wrapper.log

    YMMV of course.
     
  5. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN

    Advertisements

    Wow, I take a week off due to my workload and it looks like a lot has moved on the tivostream front. I was still having issues with tivostream having the strange DNS crash on a Mac. I tried it both on my PPC based server and an Intel based desktop with the same result. I'll try v8 today but since the latest versions also work on Java 1.5, I might also try it on my Solaris 10 server which doesn't have Java 1.6 installed yet.

    I mean, if a Java app doesn't work on Solaris... ;-)
     
  6. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    OK, I downloaded v8 and have tried it both on Solaris 10 and on Mac OS X Leopard Server. The good news is that it works on both. And so far I haven't seen the strange DNS error from earlier. The bad news is that I'm seeing a large amount of macroblocking with the picture. At first I thought it was just some of the previous rips that I had done, but it also does it with the Revision3 720p clip we all use as a control. So I'm not sure what's going on.

    And I haven't had a chance to do any of the mp4 + 5.1 sound hacking that's been discussed since I'll have to add an extra step of the Python script. I'll work on that later.
     
  7. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    That is odd. I don't have that problem with any of my clips including the Revision3 one (and I'm using streaming across a wireless network). A few things I might suspect:
    1. A network issue of some sort
    2. Your server(s) being overloaded (check CPU & I/O resources on your server)
    3. A Tivo issue. Perhaps rebooting your Tivo may help.
     
  8. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    1. Network: My Tivos, the Leopard Server and the Solaris server are all on the household wired gigabit network. I have bandwidth for days.

    2. Server overloaded. That is a possibility. Both the Leopard Server and the Solaris box are not modern boxes (8+ years old for both). The Leopard Server specifically does a lot of things on my network and the Solaris server gets all its movie files from the Leopard Server via NFS. Still, it doesn't take much horsepower to through a video file around.

    3. A Tivo issue. Also a possibility. Well, for some reason, I'm not having this problem anymore. Go figure.

    Well, I did get a chance to try out the Handbrake using the Xbox setting plus AC3 passthru sound. For a test video, I chose another Pixar short "For The Birds" found on the Monster's Inc. bonus DVD. It's less than 4 minutes and which makes it an easy Handbrake rip, and it has AC3 5.1 sound.

    The video ripped nicely to a 58 MB file and then I washed it through the qt-faststart.python script on one of my Macs. Then I attempted to play it through either tivostream server I have going (Leopard Server and Solaris server).

    The video DID PLAY, so thanks to Moyekj for figuring out which major Handbrake setting would finally work. So that should be it, huh? Rip all my movies this way, wash them through qt-faststart.py and everything should be wonderful, right?

    Well, not so fast. There is one major problem. The video and audio aren't synced when played this way. The delay is enormous...about 2-3 second with the audio being behind the video. I tried this on both Tivo S3s which each feed a AC-3 capable receiver. Same result and the same resule with both servers I'm running.

    Now I'm not sure just why I'm seeing this. I suppose I could try a faster machine but I have to openly wonder why a faster server would make a difference. I will try my PC laptop later this morning and see if it makes a difference. I'm so close to getting a final solution I can taste it. But I gotta wonder what's happening here.

    One last bug report...I am still seeing the DNS issue on both the Leopard Server and the Solaris server, but it happens far less frequently. I'm wondering if the issue might be the DNS server I run on the Leopard Server. I used to have the Solaris machine be the primary DNS box in the house, but I changed that a month ago. This could also be a by-product of Java 1.5 since I haven't run tivostream on a Java 1.6 machine in a while (the Win XP SP2 PC laptop has 1.6).
     
  9. Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008
    It's probably the Handbrake profile you're using. The darn thing has so many knobs you can fiddle with. Maybe start with one of the Apple TV profiles and manually override the audio selection to passthrough the AC3. There are Handbrake forums threads dedicated to fine tuning the encodes for different types of devices.

    Alternately, you could try demuxing and remuxing the file with ffmpeg (as referenced in my previous posts) and then passing it through qt-faststart again. When remuxing you can introduce a fixed delay between the audio and video to get them back into sync IF you have a constant delay throughout the whole clip (though it does suck to have to do this empirically.)
     
  10. kas25

    kas25 Member

    413
    2
    Mar 10, 2003
    NJ
    I would love to try this but how user friendly is it to get this up and running? Should a novice try to download and install? Thanks.
     
  11. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    Really is not much to it:
    1. Make sure you have Java Runtime Environment 1.5 or later installed
    2. Download and unpack the zip file
    3. Edit the config.ini to add paths where to find your video files
    4. In windows double click on the run_win.bat file to start the server (for Linux/Mac/Solaris or all other unix flavors you run run_unix.sh from command line)
    5. On your Tivo(s) now go find "Video Streamer" under Music, Photos & More and start it and you are off and running.
    (The included html documentation has more details on all the above steps)
     
  12. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    I've tried several re-encodes from DVD sources so far this weekend and while I didn't have the audio/video sync problems I found the Handbrake encodes (with Xbox 360 profile) resulted in "jumpy" video - not smooth at all from frame to frame. I tried a few other profiles that mostly either did not work or were no better.

    Finally I gave up on Handbrake and switched to ffmpeg and the result was a HUGE improvement. I've now settled on a ffmpeg profile where just by varying the bitrate I get good SD and HD H.264+AC3 encodes that play well on Tivos and look almost as good as the original DVD. I have a Perl script that handles the encode and the qt-faststart run all in 1 shot. I post it here mostly for the benefit of others to see the kind of ffmpeg recipe that seems to work pretty well (being in Perl makes this easily portable to different architectures):
    Code:
    # perl tivo_mp4_encode.pl [-h] inputFile.mpg
    # NOTE: Audio is not re-encoded (expect AC3)
    
    use     Getopt::Std;
    
    $ffmpeg		= "c:\\home\\ffmpeg\\ffmpeg.exe";
    $qt_faststart	= "c:\\home\\ffmpeg\\qt-faststart.exe";
    
    $bitrate 		= "2000k";
    $bufsize		= "14745k";
    $maxrate		= "16000k";
    $level			= 31;
    $framerate		= 29.97;
    $gop_size		= 300;
    $extension		= ".mp4";
    
    # Command line options: Use -h for hd encodes (increases video bitrate)
    getopts('h', \ my &#37;opts );
    if ( $opts{h} ) {
       # Set higher bitrate for HD encodes
       $bitrate = "8000k";
    }
    
    # Get input file from command line argument
    $input = $ARGV[0];
    die "File not found: $input" if ! -f $input;
    
    # Define output file
    $output = $input;
    $output =~ s/^(.+)\..+$/$1/;
    $output = $output . $extension;
    $output_tmp = $output . ".tmp";
    
    # ffmpeg run
    $command = qq#$ffmpeg -y -i $input -vcodec libx264 -coder 0 -level $level -r $framerate -sameq -g $gop_size -bufsize $bufsize -b $bitrate -maxrate $maxrate -bug "+autodetect+ms" -me epzs -trellis 2 -mbd 1 -acodec copy -f mp4 $output#;
    &run($command);
    
    # qt-faststart run
    $command = qq#$qt_faststart $output $output_tmp#;
    &run($command);
    
    # Replace original encoding with qt-faststart version
    print "Renaming $output_tmp to $output\n";
    unlink($output);
    rename($output_tmp, $output);
    
    sub run {
     my $command = shift;
       print "$command\n";
       my $result = system($command);
       if ($result != 0) {
          die "*ERROR* command failed: $command\n";
       }
    }
    
     
  13. Tico

    Tico Bear Down Cats!!!!!

    328
    0
    Dec 9, 2002
    What am I missing? I cannot get it to start, I get errors attached below

    I am running Vista 64 bit latest Java reinstalled today
    Tried latest 2 builds
     

    Attached Files:

    • TS.jpg
      TS.jpg
      File size:
      33.3 KB
      Views:
      20
    • ts2.jpg
      ts2.jpg
      File size:
      46.9 KB
      Views:
      15
  14. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    Looks like you don't have java in your windows path. Either add Java to your path or edit the run_win.bat script to give the full path to java.exe. For example, on my Vista system Java Runtime Environment is installed at:
    c:\Program Files (x86)\Java\jre1.6.0_05
    Thus the full path to the java.exe binary is:
    c:\Program Files (x86)\Java\jre1.6.0_05\bin\java.exe

    (On my system c:\Program Files (x86)\Java\jre1.6.0_05\bin is part of my windows path)
     
  15. Tico

    Tico Bear Down Cats!!!!!

    328
    0
    Dec 9, 2002
    Thanks for the reply, I edited the run_win,bat with exactly that and that is the TS2.jpg attachment above. Still no go.... Does the path need quotes or anything around it?

    And what do you mean by "Either add Java to your path " Is that different than editing the run_win.bat?
     
  16. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    Yes, if the path has any spaces in it you should surround the whole thing in quotes. So in my example above in the run_win.bat file substitute java for:
    "c:\Program Files (x86)\Java\jre1.6.0_05\bin\java.exe"

    Alternately Y\you can edit your windows path as follows:
    Control Panel->System->Advanced System Settings...
    On System Properties select Advanced tab and click on Environment Variables...
    In System Variables section find Path click on Edit... and at end of list add another semi-colon followed by full path to Java bin folder.

    By adding java to your windows path then you can just leave the run_win.bat script alone as "java" would be found by the batch script.

    P.S. If I recall correctly as part of Java installation it asks you if you want to add java to your windows path somewhere in installation process.
     
  17. Tico

    Tico Bear Down Cats!!!!!

    328
    0
    Dec 9, 2002
    Bingo, adding the path worked... Thanks....
     
  18. beady

    beady New Member

    60
    0
    Oct 30, 2006
    LI, NY
    I used Pinnacal Studio 11 to create a 1 minute MPEG2 video of some HD footage I took with my Sony HDR-SR11. It seems like the server can't stream fast enough to keep up with the video. Could the file be too big or is something else wrong? I'm running Windows Vista. Is there a program I can run to give me information about the file? I'm running Tivo Stream Vp06.
     
  19. moyekj

    moyekj Well-Known Member

    12,299
    949
    Jan 23, 2006
    Mission...
    GSpot is an application to look at program information. You could also install VideoLAN VLC which can display information about the stream it's playing.
    What kind of speeds do you get for Tivo To Come Back? (NOTE, you can check speeds you are getting under network diagnostics on your Tivos). The streaming speeds seem to be comparable to that. THD units are a little slower than S3 units for some reason and I think max out around 10 Mbits/sec or so which doesn't cut it for the higher bitrate HD mpeg2 streams which for 1080i high quality streams can go as high as 19 Mbits/sec or so.
    Of course the other alternative is to encode to H.264 instead of mpeg2. Being a more efficient encoding you can get about same quality with about half the bitrate of mpeg2.

    For my case I've streamed lots of episodes of Lost (720p mpeg2) to my S3s and the stream just about keeps up slightly faster than real time. I get around 11-12 Mbits/sec rate during streaming (wireless connection on laptop side). I can get a little faster than that with a wired connection.

    NOTE: It also can help to tune both tuners of the Tivo you are streaming to to channels you don't receive - that takes a lot of load off the Tivo to allow it to devote more resources to the video stream.
     
  20. SamD

    SamD Member

    46
    2
    Jan 28, 2007
    Redondo...
    All my files come from single source, my Tivo HD. I download them with T2Sami and convert to mpeg with either T2Sami or Tivo Decoder. SD material plays with no problems. However, two HD shows that I tried (Ratatouille and Earth Biography) freeze after 15-20 seconds, green strip at the bottom of screen comes up (buffer image?), shortens for about two minutes and finally freezes as well. I'm running Windows XP Home and Tivostream Vp08. What could be wrong?
     

Share This Page

spam firewall

Advertisements