简体   繁体   English

用Java实现RTSP媒体服务器

[英]Implementing RTSP media server in Java

I am trying to implement a simple RTSP server in java that will use an android handset as the receiving client. 我正在尝试在Java中实现一个简单的RTSP服务器,该服务器将使用Android手机作为接收客户端。 I have trawled the internet for answers and have been returned to this site many times. 我已经在互联网上搜寻了答案,并且已经多次返回该站点。 Through this I have found out that JMF does not natively support RTSP on the server side and that java must be extended using a NIO framework such as Netty, Xuggler, Mina etc. My only problem is that after searching the documentation for these sites I have not found any basic examples of how RTSP can be implemented. 通过这种方式,我发现JMF在服务器端本身不支持RTSP,并且必须使用Netty,Xuggler,Mina等NIO框架来扩展Java。我唯一的问题是,在搜索了这些站点的文档后,我有了找不到任何有关如何实施RTSP的基本示例。

My question is: Has any body had this problem and resolved it, and if so can you please point me towards some helpful source code or documentation. 我的问题是:任何机构都有这个问题并已解决,如果可以的话,请您指导我一些有用的源代码或文档。 Bearing this in mind have already looked every related thread on this site and followed up on most links without any avail. 牢记这一点,已经在该站点上查找了每个相关主题,并在大多数链接上进行了后续跟踪,但没有任何帮助。 I am not new to java and I understand all the streaming protocols but I am new to streaming implementations in java. 我对Java并不陌生,并且我了解所有流协议,但是对于Java中的流实现我还是陌生的。

Thank you 谢谢

it's very hard to answer to your question... I will just give you some basic advices: - start your job with a little POC to gain confidence with Java network programming - read some source code of the several TCP/IP Open Source servers implementations available in the Java World (Jetty/Tomcat/Jboss and several others) - try to think your architecture to be compliant with the Open Close Principle (being able to add support for new streams codecs and so on) - try to target a desired volume of parallel user sessions running with a server sized following your constraints and using the network bandwidth as stated in your contract 很难回答您的问题...我仅向您提供一些基本建议:-以一点POC开始您的工作,以对Java网络编程充满信心-阅读一些TCP / IP开源服务器实现的一些源代码在Java World(Jetty / Tomcat / Jboss等)中可用-尝试使您的体系结构符合开放关闭原则(能够添加对新流编解码器的支持,等等)-尝试定位所需的卷服务器运行的并行用户会话的数量,这些服务器的大小根据您的限制并按照合同中所述使用网络带宽

The client won't have much impact , RTSP seems to be a REST like protocol so you don't have to maintain user context...Just answer to incoming requests, very simple case it seems...The protocol seems not be very rich (very restricted set of commands).... Try to read some source code for one of the different clients available.I can advise you to fetch source code for one the standard Linux players: 客户端不会产生太大的影响,RTSP似乎是一种类似REST的协议,因此您不必维护用户上下文...只需回答传入的请求,似乎很简单的情况...协议似乎不是很丰富(非常受限制的命令集)。...尝试阅读一些可用客户端的源代码。我建议您从一个标准Linux播放器中获取源代码:

  1. VLC VLC
  2. mplayer 播放器
  3. xine ine

you may find very helpful code in those products.. I guess that people who have implemented commercial products won't be able to give you their feedbacks so use open source software!!! 您可能会在这些产品中找到非常有用的代码。.我想那些已经实现商业产品的人将无法向您提供反馈,因此请使用开源软件!!!

HTH Jerome 杰罗姆HTH

I think the reason that JMF contains classes for RTP / RTCP is that these are media protocols - ie these protocols describe how media is streamed over IP and how the stream quality is reported (respectively). 我认为JMF包含用于RTP / RTCP的类的原因是这些是媒体协议,即这些协议分别描述了如何通过IP流传输媒体以及如何分别报告流质量。

RTSP is a control protocol - it is used to set up the media streams. RTSP是一种控制协议-用于设置媒体流。 So this a layer above the media streams managed by JMF. 因此,这一层位于JMF管理的媒体流之上。 You can exchange RTSP messages in whatever channel takes your fancy and then use the exchanged information to establish your media stream. 您可以在任何喜欢的渠道上交换RTSP消息,然后使用交换的信息建立媒体流。

Try searching google code projects for RTSP implementations, looks like there are a few there. 尝试在Google代码项目中搜索RTSP实施,看起来那里有一些。

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

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