44

I am developing an Android application in which I want to publish as well as stream a video...

What I want is:

  1. My app records a video and that video is sent to the server

  2. The recorded video will be streamed live to another Android device at the same time..

I have completed the first task using javac and ffmpeg. I am stuck in the second task. I have searched a lot to stream the video from the server, but I didn't succeed. I don't want to use WebView and play the video in it. I want an RTMP player. This task has been completed in iOS... I want the same for Android. What is some link to fulfill my task?

P.S.:

I am using wowza server and RTMP stream. I would like to stream RTMP video (.flv)... If no solution is available, I would like to switch to RTSP and for that also, need a working link to follow..

Now I have switched to RTSP player [with wowza server] as I have not found an RTMP player without webview. How do I fix this issue?

M.G
  • 1,098
  • 1
  • 8
  • 29
SweetWisher ツ
  • 7,240
  • 2
  • 27
  • 68
  • Sorry to open link one by one. 1)http://stackoverflow.com/questions/17910227/wowza-rtmp-to-play-on-multiple-devices 2) http://stackoverflow.com/questions/10123498/streaming-rtmp-stream-live-from-android-camera-to-fms-or-wowza-or-red5-convert – Chirag Patel Dec 04 '13 at 06:27
  • I have question about RTSP server. Are you using some free server or do you have your own. In case of our own server give me some info about it. Is it a normal server just like Http and do we need to code service on the server side that listen to stream? Please guide me here – umerk44 Dec 15 '14 at 05:24
  • We have used [wowza server](http://www.wowza.com/). – SweetWisher ツ Dec 15 '14 at 05:29
  • @SweetWisherツThere is a simple question I am trying to use the same which you tried http://www.walking-productions.com/notslop/2013/01/16/android-live-streaming-courtesy-of-javacv-and-ffmpeg/..it sometimes crash...latency is on higher side. How did you manage to resolve the issue? Please reply... – Saty Dec 14 '15 at 06:49
  • If you're not set on using Wowza, you could use http://red5pro.com/ which provides an SDK for Android and iOS. – Paul Gregoire May 19 '16 at 13:22

3 Answers3

22

You can easily do it via Vitamio Lib. Vitamio can play 720p/1080p HD, mp4, mkv, m4v, mov, flv, avi, rmvb, rm, ts, tp and many other video formats in Android and iOS. Almost all popular streaming protocols are supported by Vitamio, including HLS (m3u8), MMS, RTSP, RTMP, and HTTP.

Download Vitamio Bundle from here.

And a demo from here.

A tutorial from here.

KnowIT
  • 1,916
  • 1
  • 15
  • 16
Zeeshan Saiyed
  • 448
  • 3
  • 13
  • I am sending the live through [link](http://www.walking-productions.com/notslop/2013/01/16/android-live-streaming-courtesy-of-javacv-and-ffmpeg/). It includes FFMPEG lib. Now, I integrated this VITAMIO lib in myproject but i am getting this error[link](http://pastie.org/8697174) – Mr. N.V.Rao Feb 04 '14 at 09:52
  • 1
    Please note that Vitamio's Standart Edition is limited for twelve months https://www.vitamio.org/en/License/ – valerybodak Mar 25 '15 at 07:47
  • Vitamio for Android is now DEPRECATED – Ameer Oct 13 '15 at 05:03
  • 1
    @Ameer and what should be used now, if Vitamio is deprecated? – ocramot Apr 18 '16 at 13:01
  • Perharps ExoPlayer for Android , it's has great support from community, itś also supported by Google and has a great API architecture. #exoplayer #android – william gouvea Aug 29 '17 at 21:52
3

I am using Adobe AIR to play RTMP and it's awesome. I found the answer here; see the code:

function init_RTMP():void
{
    streamID  = "RT_2";
    videoURL = "rtmp://fms5.visionip.tv/live/RT_2";

    vid = new Video();

    nc = new NetConnection();
    nc.addEventListener(NetStatusEvent.NET_STATUS, onConnectionStatus);
    nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
    nc.connect(videoURL);
}

private function onConnectionStatus(e:NetStatusEvent):void
{
    if (e.info.code == "NetConnection.Connect.Success")
    {
        trace("Creating NetStream");
        netStreamObj = new NetStream(nc);

        metaListener = new Object();
        metaListener.onMetaData = received_Meta;
        netStreamObj.client = metaListener;

        netStreamObj.play(streamID);
        vid.attachNetStream(netStreamObj);
        addChild(vid);
    }
}
Community
  • 1
  • 1
Anas
  • 713
  • 6
  • 23
1

If you don't have any other options, you can use spydroid-ipcamera, which is an open source project. It's an alternative for your requirements. I have checked it and it provides live video treaming.

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
Hardik Joshi
  • 9,259
  • 11
  • 59
  • 110
  • we have a lot of success using live 555, right now we are targeting IOS but live 555 is very portable and we expect an easy port to Android. I would suggest looking it it. basically you could use android to capture the frames from the camera then pass them on the a h264descreteFramer, and and rtpSink, both of these are available live 555 classes. – Michelle Cannon Dec 08 '13 at 20:10
  • 1
    I don't want to capture video from android device, I want to live stream video from wowza server to android device – SweetWisher ツ Dec 11 '13 at 08:08