TiVo Community Forum banner
  • TiVoCommunity.com Ambassador Program Now Open! >>> Click Here

Streambaby - new streaming application

1M views 4K replies 481 participants last post by  thewebgal 
#1 ·
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
 
See less See more
#25 ·
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?
I know this was a question for Yoav; but I can tell you their location is going to depend on the method used for installation. People who installed ffmpeg via fink (like I did) will have those libraries in /sw/lib - in fink's case they're currently called:

/sw/lib/libavcodec.51.49.0.dylib
/sw/lib/libavformat.52.2.0.dylib
/sw/lib/libavutil.49.6.0.dylib
/sw/lib/libswscale.0.5.0.dylib

Other folks may have installed via MacPorts, which I believe puts things somewhere under /opt.

And of course if one builds it oneself (blech) it's probably under /usr/local.

Yoav's pyTivoX pre-packages ffmpeg, so he controls where everything ends up in that case...

addendum: I see Yoav answered while I was typing! :p
 
#26 ·
Missing the up/down arrows on the right side of the window that indicate when there's more of the list above or below the current page. (As I look at it now, tivostream doesn't have these either. Both apps should, though.)

I also can't get it to actually play anything -- .mpg and .vob files just sit on a grey screen, everything else (including .mp4) says "Incompatible video stream". No error messages on the console or in the log, except "StreamBabyStream[#1,uri=null] warning: resource 2057 not found.", which appears (twice) on opening the app. This is in Ubuntu 8.10 AMD64, working ffmpeg in /usr/bin/, working tivostream. I tried the OpenJDK first, then Sun Java 6, with no change.
 
#27 ·
First the thanks - changing the port number allowed it to run.

But, I see NOTHING on my Tivo showing it running.

The log is simple:

"01/20/09 21:57:35 Listener: added factory
01/20/09 21:57:35 Main: streambaby ready & listening."

And another question. Probably based on linux origins but should directory/folders be specified with the slash or backslash?

i.e.

#dir.1=D:\Videos
#dir.1.name=Streambaby videos
#dir.2=D:/Videos
#dir.2.name=Stream External Drive

Oh. looking at my INI file I see I have left the comment in for ip address:

# Ip address to bind to
#ip=192.168.1.37

I gather I need to change that to something meaningful (g)

Oh, wait, I guess my DIR statements are also still COMMENTS with the # sign!!!! (yikes, I should know, at least, a little better than that!)

Thanks for any additional assistance.
 
#28 ·
And another question. Probably based on linux origins but should directory/folders be specified with the slash or backslash?
On Windows you can use either way, and as you realized you have to take the leading # comment character away from any setting you want to apply.

Question: After you start streambaby then on your Tivo you are looking under Music, Photos & Showcases for the application right?

To get more debugging info edit simplelog.properties and comment out com.unwiredappeal=Warn and add this one below it:
com.unwiredappeal=Verbose
(Once you are done debugging set it back to Warn)
That generates a lot more messages that are also saved in streambaby.log for each session.

Then when you restart streambaby you should see information about which IP was used and also which port.
 
#29 ·
Actually, NO, I was wrongly looking in the "Now playing list" as I do for pytivo folders. I guess the hme stuff is different.

So I did find Stream, Baby, Stream in Music, Photos. But when I selected an item I got a Please Wait over a gray screen. I will check my firewall and see what's what.

But thanks for the help. Maybe my questions will help others less experienced in this stuff.
 
#30 ·
But when I selected an item I got a Please Wait over a gray screen.
In my experience last night, you get the gray screen/please wait while streambaby is filling up the initial buffer. Then it switches to black for a bit, and then the video starts playing.

It would be cool if we could get an HME app like streambaby to appear in the Now Playing List. It makes more sense, logically, to have it there. I think that's a limitation of HME vs HMO though.
 
#31 ·
In my experience last night, you get the gray screen/please wait while streambaby is filling up the initial buffer. Then it switches to black for a bit, and then the video starts playing.
Also note that it may take longer to do this initial fill, since streambaby may be transcoding the video. So at the moment you can't compare the time it takes for streambaby to start with, say, what it takes for tivostream to start.
 
#32 ·
Gray screen pause was due to firewall, running upstairs to check, I approved the Java.... and I can now hear Harry Potter on the downstairs' TV-tivo.

One more fascinating application.

Thanks for sharing it, author

And thanks for helping me out - others..........
 
#34 ·
Missing the up/down arrows on the right side of the window that indicate when there's more of the list above or below the current page. (As I look at it now, tivostream doesn't have these either. Both apps should, though.)
As windracer indicated in streambaby the left side has vertical arrows indicating if there are list items above/below/both. tivostream I will no longer be updating as this app trumps it by far.
 
#35 ·
The arrows on the left side (nice match for the native menus there, BTW) only indicate if the selection bar can be moved. They don't substitute for the right-side arrows (also found in the native menus, but not in these apps), which tell you if page up/down will be fruitful.

You might miss these in the native menus, because they're a bit understated in the new theme. They used to be more prominent. But they're still there, and still important.

And I can't agree that it trumps tivostreamer, since tivostreamer works for me and this, so far, doesn't. Of course I always thought HME/VLC trumped tivostreamer... can't compare it to this yet. :)
 
#36 ·
Missing the up/down arrows on the right side of the window that indicate when there's more of the list above or below the current page. (As I look at it now, tivostream doesn't have these either. Both apps should, though.)
Yup, your right. I'll add this in the next version. As others have pointed out it does have arrows on the left indicating there are more above/below but I will also add the right side arrows indicating there are more on pages above/below.

