Live Stream video using Android with pure java

后端 未结 2 1906
谎友^
谎友^ 2021-01-06 04:21

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 s

2条回答
  •  爱一瞬间的悲伤
    2021-01-06 05:10

    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

提交回复
热议问题