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:

This entry was posted in android, Development, flash, ITP, Java, mobile, Open Source, Streaming and Multi-Media, Video. Bookmark the permalink.

57 Responses to Android Live Streaming courtesy of JavaCV and FFMPEG

  1. Pingback: How to: Streaming video from Android camera to server | SevenNet

  2. Muhyiddin says:

    This seems to be an interesting project. Can you walk me through the testing steps? Thanks in advance.

  3. Great.Park says:

    It really is an amazing project.

    Thank you very much.

    When you try to use the VideoInputFrameGrabber that is in your javacv library, the problem occurs.

    Is it possible that I am sent a JNI file if there is no rude?

    Since that has been modified to FFMpegRecorder, javacv you will not be able to use that are existing open.

    Once again, thank you wonderful project.

  4. Pingback: Fixed Streaming video from Android camera to server #dev #it #asnwer | Good Answer

  5. krunal says:

    how to stream from one android device and watch live stream from other android device.

  6. Diego says:

    Nice project. tks.

  7. Pisno says:

    When change format video to “mp4″
    The problem is ” Fatal signal 8 (SIGFPE) at 0x00002fc5 (code=-6), thread 12258 (Thread-334)”
    can you help me ?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>