在 Android 上不使用 webview(WOWZA 服务器)的实时流 RTMP/RTSP 播放器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20366848/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Live stream RTMP/RTSP player without using webview (WOWZA server) on Android
提问by SweetWisher ツ
I am developing an Android application in which I want to publish as well as stream a video...
我正在开发一个 Android 应用程序,我想在其中发布和流式传输视频...
What I want is:
我想要的是:
My app records a video and that video is sent to the server
The recorded video will be streamed live to another Android device at the same time..
我的应用程序录制了一个视频并将该视频发送到服务器
录制的视频将同时直播到另一台 Android 设备。
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 WebViewand 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?
我已经使用javac 和 ffmpeg完成了第一个任务。我被困在第二个任务中。我已经搜索了很多从服务器流式传输视频,但我没有成功。我不想使用 WebView并在其中播放视频。我想要一个 RTMP 播放器。此任务已在 iOS 中完成...我希望在 Android 中也能完成。什么是完成我的任务的链接?
P.S.:
PS:
I am using wowza serverand 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..
我正在使用wowza 服务器和 RTMP 流。我想流式传输 RTMP 视频 (.flv)...如果没有可用的解决方案,我想切换到 RTSP 并且为此也需要一个工作链接来跟踪..
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?
现在我已经切换到RTSP 播放器 [with wowza server]因为我没有找到没有 webview 的 RTMP 播放器。我该如何解决这个问题?
采纳答案by Zeeshan Saiyed
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.
您可以通过 Vitamio Lib 轻松完成。Vitamio 可以在 Android 和 iOS 中播放 720p/1080p 高清、mp4、mkv、m4v、mov、flv、avi、rmvb、rm、ts、tp 和许多其他视频格式。Vitamio 支持几乎所有流行的流媒体协议,包括 HLS (m3u8)、MMS、RTSP、RTMP 和 HTTP。
Download Vitamio Bundle from here.
从这里下载 Vitamio 捆绑包。
And a demo from here.
以及来自此处的演示。
A tutorial from here.
来自这里的教程。
回答by Anas
I am using Adobe AIRto play RTMP and it's awesome. I found the answer here; see the code:
我正在使用Adobe AIR播放 RTMP,它很棒。我在这里找到了答案;看代码:
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);
}
}
回答by Hardik Joshi
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.
如果您没有任何其他选择,您可以使用spydroid-ipcamera,这是一个开源项目。它是满足您要求的替代方案。我已经检查过它,它提供实时视频流。