Xuggle now has librtmp support

June 18, 2010

First the bad news; The FFmpeg team has asked me to remove our FAAC-based AAC audio encoder from the binaries we build of Xuggle.  They believe the FAAC encoder is not redistributable as a binary form and, while they don’t actually have anything to do with the FAAC license, have put Xuggle on notice.  So, in an attempt to get off notice, we no longer auto-build FAAC.  Sorry.  That said, if you build Xuggle from source yourself and have already built and installed FAAC on your machine, we’ll link against it if you ask us to.

Now the somewhat inconvenient news; Xuggle now requires libssl, libcrypto and libz to build.  If you’re on ubuntu you probably have those already but to be sure:

apt-get install libssl-dev

This further complicates our windows builds, which remain broken for now.  In fact, we recommend people build from scratch to get the latest version as we’re unlikely to bundle up a formal release soon.

But finally, the GREAT news.  If you install libssl and build Xuggler from source, we now ship Xuggle with the excellent librtmp library.  That’s right… ‘rtmpdump‘ is now bundled with Xuggle, but there’s much more.  The FFmpeg we ship with also uses librtmp for RTMP support.  And the Xuggle Java API uses it too.  In other words, the tip of tree Xuggle now has RTMP, RTMPE, RTMPT, and RTMPS support and much better debugging.  It ships with rtmpdump and other tools.  It allows you to separate application name from path name.  It can intuit your personal desires and make your dreams come true.  It allows you to embed arbitrary AMF in requests (so may work with other CDNs like Akamai and others for their custom security crap).  It supports secure-token.  It supports buffering (like the flash player).  It can make excellent soufflé.  It can “lie” about the webpage you came from.    It is way better than a smart phone*.

Unfortunately it means a slight change in user interface for using FFmpeg with our streams.  Here’s what a new broadcast of a live stream looks like:

ffmpeg -re -i ~/Work/xuggle-xuggler-main/test/fixtures/ucl_h264_aac.mp4 \
 -acodec copy -vcodec copy -f flv "rtmp://  playpath=test live=true"

The quotes for the URL are very important.  You can now pass any parameter RTMPDump supports on the URL provided it is separated via a non-URL-encoded space from the actual URL.

Here’s recording a file from a RTMP server:

ffmpeg -f flv -i "rtmp:// playpath=stream1" \
  -acodec  copy -vcodec copy -y recording.flv

And if you’d like a blow-by-blow formatted packet dump to watch while doing that:

ffmpeg -debug 50 -level 50 -f flv -i "rtmp://  playpath=stream1" \
 -acodec copy -vcodec copy -y recording.flv

Finally, thanks to the kind folks at ConnectSolutions who continue to sponsor this work!

– Art

* way better than an iphone