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!
There is a quick example of writing a file up on the JavaCV site which provides the foundation: https://code.google.com/p/javacv/source/browse/samples/RecordActivity.java
I have the beginnings of a full blown project (which needs some updating based on the above example) up on GitHub: https://github.com/vanevery/JavaCV_0.3_stream_test