简体   繁体   English

如何在Android中流式传输RTMP直播视频

[英]How to stream RTMP live video in Android

I have developed an application on Android for live streaming through RTSP and it's working fine. 我已经在Android上开发了一个通过RTSP实时流媒体的应用程序,它运行良好。 I am able to play the RTSP URL with the help of Daroon Player and Wondershare . 我可以在Daroon PlayerWondershare的帮助下播放 RTSP URL The running code for RTSP is: RTSP的运行代码是:

Uri stream = Uri.parse("rtsp://media-us-2.soundreach.net/slcn_lifestyle.sdp"); 
Intent videointent = new Intent(Intent.ACTION_VIEW,stream); 
startActivity(videointent);

Now I have to stream the live video through RTMP, but I am not able to invoke it with the above process. 现在我必须通过RTMP流式传输实时视频,但我无法通过上述过程调用它。 The requirement is to play the RTMP URL with the Wondershare only. 要求是仅使用Wondershare播放RTMP URL。

How would I play the RTMP URL on an Android device with the help of a third-party application, that is, wondershare? 如何借助第三方应用程序(即wondershare)在Android设备上播放RTMP URL?

Please take a look at Vitamio . 请看看Vitamio It is a nice library for playing multimedia content. 这是一个很好的播放多媒体内容的库。

您可以使用您的代码,但不是使用Daroon Player,而是使用MX Video Player

You can use Vitamio Library for android. 你可以使用Vitamio Library for android。 Only drawback is that it has a license. 唯一的缺点是它有许可证。

Here is a tutorial for it. 这是一个教程

RTMP streams aren't supported by any player you can find on the play store. 您可以在Play商店中找到的任何播放器都不支持RTMP流。 (This is because there isn't any implementation yet for the RTMP protocol. It was developed by Adobe for Flash Player.) The only way to play RTMP streams is by using a webview with Flash Player embedded in it and then using the RTMP link to the video in the HTML code. (这是因为RTMP协议还没有任何实现。它是由Adobe为Flash Player开发的。)播放RTMP流的唯一方法是使用嵌入了Flash Player的webview,然后使用RTMP链接到HTML代码中的视频。 This is the only way, but sadly the user that is watching has to have Flash Player installed. 这是唯一的方法,但遗憾的是,正在观看的用户必须安装Flash Player。

UPDATE: VLC player for Android can play RTMP streams. 更新:Android的VLC播放器可以播放RTMP流。 The information mentioned above is outdated. 上述信息已过时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM