1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Streambaby - new streaming application

Discussion in 'TiVo Home Media Features & TiVoToGo' started by kearygriffin, Jan 20, 2009.

  1. Jan 20, 2009 #1 of 3410
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    I wanted to let everyone know about a new streaming video application, StreamBaby:

    you can find it at:
    http://code.google.com/p/streambaby/

    It is originally based off of tivostream, and has the following main features:

    * Random access streaming of video files. Able to seek to anywhere in the video. Also removes need for qt-faststart.
    * Attempts to work around the 1.1G limit for streaming videos on the TiVo. If you reach the 1.1G limit, the video you are watching will be paused and restarted with a fresh buffer at the position you were in before.
    * Ability to FF/RWD to points in the video that have not been buffered yet. When outside of the buffer, a "preview" of the movie (low-quality static images) will appear, and when play is pressed the video stream will be repositioned to start streaming at that point (ala Netflix/TiVo)
    * Realtime preview generation for most file formats. Others (mpeg in particular) use autogenerated thumbnail files.
    * Ability to transcode and stream video that is not inherently TiVo compatible. Supports most wmv, avi, and mkv. Preview mode and random-positioning work with most transcoded files.
    * Remembers your position in the video when you stop watching and automatically starts at that position next time you watch. Works even when exiting playing via the "TiVo" button.

    Please let me know what you think, or if you have any bugs/suggestions, etc.

    Also I just wanted to make sure I thanked moyekj here for his work on tivostream, as well as his efforts in testing/debugging/code suggestions on Streambaby. Thanks! Thanks also to Steve C who also helped with suggestions and testing. Their efforts have hopefully helped make Streambaby a better application.

    (Apologies for the repost, it was mentioned this may be a better forum for the thread)

    Keary
     
  2. Jan 20, 2009 #2 of 3410
    moyekj

    moyekj Well-Known Member

    11,142
    31
    Jan 23, 2006
    Mission...
    Here's a direct link: streambaby
    (Keary, you may be able to add a link in your signature already though I'm not sure if that will work yet either)

    For any of you who are using video streaming application or tried one before and wasn't happy with it this is a must try. Keary did an excellent job adding new features, especially the random access anywhere in a video (even for mpeg4) and the workaround for the 1.1GB limit - stream is automatically restarted at the point where buffer ends while you are playing. The preview method ala Tivo/Netflix implementation is also a very cool feature not to mention the transcoding of non-compatible videos with ffmpeg similar to how it's done in pyTivo.

    Great job Keary!
     
  3. Jan 20, 2009 #3 of 3410
    westside_guy

    westside_guy Annoyingly ephemeral

    464
    1
    Mar 13, 2005
    The soggy...
    Hi,

    First, thanks for working on this! It's great that we have so many talented people willing to work on these projects, and sharing their work with us.

    Second... I ran into a problem. :D On Mac OS X 10.5.6, I get an error when I try to run streambaby.

    Code:
    $ ./streambaby
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
    
    Am I overlooking something obvious?
     
  4. Jan 20, 2009 #4 of 3410
    moyekj

    moyekj Well-Known Member

    11,142
    31
    Jan 23, 2006
    Mission...
    westside_guy what version of Java Runtime Environment are you using? (java -version will tell you).
    My guess is streambaby was compiled with java 1.6 and you are on an earlier version such as 1.5...

    Keary, if it's possible you may want to re-compile with 1.5 to make it compatible for those using Macs as it seems they are a little behind on the java front.
    (Then again there may be some code which is not 1.5 compatible so may not be possible).
     
  5. Jan 20, 2009 #5 of 3410
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Got it working standalone on my Ubuntu 8.10 server ... now to get it working through Galleon.

    Nice work! I like your icons. :) That preview feature during FF/RW is really slick.
     
  6. Jan 20, 2009 #6 of 3410
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    westside_guy--

    Streambaby was indeed compiled using JDK1.6 and is set to require it. I haven't looked at support JDK1.5, but I will take a look in the next version to see if it is easy to do. (It may just be a compile time setting and I'm all set)

    Also, you may be (probably are) the first person to give this a try on a Mac, so if you do get JDK1.6 installed and Streambaby running, I'd be very interested to hear how well (or not at all...) it works.

    Keary
     
  7. Jan 20, 2009 #7 of 3410
    westside_guy

    westside_guy Annoyingly ephemeral

    464
    1
    Mar 13, 2005
    The soggy...
    OS X has Java as part of its base install - and it's indeed at version 1.5 (1.5.0_16). I'll check to see how much of a pain it is to install 1.6...

    Thanks guys.

    Addendum: This is weird - OS X 10.5 actually has java 1.6; it's just not the default. I had to set it up as the default via a soft link, but now things launch just fine.

    I'll report back once I've had a chance to run it through its paces on OS X.
     
  8. Jan 20, 2009 #8 of 3410
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Yay!

    I'm installing Apple's (soon to be official?) version of 1.6. I'll tell you how it works out. But if you can get it to just work on 1.5, you'll make a lot of mac users happy. Java ships with the base OS, but the version it ships with is 1.5. Most of the 1.6 ports rely on X11 or other things.

    What I'm saying is since we mac users like the "install and run" option, a lot of people simply won't even try the app if it requires a bunch of external installs first...

    The good news: It (seems to) run fine with java 1.6 on a mac. So far it seems to be working perfectly with the videos I've tried.. yay.

    If it can be made to work under 1.5, would you mind it I include it as a streamer option for pyTivoX (thereby rendering the program name misleading -- oh well). That way people can configure it with a gui, and install it with one click...?
     
  9. Jan 20, 2009 #9 of 3410
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Ok, quick and dirty instructions for running streambaby though Galleon.

    Note: on my Linux server (Ubuntu), Galleon is installed under /usr/share/galleon. Substitute your own path where necessary.

    1. extract streambaby under Galleon's hme folder (ex. /usr/share/galleon/hme/streambaby)
    2. add the following line to your streambaby.ini file:
      • streambaby.dir=/usr/share/galleon/hme/streambaby
    3. add the following line to launcher.txt in the hme directory:
      • com.unwiredappeal.tivo.streambaby.StreamBabyStream
    4. add the following line to wrapper.conf in the conf directory (be sure to use the next sequential classpath number (5 in my example below)):
      • wrapper.java.classpath.5=/usr/share/galleon/hme/streambaby/jbin/*.jar
    Now start up Galleon! In log.txt you should see the app being published:

    Code:
    03:04:30,319  INFO [WrapperListener_start_runner] AppHost - MDNS: http://192.168.1.65:7288/streambaby/
    And it should appear on the Music, Photos, & Showcases menu. Log events will be written to log.txt and wrapper.log.

    Stream, baby, stream! :cool:

    edit: just wanted to point out that in streambaby versions newer than v0.25 (when the MP4 splitting code changed) I ran into problems running it under Galleon. Using high bitrate streams would result in 0xffffff errors. As of November 2010, I no longer run streambaby under Galleon, but standalone, as the author intended. YMMV, however, depending on how your videos are encoded.
     
  10. Jan 20, 2009 #10 of 3410
    westside_guy

    westside_guy Annoyingly ephemeral

    464
    1
    Mar 13, 2005
    The soggy...
    Hey, another potential issue. When I tried streaming some reasonably high quality h.264 mp4 and m4v files - which in tivostream would transfer at roughly 3x faster than needed to play in "real time" - they'd pause occasionally because the buffer couldn't load faster than the stream would be playing. I'm wondering if streambaby is (unnecessarily) transcoding this back to mpeg2 or something similar? Any way to tell?

    The reason I'm asking about transcoding is this is exactly the behavior I see when I use pyTivo to transfer one of these files - and pyTivo is of course converting the file to mpeg2 on the fly.
     
  11. Jan 20, 2009 #11 of 3410
    fred2

    fred2 New Member

    509
    0
    Jan 20, 2006
    I am not an expert at these things. But I don't believe it is working for me. Is this a standalone application or does it need Galleon or pytivo? I extracted the zip to c:\program files\tivostreambaby. Then clicked on the bat file. Something happened quickly (ffmeg install???). Clicked on the bat again but nothing.

    It did not leave a window open. Win Vista Home Premium. Since I was at a dos prompt to use 'streambaby --help" I just ran the bat file and got the following message(s):

    "c:\PROGRA~1\TIVOST~1>streambaby
    Initializing...
    java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at com.tivo.hme.host.http.server.HttpServer$PortInterface.<init>(HttpSer
    ver.java:204)
    at com.tivo.hme.host.http.server.HttpServer$Port.<init>(HttpServer.java:
    169)
    at com.tivo.hme.host.http.server.HttpServer.start(HttpServer.java:79)
    at com.unwiredappeal.tivo.streambaby.host.Listener.<init>(Listener.java:
    102)
    at com.unwiredappeal.tivo.streambaby.host.Main.<init>(Main.java:133)
    at com.unwiredappeal.tivo.streambaby.StreamBabyMain.main(StreamBabyMain.
    java:140)
    error: Address already in use: JVM_Bind
    usage: Main [--port <port>] [--ip <ip>] class
    "

    Any assistance appreciated.
     
  12. Jan 20, 2009 #12 of 3410
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    It looks like you're already running something that is using that address/port combination. Check to make sure you have no other streamer running?
     
  13. Jan 20, 2009 #13 of 3410
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    More on 1.5:
    So, I looked into compiling it under 1.5
    I am getting a CRAPLOT of errors because there are methods specified with the @Override tag, but which are not actually overriding anything. If I manually remove the @Override, then it compiles, but I don't know what effect that will have on the 1.6 builds (do you HAVE to tell it you are overriding? or can it intelligently realize that and move along?)

    example:
    Code:
        [javac] /Users/yoav/Desktop/streambaby-0.17/main/src/com/unwiredappeal/tivo/streambaby/tests/SimpleTest.java:5: method does not override a method from its superclass
        [javac] 	@Override
        [javac]          ^
        [javac] /Users/yoav/Desktop/streambaby-0.17/main/src/com/unwiredappeal/tivo/utils/Log.java:108: method does not override a method from its superclass
        [javac] 		@Override
        [javac]                  ^
      
     
  14. Jan 20, 2009 #14 of 3410
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    fred2-- The issue you are having looks like you streambaby is trying to use the same HME port as another application.
    To change the port streambaby uses, edit the streambaby.ini file and the change the line
    port=7288
    to use another port. So port=7289 for instance.

    JDK1.5: I've made the changes necessary on my end to work with JDK1.5, and will upload a new version probably tomorrow night.
    The problem with the @Overrides is 1.6 allows a @Override (and in fact eclipse automatically generates them) for interfaces, where 1.5 only allows them for classes.
    I've also made a couple of other changes that may help Mac users who may not have ffmpeg installed. (So at least it will stream mp4/mpeg files without the preview mode)

    westside_guy:
    The easiest way to see if it transcoding is to turn off transcoding by editing the streambaby.ini file and adding the line
    transcode.disable=true
    and restart streambaby. This should disable all transcoding (so if it doesn't think it can stream the file, you will get an error instead of it getting trasncoding)

    If transcoding doesn't seem to be the reason for the speed issue, I'd be curious to see what happens if you add the following line to streambaby.ini
    mp4module.interleave=false
    and restart streambaby. This may (probably will?) cause issues with random-positioning inside of MP4 files, but if it fixes the speed issue, it lets me know where to look to fix it.
    (So when you use this option, make sure you select "Play from beginning", because seeking to where you left off may not work)

    Thanks for the feedback, and hopefully we can get most of the issues sorted out.

    Keary
     
  15. Jan 21, 2009 #15 of 3410
    westside_guy

    westside_guy Annoyingly ephemeral

    464
    1
    Mar 13, 2005
    The soggy...
    Yup, streambaby is transcoding the files. When I disable transcoding per your instruction, streambaby reports "incompatible video stream" when I try to play one of my h.264/ac3 files (encoded with handbrake). FWIW I see the same error whether I use an .m4v extension or an .mp4 extension.

    I turned off streambaby, and started tivostream to double-check - these files stream to the tivo and play just fine.
     
  16. Jan 21, 2009 #16 of 3410
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Ok, hoping to make your life easier, so attaching two files

    The first file is a patch that will fix everything EXCEPT the @Override to be compatible with 1.5 (there were a few uses of String.isEmpty, and ermm.. pop, and some other 1.6 stuff that can easily be replaced with 1.5 stuff...)

    The second is a full diff that has all the Overrides removed, as well as the changes in the first diff. I don't know if using it keeps the code 1.6 compatible though.... So try it in a trashable location :)
     

    Attached Files:

  17. Jan 21, 2009 #17 of 3410
    moyekj

    moyekj Well-Known Member

    11,142
    31
    Jan 23, 2006
    Mission...
    That's odd. In my test area I have a few h.264/ac3 files with .mp4 extension that play fine through streambaby with transcode disabled. These were generated with ffmpeg though, not handbrake. I'll have to generate a short clip with handbrake to try out with streambaby. Could be that handbrake encoding is identifying streams a little differently than expected in streambaby though I can't explain why when transcode is disabled that it's still failing in streambaby but working in tivostream... Hopefully it's a simple mime header related issue.

    EDIT: Just generated a quick handbrake encoding with H.264 & AC3 and then ran it through qt-faststart and I was able to stream both with tivostream & streambaby (with transcoding disabled). Here's the mediainfo dump of the encoding:
    (P.S. ffmpeg encoding of the same is much better/smoother compared to Handbrake and I can preserve full 6 channel AC3 audio)
    Code:
    General
    Complete name                    : C:\home\dvd\lost_qt.mp4
    Format                           : MPEG-4
    Format profile                   : Base Media / Version 2
    Codec ID                         : mp42
    File size                        : 8.36 MiB
    Duration                         : 29s 996ms
    Overall bit rate                 : 2339 Kbps
    Encoded date                     : UTC 2009-01-21 06:00:18
    Tagged date                      : UTC 2009-01-21 06:03:30
    Writing application              : HandBrake 0.9.3 2008112300
    
    Video
    Format                           : AVC
    Format/Info                      : Advanced Video Codec
    Format profile                   : Main@L4.0
    Format settings, CABAC           : Yes
    Format settings, ReFrames        : 3 frames
    Codec ID                         : avc1
    Duration                         : 29s 996ms
    Bit rate mode                    : Variable
    Bit rate                         : 1946 Kbps
    Nominal bit rate                 : 2000 Kbps
    Width                            : 1276 pixels
    Height                           : 716 pixels
    Display aspect ratio             : 16/9
    Frame rate mode                  : Variable
    Frame rate                       : 59.875 fps
    Minimum frame rate               : 29.963 fps
    Maximum frame rate               : 60.000 fps
    Original frame rate              : 59.940 fps
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.036
    Stream size                      : 6.96 MiB (83&#37;)
    Writing library                  : x264 core 65
    Encoding settings                : cabac=1 / ref=2 / deblock=1:-2:-1 / analyse=0x1:0x131 / me=umh / subme=9 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=600 / keyint_min=60 / scenecut=40(pre) / rc=abr / bitrate=2000 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
    Encoded date                     : UTC 2009-01-21 06:00:18
    Tagged date                      : UTC 2009-01-21 06:03:30
    
    Audio
    Format                           : ac-3
    Codec ID                         : ac-3
    Duration                         : 29s 984ms
    Bit rate mode                    : Constant
    Bit rate                         : 384 Kbps
    Channel(s)                       : 2 channels
    Sampling rate                    : 48.0 KHz
    Resolution                       : 16 bits
    Stream size                      : 1.37 MiB (16%)
    Encoded date                     : UTC 2009-01-21 06:00:18
    Tagged date                      : UTC 2009-01-21 06:03:24
    
     
  18. Jan 21, 2009 #18 of 3410
    fred2

    fred2 New Member

    509
    0
    Jan 20, 2006
    Ah, like pyTivo???? :eek:

    Can I run them both or can I reasonably change the PORT address??

    I can stop the pytivo service I guess to give this one a go....

    Ah, more answers came. I will give this shot in the A.M.

    Thanks
     
  19. Jan 21, 2009 #19 of 3410
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    It sounds like maybe streambaby is not parsing the correct video information from ffmpeg, so thinks it needs to transcode it. This is a Mac correct? It's possible the output of the mac version of ffmpeg is slightly different than I expect. If you could do the following it should shed some more light.

    Edit simplelog.properties and change the first line to read:
    com.unwiredappeal=debug

    Then restart streambaby, browse to one of the mp4's that is giving you problems and try to play it. (Assuming you have transcode still turned off, it should give an error. that's OK). If you then quit streambaby and look in the streambaby.log file you should find a section that looks something like this:
    01/21/09 24:29:24 FFmpegExeVideoModule: VideoInfo:
    uri: file:/home/keary/videos/myfile.mp4, Container: mp4, Duration: 6136.13 seconds
    Video: h264 848x352 23.976023976023978 fps
    PixAspect: 1.0, Aspect: 2.409091
    Audio: aac 48000HZ 2 channels

    If you could let me know what the VideoInfo it is spitting out that would be great. If you could also let me know what
    ffmpeg -i myfile.mp4
    spits out, that would probably help also.

    Here is a possible workaround for the time being, assuming streambaby is at least seeing that it is an MP4 (but maybe cant figure out the codecs...). Add the following line to streambaby.ini:
    mp4mod.streamformats=mp4,*,*

    This tells streambaby to attempt to stream all MP4 files, regardless of the audio/video codecs.

    Thanks
    Keary
     
  20. Jan 21, 2009 #20 of 3410
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    Sure, that sounds great! It may make sense to hold off for a version or two, especially since today is the first time it is ever being run a Mac. I'm sure there are going to issues to take care of.

    I'm also guessing that streambaby is not going to load (even if they are available) the native ffmpeg libraries (as opposed to running the ffmpeg executable) on the Mac. This means streambaby will not be able to do real-time previewing. It will need to generate cache thumbnail files for the videos instead. (So when ffwding through a video you will not see thumbnails overlaid on the screen representing the position in the video, you will just see a time, until it finishes generating the cached thumbnail file)

    Do you know if the avcodec, avformat, avutil, and swscale libraries for ffmpeg are installed with ffmpeg on the mac? And if so, what are their names?

    Thanks also for the patches, much appreciated!
     

Share This Page