Which of course will do you absolutely no good, seeing as...
I also can't get it to actually play anything -- .mpg and .vob files just sit on a grey screen, everything else (including .mp4) says "Incompatible video stream". No error messages on the console or in the log, except "StreamBabyStream[#1,uri=null] warning: resource 2057 not found.", which appears (twice) on opening the app. This is in Ubuntu 8.10 AMD64, working ffmpeg in /usr/bin/, working tivostream. I tried the OpenJDK first, then Sun Java 6, with no change.
My devel is system is ubnutu 8.04 AMD64, but I'm upgrading as we speak to 8.10 to see if it makes a difference. (It's something I have been thinking about doing for a while, and this seems like as good an excuse as any).
Are you running the default ffmpeg that installs with ubuntu or another version you compiled or installed from 3rd party repository? Shouldn't make a difference either way as I have run with a bunch of different ffmpegs.

Probably best thing to do is edit the simplelog.properties and change the first line to read:
com.unwiredappeal=verbose

It may also make sense to disable preview mode temporarily to see if that helps anything. Edit the streambaby.ini file and add
preview.disable=1

And to turn on some extra debugging (specifically ffmpeg's stderr), run streambaby with:
java -Dstreambaby.debug=1 -jar jbin/streambaby.jar
Try to play an mp4 (which I believe you say gives you an incompatible error) and then an mpg/vob. If you could then send me the streambaby.log file that would be great. Not sure what the correct way of getting me a log file is, but e-mail address is my username and I use gmail.com.

Sorry to ask you to jump through all these hoops to help with the debugging, I'm just not sure what is happening yet.
 
#37 ·
... will have those libraries in /sw/lib - in fink's case they're currently called:

/sw/lib/libavcodec.51.49.0.dylib
/sw/lib/libavformat.52.2.0.dylib
/sw/lib/libavutil.49.6.0.dylib
/sw/lib/libswscale.0.5.0.dylib
Hmm.. I actually don't think streambaby is going to like those libraries, as it expects libavcodec and libavformat to be the same version (either both 51, or both 52). Not sure what happens otherwise...

...I can compile the shared libs seperately and put them in the distribution if that will make things 'act nicer'... .
If we could try out compiling the mac native libraries, and seeing if they work, that would be great. If they do I can add them to the main dist. To try it out, compile ffmpeg and the shared libraries and stick them in the native directory of streambaby.

Edit streambaby.ini and set:
ffmpeg.path=native/ffmpeg
preview.autogenerate=false
transcode.disable=true

And also edit simplelog.properties, and change the first line:
com.unwiredappeal=verbose

and then make sure you delete everything in the cache directory.

Then re-run streambaby and try to stream an MP4 file (not an MPG). Because autogenerate is turned off any "thumbnails" you see will be real-time thumbnails and not from a generated cache file. While watching the MP4 try to FF (or sometimes rewind is easier, jump to 30 minutes then start rewinding) to a point outside the buffer. When the preview window pops up it should have thumbnail images of the movie. If it does, then the native libraries are working. If it just has the time the native libraries are not working.

You can also look in streambaby.log, and if the libraries are at least getting loaded you will see something like:
01/21/09 13:54:54 FFmpegJavaVideoModule: FFmpeg-java Module: loaded
01/21/09 13:54:54 FFmpegJavaVideoModule: avUtilPath: /usr/lib64/libavutil.so.1d.49.3.0
01/21/09 13:54:54 FFmpegJavaVideoModule: avFormatPath: /usr/lib64/libavformat.so.1d.51.10.0
01/21/09 13:54:54 FFmpegJavaVideoModule: avCodecPath: /usr/lib64/libavcodec.so.1d.51.38.0
01/21/09 13:54:54 FFmpegJavaVideoModule: swScalePath: /usr/lib64/libswscale.so.1d.0.5.0

If they arent able to be loaded you will see "FFmpeg-java Module: NOT loaded" (or something to that affect)

Keary
 
#38 ·
Keary, one suggestion is to list what versions of ffmpeg you have tested with since especially on non-windows platforms where it picks it up from user path there can be a very wide range of versions in use. I suppose you could try and lock it down further by rejecting versions that are too old but that may be another can of worms. The other issue is for self-compiled versions certain components that you may be relying on may not be present as when compiling your own there are many things that can be enabled or disabled. Perhaps a link to the ffmpeg source with instructions on what config options should be used to compile your own could be a useful Wiki to add.
 
#39 ·
Keary,

Is there a particular reason why you chose to use FFMPEG as a shared library instead of a static library? I would think that if you could just link to the static library you wouldnt have to worry about avcodec/util/format..etc versions.

As I am not able to check right now, is it possible to just drop my own precompiled statically linked FFMPEG into the native directory and have it work?
 
#40 ·
Keary,

Is there a particular reason why you chose to use FFMPEG as a shared library instead of a static library? I would think that if you could just link to the static library you wouldnt have to worry about avcodec/util/format..etc versions.

As I am not able to check right now, is it possible to just drop my own precompiled statically linked FFMPEG into the native directory and have it work?
I believe that's because it's a java app. He can't 'build it static' with those libraries. The best he can do is to use java native to access libraries, which is what ffmpeg-java does (he's using ffmpeg-java to do the stuff).
 
#41 ·
My devel is system is ubnutu 8.04 AMD64, but I'm upgrading as we speak to 8.10 to see if it makes a difference.
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
 
#42 ·
I believe that's because it's a java app. He can't 'build it static' with those libraries. The best he can do is to use java native to access libraries, which is what ffmpeg-java does (he's using ffmpeg-java to do the stuff).
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...)
 
#44 ·
pyTivoX is great, thank you for this tool.

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

Thanks again.
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).
 
#45 ·
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...!!
 
#46 ·
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.
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 ...
 
#47 ·
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.
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:
 
#48 ·
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.
 
Top