Live Stream video using Android with pure java

不羁岁月 提交于 2019-11-30 18:14:24

问题


i am trying to do a live streaming app in android, my question is what is the difference between using http and rtsp is there any way to only java code to do this, i refer so many projects already done are using java with other language combination, is there any way to stream in efficient way using java only


回答1:


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 introduces a number of new methods and has a different protocol identifier.
    • An RTSP server needs to maintain state by default in almost all cases, as opposed to the stateless nature of HTTP.
    • Both an RTSP server and client can issue requests.
    • Data is carried out-of-band by a different protocol.

If you want to use video streaming you have to use RTSP

See this LINK for more details about the protocol RTSP

NB

To show the video content in Android you can use the VideoView

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

As described HERE




回答2:


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. It has rapidly developed its capability to stream videos on Apple devices with the existing Flowplayer source plugin. Hope this helps

Flowplaye : flowplayer website We are currently using the Akamai streaming capability coupled with flowplayer plugin for a flawless streaming experience.



来源:https://stackoverflow.com/questions/14049338/live-stream-video-using-android-with-pure-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!