tivostream - video streaming server for Series 3 Tivos

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

  1. Sep 4, 2008 #161 of 436
    Allanon

    Allanon Active Member

    998
    201
    Nov 2, 2005

    Advertisements

    VLC has a Java API that will allow this, Look at this link:

    http://trac.videolan.org/jvlc/

    And if you look at this diagram, which is outdated, you can see it has all the functions needed to operate VLC. You can also look at the link in my previous post to see how to operate VLC using Javascript. I also noticed they have a Python API for VLC so I might try this using wmcbrine HME/VLC video streamer program. I don't know Java but I did learn some Python.
     
  2. Sep 4, 2008 #162 of 436
    moyekj

    moyekj Well-Known Member

    12,302
    949
    Jan 23, 2006
    Mission...
    Just tried your test clip. Resulting encoding wasn't too bad (but of course never as good as original) considering it's about half the size:
    TestClip1.mpg 121,821,184 bytes
    TestClip1.mp4 70,210,768 bytes
    Here's the script I used for that encoding (with all relevant settings):
    Code:
    #!/bin/csh -f
    set ffmpeg = /home/moyekj/linux/src/ffmpeg/ffmpeg
    set input = /tmp/TestClip1.mpg
    set output = /tmp/TestClip1.mp4
    
    set bitrate = "7700k"
    set bufsize = "14745k"
    set maxrate = "16000k"
    set achannels = 2
    set arate = 48000
    set abitrate = "192k"
    
    set level = 31
    set framerate = 29.97
    set gop_size = 300
    set volume = 150
    
    $ffmpeg -y -i $input -vcodec libx264 -coder 0 -level $level \
    -r $framerate -sameq -g $gop_size -bufsize $bufsize \
    -maxrate $maxrate -b $bitrate -bug +autodetect+ms \
    -me epzs -trellis 2 -mbd 1 -vol $volume -acodec libfaac \
    -profile aac_low -ac $achannels -ar $arate \
    -ab $abitrate -f mp4 $output
    
     
  3. Sep 5, 2008 #163 of 436
    lrhorer

    lrhorer Active Member

    6,933
    10
    Aug 31, 2003
    San...
    Thanks. 'Sounds like there's some real possibilities. I'll have to get libx264 working.
     
  4. Sep 7, 2008 #164 of 436
    moyekj

    moyekj Well-Known Member

    12,302
    949
    Jan 23, 2006
    Mission...
    Update
    I've got bookmarking capability (so one can resume where you left off watching) working pretty well for mpeg2 recordings. However, for mpeg4 recordings it looks like Tivo needs to see the start of the recording and the header information or it doesn't work, so for mpeg4 if I try and start playback anywhere other than the start of the file it errors out.

    So at this point I'm not sure what to do with mpeg4 and bookmarking. There are probably other tricks to try such as start playing a recording and then skipping to bookmarked point but certainly not elegant or easy. For 1st release of this capability I may just release it with mpeg2 support only for now...
     
  5. moyekj

    moyekj Well-Known Member

    12,302
    949
    Jan 23, 2006
    Mission...

    Advertisements

    v0p7 - September 10, 2008
    -------------------------
    * Now compatible with Java Runtime Environment 1.5 or later.
    * Added bookmarking capability (currently only for mpeg2 files) such that
    you can resume from where you left off viewing. There are a few caveats:
    - You must use Play button to resume viewing from bookmarked location.
    Right arrow or Select will start playback from beginning. This gives
    you the choice of starting from where you left off or beginning.
    - Only implemented for mpeg2 files currently
    - Cannot bookmark close to initial playback - video that is buffered
    by Tivo before playback begins cannot be bookmarked. Thus, for example
    if buffer is at 30 secs when playback begins bookmarking will not work
    until after 30 secs.
    - You must exit playback using the Left arrow in order to save/bookmark
    your position. If you use the Tivo button or some other means of
    exiting playback the position will not be saved.
    * When resuming to file browser mode from video playback the directory you
    return to is now fully refreshed (in case any changes happened during
    playback).
     
  6. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    Thanks! Let's see if we can get this running on our Macs now...

    Working...
     
  7. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    OK, I'm pleased to report that I've gotten Tivostream v0p7 up and running properly on a Mac. The Mac in this case is an old machine...an 8 year old Powermac G4 hacked to run Leopard Server. It's this server that is the primary server in my house and houses all my video and audio files, among others. Since this is while the video sits, it's an ideal computer to run this program.

    Setting up the config file was pretty easy. One thing to remember for Mac users and this program is that since I launched it as a Unix process via the Terminal window, you have to setup the <topdir> variable in something that makes sense for a Unix machine and not necessarily a Mac. So in this case, use Unix-style "/" delimiters instead of ":" delimiters that you would use for most Mac programs. Example:

    /Users/sevenfeet/movies/tivostream/

    If you have your movie directory on a separate drive like I do, make sure you use "/Volumes" ahead of the name of your hard drive. Example:

    /Volumes/myexternaldrive/movies/tivostream/

    I just ran the "run_unix.sh" shell script to get it started. I haven't tried to create a double clickable application icon which you can do with the Java VM on the Mac. That will be my next task later this evening.
     
  8. beady

    beady New Member

    60
    0
    Oct 30, 2006
    LI, NY
    Moyekj,

    Just wanted to say thanks for the program. I've been converting all my VHS-C tapes to digital and now I can just stick the mpeg files on the server and watch them from my Tivo. Tivostream makes it easy to organize them and my family is getting a kick out of watching old tapes.
     
  9. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    BTW, this is probably an obvious question but is there any reason why you couldn't stream .tivo files that have been transferred with either Tivo Desktop (Windows) or Tivo Transfer (Mac)?
     
  10. moyekj

    moyekj Well-Known Member

    12,302
    949
    Jan 23, 2006
    Mission...
    I don't think I've tried but I think Tivo will reject them as it's expecting unencrypted mpeg2 or mpeg4 files. The .TiVo files have the metadata information up front + encryption that probably messes things up. You can give it a shot by adding .TiVo as a file extension in tivostream config but I doubt it will work.
    Personally I don't find .TiVo format too convenient to keep that way. Decoding to a regular mpeg2 program stream is quick enough and allows you to then use the file with any mpeg2 editor/player. With pyTivo metadata you can always keep the metadata information around if you want to send it back to Tivo (via pyTivo or tivostream) and still have the program information.
     
  11. moyekj

    moyekj Well-Known Member

    12,302
    949
    Jan 23, 2006
    Mission...
    Thanks. Yes a big advantage of not having the files on the Tivos themselves is that you can organize them however you want and across multiple file volumes instead of dealing with Tivo's limited organization capabilities.
     
  12. wmcbrine

    wmcbrine Well-Known Mumbler

    11,900
    938
    Aug 2, 2003
    Yes, .TiVo files don't stream.
     
  13. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    I've run into a a problem with tivostream v0p7. I can get it up on my Mac Leopard Server. I can get it to stream a movie just like my PC laptop running WinXP. But I can't get the program to stay running. Eventually, it crashes with the same error.

    Exception in thread "JmDNS.SocketListener" java.lang.ArrayIndexOutOfBoundsException: 7 >= 7
    at java.util.Vector.elementAt(Vector.java:432)
    at javax.jmdns.DNSRecord.suppressedBy(Unknown Source)
    at javax.jmdns.DNSOutgoing.addAnswer(Unknown Source)
    at javax.jmdns.JmDNS.handleQuery(Unknown Source)
    at javax.jmdns.JmDNS$SocketListener.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:613)

    I'm not sure just what is going on here. I'm not sure why the program is throwing what seems to be a problem with the DNS routines. Sometimes the OutofBoundsException is "6 >= 6", other times it's 7. You don't have to do anything to generate this error...eventually it will come on its own whether you have streamed a movie or not. When this error throws, "Videostream" disappears from the Tivo menus.

    Any idea what might be happening here? And for the record, the server in question does function as the DNS server for my network.
     
  14. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    OK, what's the best way to turn a .tivo file into a regular mp2 file? Sorry if this is a stupid question but a google search isn't as obvious as I would like on this subject.
     
  15. Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008
  16. moyekj

    moyekj Well-Known Member

    12,302
    949
    Jan 23, 2006
    Mission...
    Not sure, but maybe with more information logged the problem may become clearer, though you said just sitting there it will eventually crash which seems to imply nothing to do with tivostream itself but more with the HME server side. You can generate a lot more information from console by running HME server in debug mode (-d switch) and from my program by setting DEBUG variable. Easy way to do this is change run_unix.sh script to the following (which will capture all information in debug.log file):
    Code:
    DEBUG=1; export DEBUG
    java -cp tivostream_v0p7.jar com.tivo.hme.host.sample.Main -d com.hme.tivo.videostream.videostream >debug.log 2>&1
     
  17. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    OK, I've added the debug line. A debug.log file hasn't shown up in the same directory. It might be somewhere else...
     
  18. moyekj

    moyekj Well-Known Member

    12,302
    949
    Jan 23, 2006
    Mission...
    Make sure you copy the code I posted above, including the stdout/stderr re-direct portion (> debug.log 2>&1). Then the directory where you execute this run_unix.sh script is where debug.log will go (assuming the Mac behaves like normal unix).
     
  19. Sevenfeet

    Sevenfeet Gentle Giant

    165
    0
    Jun 24, 2000
    Nashville, TN
    D'oh! And I call myself a former Unix sysadmin. Shoulda known... :)
     
  20. windracer

    windracer joined the 10k club

    12,310
    235
    Jan 3, 2003
    St. Pete, FL
    I'm trying to run tivostream through Galleon again (I know, what is it with me and running apps through Galleon, right?) via the launcher.txt file. The app starts, and I can see it on the TiVo menu, but it crashes when I select it and the log shows it can't find config.ini.

    I've put the tivostream jar file in Galleon's hme directory (which is in the classpath) and the config.ini is there as well. I've also tried putting it in a few other places. I'm not sure if it's crashing because it can't find the file or due to a conflict with Galleon's jars. It runs just fine standalone.

    I'll keep poking at it, just wondering what piece I was missing.

    edit: hmm, maybe I'll try that debug thing.
     

Share This Page

spam firewall

Advertisements