采用Android用纯Java实时流视频 [英] Live Stream video using Android with pure java

查看:571
本文介绍了采用Android用纯Java实时流视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做Android的一个现场直播的应用程序,我的问题是是使用HTTP和RTSP之间的区别是什么有什么办法只有Java的code要做到这一点,我是指这么多的项目已经做的使用Java与其他语言的组合,有没有办法用java中有效的方式流仅

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

推荐答案

RTSP手段的实时流协议的,是专门为流目的而设计的,一个协议,RTSP,你可以在媒体控制绝对定位流,记录和可能的设备控制等。

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服务器需要保持在几乎所有的默认状态 的情况下,相对于HTTP的无状态特性。
    • 在两者的RTSP服务器和客户机可以发出请求。
    • 的数据由不同的协议进行的带外。
    • 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.

      如果你想使用视频流,你必须使用RTSP

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

      有关协议RTSP

      NB

      要显示的视频内容在Android中,你可以使用VideoView

      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));
      

      如前所述这里

      这篇关于采用Android用纯Java实时流视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