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 21, 2009 #41 of 3401
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    And just like that I can reproduce the problem ;-) I think I said in an earlier post that streambaby would probably have problems with libavformat-52 and libavcodec-51 (either both 51, or both 52 is what I count on). Of course this is not the case with ubuntu 8.10. There is also another small issue in that the aac gets reports as "mpeg4aac" which streambaby doesn't recognize. (it recognizes aac and mp4a as synonyms for aac)

    Not sure how long it will take to fix, but seeing as I currently can't run streambaby on my own computer, you can imagine I'll be working on it...

    As far as the suggestion about recommending various versions of ffmpeg, I'm not sure how easy that would on Linux. As far as I understand FFmpeg doesn't really have releases (just subversion dates/tags) so specifying particular revisions is difficult, as almost every distribution is going to have a different rev.

    But right now I need to figure out why firefox-3 hangs after my upgrade to 8.10 whenever I go to almost any web pages now. (I had to switch to firefox-2 to post this)

    Keary
     
  2. Jan 21, 2009 #42 of 3401
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    This is correct-- The other alternative would be to write my own C wrapper, exposing the functions I need, that statically links with FFmpeg, and then use JNA/JNI to call my own C language wrapper.

    I'd rather stay away from this as I would need to compile win32, linux32, linux64, and mac versions of the wrapper for distribution.

    I think after the initial flurry of problems are taken care of streambaby should work with most ffmpeg versions. My one concern at this point from what people have reported is that ffmpeg is not consistent in how it reports codec names. (mp4a, aac, mpeg4aac for instance all seem to be synonyms for aac, and liba52 and ac3 are synonyms for ac3). I'll have to see if there is a better way for me to handle this. (There may be better ways for me to check the codec...)
     
  3. Jan 21, 2009 #43 of 3401
    milkrun

    milkrun Milk Run

    10
    0
    Jul 2, 2004
    Menlo Park, CA
    pyTivoX is great, thank you for this tool.

    Please make a StreamBabyX for us Mac idiots that need extra hand holding.

    Thanks again.
     
  4. Jan 21, 2009 #44 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Hmm.. *IF* you're ok with trying out beta-level software, go to the pytivox download page at http://code.google.com/p/pytivox/downloads/list and download the latest beta (1.1b2). This has the 0.17 streambaby in there, and you can choose to use pytivo, streambaby, or both. Keep in mind you can only stream to a tivo 3 / HD.

    Tell me if things seem broken (I'll try and figure out if it's a bug in pytivox or streambaby, and if so, forward it up the chain).
     
  5. Jan 21, 2009 #45 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Ah I should have mentioned: After hacking it to compile under 10.5 (patches above), putting ffmpeg and the shared libs, and hacking pyTivoX to auto-generate the correct streambaby.ini file, it looks like everything is working really smoothly so far.

    So great job! And thank you to EVERYONE who figured out how to stream too...!!
     
  6. Jan 21, 2009 #46 of 3401
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    I'm not having a problem with streambaby on Ubtuntu 8.10, but I'm running 32-bit with my own compiled ffmpeg that I use with pyTivo.

    Code:
    FFmpeg version SVN-r15665, Copyright (c) 2000-2008 Fabrice Bellard, et al.
      configuration: --prefix=/usr --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --disable-ffplay --disable-ffserver --enable-libxvid
      libavutil     49.12. 0 / 49.12. 0
      libavcodec    52. 0. 0 / 52. 0. 0
      libavformat   52.22. 1 / 52.22. 1
      libavdevice   52. 1. 0 / 52. 1. 0
      libpostproc   51. 2. 0 / 51. 2. 0
      built on Oct 22 2008 12:21:33, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
    
    Ah, and I see I have 52 for both, which is why it's working ...
     
  7. Jan 21, 2009 #47 of 3401
    jtkohl

    jtkohl New Member

    170
    0
    Feb 6, 2004
    Arlington,...
    Everything I've read says that Java 6 for OSX only runs on 64-bit intel hardware. It is not supported or available for OSX on 32-bit Intel hardware or PPC hardware.

    Too bad, that cuts out a bunch of people from being able to use Java-6 dependent applications :mad:
     
  8. Jan 21, 2009 #48 of 3401
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    I just put a new version 0.18 up:
    http://code.google.com/p/streambaby/

    This version should fix most of the issues talked about so far in this thread (I believe, hopefully I didn't miss anything).
    It should work well now on Ubuntu 8.10 and other installations with libavformat=52 and libavcodec=51.

    Good luck!

    Here is the changelist:

    ===V0.18===
    * Patched to compile under JDK1.5, and marked as JDK1.5 compatible
    * Added ability to gather video information (length/type/etc) without ffmpeg, enabling running without ffmpeg installed (but minus some features)
    * Ignore files/directories that begin with a dot (.)
    * Added liba52 as synonym for AC3, mpeg4aac as synonym for AAC in ffmpegexe module
    * Added hints for the list, so you can visually see if there are more entries than fit on the screen
    * Advance key moves back and from bottom to top of list in selection view
    * Fixed issue with ffmpeg native integration where libavcodec was V51, and libavformat was V52 (used to assume major versions would be equal)
    * NOTE: FFmpeg revisions `r10939-r11109` (Nov 7 2007 - Nov 28 2007) will not work, and will also not report any errors.
    * Implement new codec detection code for ffmpegjava video module, should have less problems detecting which codecs are in use.
     
  9. Jan 21, 2009 #49 of 3401
    windracer

    windracer joined the 10k club

    11,580
    3
    Jan 3, 2003
    St. Pete, FL
    Works great, thanks for that! :up:
     
  10. Jan 21, 2009 #50 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Ok, just uploaded a new beta pyTivoX with the new streambaby0.18

    (fwiw, I'm generally using the svn/git versions of most of the tools.. should I be worried about incompatibilities -- or is this just for old things?)
     
  11. Jan 21, 2009 #51 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    I just noticed this posting.. oops I should have caught it earlier. No, 1.6 does not ship by default. You have to install it via the Apple Developer Connection. However, even/when you do, the way to select it is not via soft links.
    You should open up Applications/Utilities/Java/Java Preferences

    and create a sorted ordering of what you want for browsers and for commandline invocations... Keep in mind that selecting a 64-bit applet java and then running a 32-bit browser will give you NO-END of problems.
     
  12. Jan 21, 2009 #52 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Yeah it seems to be their plan so far to bail on old computers... weird..
    btw.. on a completely unrelated note.. are you the same jtkohl from mit.edu?
     
  13. Jan 21, 2009 #53 of 3401
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    I'm sure at some point a new version of ffmpeg will break streambaby ;-)
    Definitely when they change the major version of one of the libraries. (avcodec/avformat/avutil/swscale)

    There may be other things that pop up with newer versions of ffmpeg, but hopefully they will be infrequent. I'm sure I won't be able to keep ahead of them, but I can probably keep just behind.
     
  14. Jan 21, 2009 #54 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Ok.. I'll give people a few days to find bugs and then I'll push out the next release of pyTivoX. (yay auto-update)
     
  15. Jan 21, 2009 #55 of 3401
    Sicklybutsexy

    Sicklybutsexy New Member

    179
    0
    May 5, 2007
    Hats off. Great program. I'm having trouble transcoding mkv files that are all avc format and DTS audio. Anyone know how to do this?
     
  16. Jan 21, 2009 #56 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Possible bug? I have a very short clip that's h.264 at 15 fps 320x480
    ffmpeg -i reports:

    Code:
    YoavLaptopWired:~ yoav$ /Applications/pyTivoX.app/Contents/Resources/ffmpeg -i /Users/yoav/Desktop/tivo/Toby.mp4
    FFmpeg version SVN-r16536, Copyright (c) 2000-2009 Fabrice Bellard, et al.
      configuration: --arch=i386 --disable-vhook --disable-shared --enable-static --enable-pthreads --disable-mmx --enable-gpl --enable-libmp3lame --enable-libfaac --enable-libfaad --enable-libx264 --enable-swscale --extra-cflags=-I/Users/yoav/src/lame/include -I/Users/yoav/src/faad2/include -I/Users/yoav/src/faac/include -I/Users/yoav/src/x264 --extra-ldflags=-L/Users/yoav/src/lame/libmp3lame/.libs -L/Users/yoav/src/faad2/libfaad/.libs -L/Users/yoav/src/faac/libfaac/.libs -L/Users/yoav/src/x264/
      libavutil     49.12. 0 / 49.12. 0
      libavcodec    52.10. 0 / 52.10. 0
      libavformat   52.23. 1 / 52.23. 1
      libavdevice   52. 1. 0 / 52. 1. 0
      libswscale     0. 6. 1 /  0. 6. 1
      built on Jan 21 2009 14:36:57, gcc: 4.0.1 (Apple Inc. build 5484)
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/yoav/Desktop/tivo/Toby.mp4':
      Duration: 00:00:18.91, start: 0.000000, bitrate: 654 kb/s
        Stream #0.0(eng): Audio: aac, 32000 Hz, stereo, s16
        Stream #0.1(eng): Video: h264, yuv420p, 320x240, 14.98 tb(r)
    
    When I try to view it, I get an Error:0xffff, and see the following in the log:
    Code:
     01/21/09 19:17:14 FFmpegExeVideoModule: FFmpegCmd: /Applications/pyTivoX.app/Contents/Resources/ffmpeg -i /Users/yoav/Desktop/tivo/Toby.mp4
    01/21/09 19:17:14 FFmpegExeVideoModule: VideoInfo:
    uri: file:/Users/yoav/Desktop/tivo/Toby.mp4, Container: mp4, Duration: 18.91 seconds
    Video: h264 320x240 0.0 fps
      PixAspect: 1.0, Aspect: 1.3333334
    Audio: aac 32000HZ 0 channels
    01/21/09 19:17:14 HostContext: key=mpos:file:/Users/yoav/Desktop/tivo/Toby.mp4 applicationId=com.unwiredappeal.tivo.streambaby.StreamBabyStream applicationGlobal=false
    ........
    
    (note it is reporting it as 0 fps? is that the problem?)
    and then
    Code:
    01/21/09 19:17:16 NamedStream: Registering named stream: 69dda6ca-dda1-4a88-9c54-f594414f98df.stream
    01/21/09 19:17:17 ZipGeneratingPreview$GenThread: Finished generating preview: /tmp/pyTivoCache/Toby.mp4-1546253.pvw
    01/21/09 19:17:17 Listener: http=HttpRequest /streambaby/69dda6ca-dda1-4a88-9c54-f594414f98df.stream
    01/21/09 19:17:17 Listener: path=/streambaby/69dda6ca-dda1-4a88-9c54-f594414f98df.stream uri=/streambaby/
    01/21/09 19:17:17 Listener: 
    01/21/09 19:17:17 Listener: 192.168.0.34 69dda6ca-dda1-4a88-9c54-f594414f98df.stream HTTP GET - to factory /streambaby/
    01/21/09 19:17:17 StreamBabyStream$StreamBabyStreamFactory: uri=69dda6ca-dda1-4a88-9c54-f594414f98df.stream
    01/21/09 19:17:17 NamedStream: Getting mapped stream for named stream: 69dda6ca-dda1-4a88-9c54-f594414f98df.stream
    01/21/09 19:17:18 NamedStream: DeRegistering named stream: 69dda6ca-dda1-4a88-9c54-f594414f98df.stream
    01/21/09 19:17:18 Listener: 
    01/21/09 19:17:18 Listener: 192.168.0.34 I/O Exception handling  HTTP GET 69dda6ca-dda1-4a88-9c54-f594414f98df.stream: Broken pipe
    01/21/09 19:17:18 Listener: ctx=HttpRequest /streambaby/69dda6ca-dda1-4a88-9c54-f594414f98df.stream t=java.net.SocketException: Connection reset
    01/21/09 19:17:20 ViewScreen: error=ERROR: 0xffff
    Toby.mp4
    
    (only cut the parts I thought might be useful.. I'll attach the full log here
     

    Attached Files:

  17. Jan 21, 2009 #57 of 3401
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    Even though I should probably fix the parsing, that' probably not the issue. Streambaby only uses the container, codecs, width/height and aspect information. The rest (fps/audio channels/bitrates) for completeness but it doesn't currently get looked at. So fps=0, channels=0 won't make a difference.

    Having said that, I'm not sure what the issue is. I have noticed occasionally the TiVo will get into a state when it doesn't feel like streaming anything at all and just returns 0xffff. (It's usually pretty easy to see when it get's into this state, because none of the streams will play). Giving the tivo a 30 minute "rest" usually makes it happy again.

    If that's not the case and it is just this particular video (which is quite possible), and you are willing to upload it to me, I'll try to set somewhere up to collect videos that are problematic.

    One other issue however that I noticed looking through the log file-- It looks like the native ffmpeg-java integration is not succesfully loaded. You should see a line like:
    01/21/09 19:16:33 FFmpegJavaVideoModule: FFmpeg-JavaModule: Loaded
    followed by the path's of the libavxxx files that were loaded, somewhere in the beginning of the log. (Somewhere before the line FFmpegExeVideoModule: FFMpegExeModule Loaded)

    Everything will work like this, but you won't have real-time preview. Streambaby will be required to generate cached files before it is able to display the thumbnails during FF/rewind. (So if you are watching a video for the first time, it may take 5-10 minutes before thumbnails for the entire movie is generated. The next time, since it is cached, it will be immediate.)

    It's quite conceivable that I need to do some special work to handle the OSX shared libraries. Looking at my code and the JNA code I think it is going to be looking for libraries with names like: libavcodec.dylib
    If this is not the case (for instance there is some kind of version information in there somewhere like libavcodec-52.dylb), that could be the problem. Could you let me know what the libavxxxx and libswscale filenames look like? (And I am assuming they are in the native directory)

    Thanks
    Keary
     
  18. Jan 22, 2009 #58 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    Ok, well the problem seems to only happen with that movie so far.. I'll try it again in a while and see if it improves.

    It was giving me 'correct previews' as I fast forwarded beyond the downloaded things (it would print a timestamp on top of a VERY low-quality jpeg). This is almost immediately after running, so I don't think it would have had time to pre-generate all the images. but there are no ffmpegjava lines in the log

    To answer the specific question, shared libs on mac are generally named something like
    libyourmama.32.dylib
    with a symlink from libyourmama.dylib

    I configured streambaby.ini with
    Code:
    ffmpeg.path=/Applications/pyTivoX.app/Contents/Resources/ffmpeg
    ffmpegjava.avutil=/Applications/pyTivoX.app/Contents/Resources/libavutil.dylib
    ffmpegjava.avcodec=/Applications/pyTivoX.app/Contents/Resources/libavcodec.dylib
    ffmpegjava.avformat=/Applications/pyTivoX.app/Contents/Resources/libavformat.dylib
    ffmpegjava.swscale=/Applications/pyTivoX.app/Contents/Resources/libswscale.dylib
    
    (each of those are correct values for existing files).

    *however* depending on how the loader works, a mac might be 'more confusing' than normal, since libraries and applications are actually multi-platformed (each of those shared libs actually has files that will run on i386 macs and ppc macs). I believe 'dlopen' and friends 'do the right thing', but I don't know how ffmpeg-java tries to load those libraries...

    note: I looked at the FFmpegJavaVideoModule.java class file, and it looks like it's either supposed to print that it loaded or that it didn't load. I don't see either printout, so I'm thinking maybe I don't have logging turned on right?
     
  19. Jan 22, 2009 #59 of 3401
    kearygriffin

    kearygriffin New Member

    346
    0
    Jan 31, 2008
    I was thinking the same thing when I initially looked at your log file, but then I took a better look at FFmpegJavaVideoModule and realized that if it can't load the library in the function getVideoModule() then initialize() will never end up being called and there will be no debug output about the failure. I actually changed this in my code for the next version.

    I can also see in the log you sent the following line:
    Code:
    01/21/09 19:17:17 ZipGeneratingPreview$GenThread: Finished generating preview: /tmp/pyTivoCache/Toby.mp4-1546253.pvw
    which you will only see if it is using cached thumbnails.

    While testing the ffmpeg-java stuff, the easiest thing to do is to delete everything out of the cache directory (looks like /tmp/pyTivoCache in your case) and add the following line to streambaby.ini to tell it not to generate cached files:
    preview.autogenerate=false

    My guess is the low-quality jpegs will disappear and you'll just see the time over a black/grey background (can't remember which).

    I think one thing you might try is removing the ffmpegjava.avutil=, ffmpegjava.avcodec=, etc lines from the streambaby.ini and adding the line:
    lib.native=/Applications/pyTivoX.app/Contents/Resources/

    I think in general that is probably the right way to go, with lib.native pointing to a directory and the other parameters referencing files within it. I'm not sure how well full paths work for the ffmpegjava.avxxxx parameters work. If it doesn't work with default values for ffmpegjava.avxxxx we can then try different formats for those. (but still just a relative filename based off of lib.native). But I do think the default for those should work. (For instance the default for libavcodec is "avcodec" which then get's passed to System.mapLibraryName which should return "libavcodec.jnilib", and when I looked at the JNA code, it will then try both libavcodec.jnilib and strip the extension and add .dylib to try libavcodec.dylib)

    ffmpeg.path= looks good in your current configuration, as a full path there is a good thing. (and it is obviously finding it OK)

    Sorry for the long winded (and technical) posts. I don't have access to any OSX systems, so if it's going to get working as well as possible on a Mac, this is the only way I can think of going about it... Getting out as much info as possible and hoping someone can get it going.

    EDIT: I did just look again and if I read the jna code correctly, full paths should work also, so I am not that confident what I mention above will work.
     
  20. Jan 22, 2009 #60 of 3401
    Yoav

    Yoav New Member

    1,048
    0
    Jan 12, 2007
    I tried using the lib.native instead, still the same issue.
    Looks like macOS is now using dtrace instead of truss, and I'm having trouble tracking what dynamic libs it is trying to open... but so far it doesn't seem to be trying to open any file with a name that has *avutil* in it (unless I'm mis-invoking dtrace).

    I'll see what I can find... it's gonna be a while..

    edit: Ok I'm starting to get burned out here. I tried putting the libraries in /usr/local/lib, tried using the DYLD_* variables to force locations, etc. It really feels like the app is not even trying to load the libraries...
    I'll try some more tomorrow. At worst I'll drop the shared libs from the distribution and just let it run with the ffmpegexe module....
     

Share This Page