如何创建一个 RTSP 流媒体服务器 [英] how to create a RTSP streaming server

查看:66
本文介绍了如何创建一个 RTSP 流媒体服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在尝试创建一个流式传输音乐的 RTSP 服务器.
我不明白服务器如何播放音乐,不同的请求会得到当时正在播放的内容.
所以,整理我的问题:
1) 服务器如何播放音乐文件?
2) 向服务器发出的请求如何获取当前正在播放的内容?
3) 在请求音乐的客户端中播放音乐的响应是什么样的?

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?

推荐答案

第一: 阅读此内容 (RTSP) 和然后阅读此内容 (SDP),然后阅读本文 (RTP).然后你可以提出更明智的问题.

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

1) 不是,服务器将音频数据的一小部分流式传输到客户端,告诉它何时播放每个部分.

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) 没有这样的要求.如果需要,您可以拥有直播的 URL,并在 RTSP DESCRIBE 请求中告诉客户端当前正在播放什么.

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) 阅读第一个 (RTSP) 文档,一切都在那里!你的问题的答案是这样的:

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.

这篇关于如何创建一个 RTSP 流媒体服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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