Live stream RTMP/RTSP player without using webview

2019-01-21 00:43发布

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?

6条回答
混吃等死
2楼-- · 2019-01-21 01:00
劫难
3楼-- · 2019-01-21 01:01

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.

查看更多
成全新的幸福
4楼-- · 2019-01-21 01:02

You may want to try using Adobe AIR which can trivially play rtmp, and deplay the AIR app to Android.

Deploying the AIR app to Android: http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-8000.html

查看更多
一夜七次
5楼-- · 2019-01-21 01:15

I have used libVLC in one of my application and works well. https://github.com/mrmaffen/vlc-android-sdk

查看更多
我欲成王,谁敢阻挡
6楼-- · 2019-01-21 01:17

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.

查看更多
戒情不戒烟
7楼-- · 2019-01-21 01:17

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);
    }
}
查看更多
登录 后发表回答