Android Live Streaming courtesy of JavaCV and FFMPEG

For the last little or should I say, long while I have been working on wrangling a solution for live streaming from Android that is both decent quality and extensible. For those of you interested, the litter in my GitHub account documents various previous attempts.

As far as I can tell, most folks that are streaming live video from Android are relying upon the video captured by the MediaRecorder and underlying classes and doing a bit of trickery with the file either while it sent to the server or on the server for distribution. This is fine but it doesn’t give hooks into the actual video frames before they are encoded and sent over the network.

Recently, I came across Samuel Audet’s amazing open source JavaCV project. In that project Samuel is wrapping FFMPEG’s underlying libraries (avcodec, avformat, and so on) using his equally amazing JavaCPP project to expose their functionality to any Java application.

Finally, after a few weeks of experimentation and little (actually a LOT) of help from Samuel himself, I have something working!

Running the live streaming app on a Galaxy Camera
Running the live streaming app on a Galaxy Camera

App and resulting stream on desktop via Wowza Media Server and Flash

There is a quick example of writing a file up on the JavaCV site which provides the foundation:

I have the beginnings of a full blown project (which needs some updating based on the above example) up on GitHub:

Java Media – It is sad but I don’t care anymore…

Rebooting Java Media, Part III: Conclusion – O’Reilly ONJava Blog

Chris Adamson has put together a nice 3 part series of posts that explore the state of media support in Java. Long has this been a point of frustration for me and many of my colleagues (we tend to use QuickTime for Java but that is changing). I have been constantly on the look-out for a solution but one hasn’t been forthcoming. After reading Chris’ wrap-up, I have reached many of the same conclusions but I have a slightly different idea that I would like to propose.

Here are a couple of points that bring me to my conclusion:
1: I am not interested in Flash beyond what it can do with video. Flash does not have a desktop playback interface and it is not easy (as far as I know) to make a desktop app out of it. It is also seriously hindered without a plugin interface or the ability to playback other formats/codecs.
2: AJAX is open, well supported and not proprietary for rich browser based interfaces. It is very successful and is pushing hard against Flash (if it weren’t for Flash Video, I think we would be witnessing Flash’s demise (at least in terms of interfaces)).

What is missing is a truly open video format and player with the features that we all expect (codecs, wide distribution, browser integration, a plugin interface) that we can use with AJAX. QuickTime isn’t this, Real isn’t this, Windows Media isn’t this, Flash isn’t this..

This is what I think is needed.. Forget about Java Media. The people we have relied on have failed us (Apple, Sun and IBM), we should give them an F and move on.

Am I dreaming..? Can the mozilla-vlc-plugin become this?

ITJ Project Beta Released

Interactive Tele-Journalism
So.. I have finally released ITJ on

With support from Konscious and Manhattan Neighborhood Network we have packaged and uploaded the latest version and it can be downloaded at:

dsj – DirectShow Java wrapper

DirectShow Java Wrapper: humatic – dsj
Very Nice..
From the site:
Need to play Windows Media files and streams, DivX video or DVDs in java? Access WDM capture devices? Control a firewire DVCam? Then maybe this can help you. dsj is an ongoing project to provide a java wrapper around Microsoft’s DirectShow API. It offers a set of high level classes that give java easy access to functionality widely missed by java programmers and also lets you dive deeper into the interiors of Windows’ core api for 2D media. On the java side dsj tries to keep things open as possible – you may use it standalone or let it feed data into JMF or other APIs.

They also point to a bunch of Open Source projects that are of interest:
Related projects (dsj does not use OpenSource, GPL or LGPL licensed code, but – as you are here – these projects may be of interest, too) :
JMDS – DirectShow Capture api Java wrapper:    –    fobs4jmf – ffmpeg c++ & java bindings:
java VLC – VideoLan java bindings:    –    DXInput – DirectInput Java wrapper:
jARToolkit – ARToolkit java bindings: – JMF codec pack: