简体   繁体   English

使用纯Java的Android直播视频

[英]Live Stream video using Android with pure java

我试图在android中做一个实时流媒体应用程序,我的问题是使用http和rtsp有什么区别是有任何方法只有java代码才能做到这一点,我推荐这么多项目已经完成使用java与其他语言组合,有没有办法以有效的方式使用java进行流式传输

RTSP means Real Time Streaming Protocol , is a protocol specifically designed for streaming purpose, with RTSP you can control absolute positioning within the media stream, recording and possibly device control etc RTSP意味着实时流协议 ,是专为流媒体设计而设计的协议,使用RTSP可以控制媒体流中的绝对定位,录制和可能的设备控制等

  • RTSP introduces a number of new methods and has a different protocol identifier. RTSP引入了许多新方法,并具有不同的协议标识符。
    • An RTSP server needs to maintain state by default in almost all cases, as opposed to the stateless nature of HTTP. 在几乎所有情况下,RTSP服务器都需要默认维护状态,而不是HTTP的无状态特性。
    • Both an RTSP server and client can issue requests. RTSP服务器和客户端都可以发出请求。
    • Data is carried out-of-band by a different protocol. 数据通过不同的协议进行带外传输。

If you want to use video streaming you have to use RTSP 如果您想使用视频流,则必须使用RTSP

See this LINK for more details about the protocol RTSP 有关协议RTSP的更多详细信息,请参阅此LINK

NB NB

To show the video content in Android you can use the VideoView 要在Android中显示视频内容,您可以使用VideoView

myVideoView = (VideoView) findViewById(R.id.myview);
myVideoView.setVideoPath("rtsp://SERVER_IP_ADDR:5544/");
myVideoView.setMediaController(new MediaController(this));

As described HERE 如上所述HERE

I would suggest you to go for RTMP (Real time messaging protocol) instead of RTSP, there are number of open source plugins available in the market, like the famous "flowplayer" which is capable of streaming the video as per the industrial standards using the RTMP protocol. 我建议你去RTMP(实时消息传递协议)而不是RTSP,市场上有许多开源插件,比如着名的“流动播放器”,它能够根据工业标准使用RTMP协议。 It has rapidly developed its capability to stream videos on Apple devices with the existing Flowplayer source plugin. 它已经迅速发展了使用现有Flowplayer源插件在Apple设备上流式传输视频的功能。 Hope this helps 希望这可以帮助

Flowplaye : flowplayer website We are currently using the Akamai streaming capability coupled with flowplayer plugin for a flawless streaming experience. Flowplaye: flowplayer网站我们目前正在使用Akamai流媒体功能和flowplayer插件,以获得完美的流媒体体验。

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

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