how to create a RTSP streaming server

给你一囗甜甜゛ 提交于 2019-12-03 02:49:55

问题


So I am trying to create a RTSP server that streams music.
I do not understand how the server plays a music and different requests get what ever is playing at that time.
so, to organize my questions:
1) how does the server play a music file?
2) how does the request to the server look like to get whats currently playing?
3) what does the response look like to get the music playing in the client that requested the music?


回答1:


First: READ THIS (RTSP), and THEN READ THIS (SDP), and then READ THIS (RTP). Then you can ask more sensible questions.

1) It doesn't, server streams little parts of the audio data to the client, telling it when each part is to be played.

2) There is no such request. If you want, you can have URL for live streaming, and in RTSP DESCRIBE request, tell the client what is currently on.

3) Read the first (RTSP) document, all is there! Answer to your question is this:

RTSP/1.0 200 OK
CSeq: 3
Session: 123456
Range: npt=now-
RTP-Info: url=trackID=1;seq=987654

But to get the music playing you will have to do a lot more to initiate a streaming session.




回答2:


You should first be clear about what is RTSP and RTP. The Real Time Streaming Protocol (RTSP) is a network control protocol designed for use in communications systems to control streaming media servers. where as Most RTSP servers use the Real-time Transport Protocol (RTP) for media stream delivery. RTP uses UDP to deliver the Packet Stream. try to Understanding these concepts.

then Have a look at this project. http://sourceforge.net/projects/unvedu/

This a open source project developed by our university, which is used to stream video(MKV) and audio file over UDP.




回答3:


You can also find a .Net Implementation of RTP and RTSP here @ https://net7mma.codeplex.com/ which includes a RTSP Client and Server implementation and many other useful utilities e.g. implementations of many popular Digital Media Container Formats.

The solution has a modular design and better performance than ffmpeg or libav at the current time.



来源:https://stackoverflow.com/questions/4321438/how-to-create-a-rtsp-streaming-server

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