tivostream - video streaming server for Series 3 Tivos

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

  1. Oct 1, 2008 #241 of 436
    cahoon

    cahoon New Member

    19
    0
    Nov 1, 2007

    Advertisements

    I just wanted to say that tivostream is one of the coolest apps that I've seen in a while. It was very easy to use. It's great to just stream my mp4 files to my Tivo rather than copy. Great job.

    Also, since I'm a Java guy, I like that it's written in Java :)

    -- Brendon
     
  2. Oct 2, 2008 #242 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008
    With tivostream mp4's does the audio have to be AAC or can it be AC3? I thought i read somewhere that the mp4 spec doesn't allow for AC3 but that you could use handbrake to get around.

    If AC3 is ok then, does anyone know of a good remuxer for combining x264 and AC3 streams? I used TsMuxer to split out the .264 and AC3 streams from a MKV file but I need a tool (windows) to recombine them in an .mp4 container. I am trying to avoid reencoding the audio and video, although if I have to I can reencode AC3 to AAC, but i think it would save me a bunch of time to not have to reencode the video portion.

    On another streaming topic, i'd like to get tivostream, or similar to run on my ReadyNAS NV+ box. pytivo would be ok for just transferring .tivo files and no encoding but if I could stream directly that would be great for the the .mp4 files. But I have read that the little ReadyNas doesn't have the HP to run Java, so i'm wondering if wmcbrines Python based HME project would do that? It seems that it might be doable with python on that platform, but then again i'm only smart enough to be dangerous. :)
     
  3. Oct 2, 2008 #243 of 436
    moyekj

    moyekj Well-Known Member

    12,321
    958
    Jan 23, 2006
    Mission...
    As shown in table in tivostream documentation the Tivo accepts both AC3 & AAC for audio along with H.264 in an mpeg4 container.
    You may be able to use ffmpeg to change containers while not re-encoding audio or video. Something like:
    ffmpeg -i inputFile.mkv -vcodec copy -acodec copy -f mp4 outputFile.mp4
    (i.e. copy video and audio stream but output in mp4 container)
    NOTE: You will probably also have to run the resulting mp4 file through qt-faststart before you can stream it to Tivo.
     
  4. Oct 2, 2008 #244 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008
    Thanks Moyekj!

    Sorry for maybe a noob question, i've been reading too many posts that the bits fall out as quick as they go in!

    I will try ffmpeg to combine the streams tonight and see how that goes.

    I tried running your example ffmpeg command line on your tivostream web site (code.google) and i kept getting errors, but there were so many options on that one who knows what was going on...
     
  5. Oct 2, 2008 #245 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008

    Advertisements

    bummer, unfortunately that command doesn't work. It says "codec frame size not set" and then " could not write header for output file "

    maybe i can reencode the audio to aac and see if that helps....
     
  6. Oct 2, 2008 #246 of 436
    cmontyburns

    cmontyburns Excellent. TCF Club

    21,529
    3,220
    Nov 14, 2001
    Houston, TX
    I hope you all will forgive a VERY newbie question, but I am just starting to look at HME stuff for the first time tonight. Do I need to install TiVo Desktop to make this and other HME apps work? I see there is a set of HME classes required and I don't know where to get them.
     
  7. Oct 3, 2008 #247 of 436
    moyekj

    moyekj Well-Known Member

    12,321
    958
    Jan 23, 2006
    Mission...
    No, everything needed as far as HME classes is in the jar file that is part of the zip package and you don't need anything from Tivo Desktop (I personally don't like or use Tivo Desktop software at all as I find 3rd party apps are much better). As stated in the documentation just run (double click) on run_win.bat script to run (on Windows, for other operating systems you can use run_unix.sh script). You do need to have Java Runtime Environment 1.5 or later installed.
     
  8. Oct 3, 2008 #248 of 436
    cmontyburns

    cmontyburns Excellent. TCF Club

    21,529
    3,220
    Nov 14, 2001
    Houston, TX
    Thanks, moyekj. I ran the shell script and got a NoClassDefFound (looking for com/tivo/hme/host/sample/Main) so I wondered if I needed something else that provided the HME classes. I suppose I need to set my classpath somewhere. It has been a loooooooong time since I did any programming, but I'll get it worked out.
     
  9. Oct 3, 2008 #249 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008
    Hi moyekj,

    On one of the streams I created using handbrake I am experiencing the stream dropping after around 17 minutes of playback. not in the same place.

    here is the output from server screen:

    >> Reading metadata file: V:\\Seinfeld - The Calzone.mp4.txt
    LOG: 192.168.0.90 Seinfeld - The Calzone.mp4 HTTP GET - to factory /videostream/

    url=file:/V:/Seinfeld%20-%20The%20Calzone.mp4
    LOG: 192.168.0.90 I/O Exception handling HTTP GET Seinfeld - The Calzone.mp4: Connection reset by peer: socket write error

    Any ideas?

    Thanks
     
  10. Oct 3, 2008 #250 of 436
    moyekj

    moyekj Well-Known Member

    12,321
    958
    Jan 23, 2006
    Mission...
    There are glitches in some video files that Tivo just plain rejects and hence the stream halts. A few posts up a user with an mpeg2 file was having the same problem and it turned out it failed in both tivostream and pyTivo, so obviously something the Tivo didn't like. The fix for that problem was to run it through VideoRedo Quickstream fix. For mpeg4 files I don't know of a Quickstream fix like tool however. If the source of that mp4 file is an mpeg2 file then I would suggest running Quickstream fix on it before encoding it to mp4.
    Also, personally I found encodings came out better with ffmpeg than with Handbrake, so you may want to try that.
    If you like P.M. me and perhaps I can get hold of the offending (and perhaps the source) video file to investigate further.
     
  11. Oct 3, 2008 #251 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008
    thanks for the help. The file is one that I edited (removed commercials) in Redo and used it to output to an .MPG before I encoded in handbrake. Let me give ffmpeg a try and see if it does a better job. Should I use the encode string that you have in kmttg? It's actually encoding a full length version of the same clip.

    One more question - when you encode using ffmpeg do you prefer to keep source resolution (ie 1080 in my case) or do you downres to 720p? I did the clip in handbrake in 720p and it looked good quality-wise at about 8mbps streaming. I know some folks prefer to use the bits on a smaller file and let the device scale...
     
  12. Oct 4, 2008 #252 of 436
    moyekj

    moyekj Well-Known Member

    12,321
    958
    Jan 23, 2006
    Mission...
    Try using the kmttg tivostream_hd profile (but maybe lower the bitrate a little). I always try and keep the source resolution figuring the more scaling you do the worse you are going to affect quality.
     
  13. Oct 4, 2008 #253 of 436
    cmontyburns

    cmontyburns Excellent. TCF Club

    21,529
    3,220
    Nov 14, 2001
    Houston, TX
    Everything's working nicely on the Mac now. I wrote an AppleScript launcher for tivostream and made an application bundle out of the whole thing, so one click and she's off and running.

    My only remaining issue is that the <topdir> setting starts at the root of my Home directory no matter what I put there.

    /Users/(username)
    /Applications/TiVoStream
    or no entry at all...

    tivostream always starts me at /Users/(username).

    Not a big deal though.

    ETA: Ah. That's because it completely ignores the config.ini file for some reason.
     
  14. Oct 4, 2008 #254 of 436
    moyekj

    moyekj Well-Known Member

    12,321
    958
    Jan 23, 2006
    Mission...
    If it is still ignoring your config.ini then it's because it can't find config.ini in the directory where the application is starting. If it's starting in /Users/(username) then you should put the config.ini file under /Users/(username)/config.ini
     
  15. Oct 4, 2008 #255 of 436
    cmontyburns

    cmontyburns Excellent. TCF Club

    21,529
    3,220
    Nov 14, 2001
    Houston, TX
    Thanks -- yep, I realized that later after I had posted the above. It does work fine with the config.ini in the root of my Home directory. Odd that it doesn't find it in the directory local to the app itself.
     
  16. Oct 4, 2008 #256 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008
    Ok a little more progress here. I did reencode the clip using ffmpeg and it does do a better job on audio/video than handbrake. I used your tivostream profile and it worked great at 8k bitrate and was able to keep ahead of realtime playback. But I am still seeing a stream error and it stops playing after about 14-17 minutes. I encoded a different file using same profile and the same happened. Not sure what is causing that stream error to occur every time like that. I will do a little more investigating.

    fyi - if a file is named ".MP4" (all caps) tivostream ignores it. That had me going for a few minutes. :)

    I also discovered that FFMPEG doesn't like the AC3 file on my .mkv files. It gives an error if I try to do a streamcopy. So I need to reencode. The problem I am seeing is that if I reencode to AC3 then my PC doesn't seem to see the AC3 audio track. But the Tivo plays it fine. Not sure if my Haali media splitter doesn't like AC3. If I encode to AAC it seems to work fine. I was thinking that if I have to reencode audio maybe I should just encode to AAC since it's a little more bitrate efficient. The question I have there is the "-ab" option -- is that a "per channel" setting. And then for AAC, what should it be? I think AC3 is 384-CBR, but with AAC it should suffice to use 192 or thereabouts?
     
  17. Oct 4, 2008 #257 of 436
    Rdian06

    Rdian06 New Member

    463
    0
    Apr 12, 2008
    AC3 inside of MP4 is a relatively new development. It's going to take a while for the various playback programs to catch up.

    I wouldn't re-encode the AC3 to AAC if I were you. The savings in space isn't a bit deal, but you will lose 5.1 surround sound when transferred to the Tivo. Then again if you just care about stereo or your sources are all stereo, the point it moot.
     
  18. Oct 4, 2008 #258 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008
    ah, ok. I wasn't sure if Tivo supported 6 channel AAC but i guess not. Then AC-3 it is. I will just have to figure out how to get my PCs to realize that it's ok to have AC3 with mp4.

    Still having an issue with tivostream (or the tivo) dropping while streaming. it goes along fine for about 18-19 minutes now and then gives a "connection reset by peer: socket write error". This is from a downloaded tivo mpg stream, edited in videoredo and then converted to mp4 with this:

    FFMPEG -y -i INFILE.mpg -vcodec libx264 -coder 0 -level 41 -sameq -g 300 -bufsize 14745k -b 8000k -maxrate 10000k -bug "+autodetect+ms" -me_method epzs -threads 4 -trellis 2 -mbd 1 -copyts -acodec copy -f mp4 OUTFILE.mp4

    I've tried a couple different videos in the same fashion - starts as a tivo downloaded (HD 1080) program. streams for more than 15min and then chokes. :(

    I have been using svn15216 of ffmpeg. Which leads me to another question. On Tripps website he calls that version "buggy x264". Does that mean anything? Also he has a version 15394 posted -- Is that something worth using?

    thx.
     
  19. Oct 5, 2008 #259 of 436
    moyekj

    moyekj Well-Known Member

    12,321
    958
    Jan 23, 2006
    Mission...
    While encoding do you see any unusual messages from ffmpeg around the 15 min mark or so? Are you able to transfer the decoded 1080i mpeg2 back to your Tivo (using pyTivo or Tivo Desktop) without issue? Did you run the mpeg2 stream through VRD QS Fix before editing & encoding?
     
  20. Oct 6, 2008 #260 of 436
    Ely105

    Ely105 New Member

    25
    0
    Sep 7, 2008
    I did see some "underflow" messages from ffmpeg, although i wasn't able to notice where in the stream they showed up.

    I did run it back through VRD quick fix after editing, and i got the stream to play to within 15 seconds of the end. Is it better to do a quickfix before editing?

    I haven't tried the mpg file back to the tivo yet - My wife is getting sick of this episode of Seinfeld.

    I did the same workflow for another program and it worked fine for the whole stream.
     

Share This Page

spam firewall

Advertisements