RTSP &PHP中的mms协议实现 [英] RTSP & mms protocol implementation in PHP

查看:92
本文介绍了RTSP &PHP中的mms协议实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


PHP 中是否有任何 RTSP 和/或 MMS 协议的实现来从 RTSP & 下载流?MMS 服务器(PHP 中的 RTSP/MMS 客户端)?

Hi
Is there any implementation of RTSP and/or MMS protocols in PHP to download streams from RTSP & MMS servers (RTSP/MMS client in PHP)?

推荐答案

你试图做的从根本上是行不通的.MMS 是一种实时多媒体流协议 - 客户端和服务器之间来回进行对话以同步数据传输(因此视频和音频是同步的)并根据数据包延迟和丢包率协商比特率,等等......并且只要媒体在流媒体就保持会话.它以媒体的速率传输,而不是连接的比特率.如果是一个小时的视频,您的客户端必须保持连接一个小时.

What you are trying to do is fundamentally not going to work. MMS is a real time multimedia streaming protocol - the client and the server have a conversation back and forth synchronizing the transfer of data (so the video and the audio are synchronized) and negotiating the bit rates based on the packet delay and packet loss rate, etc... and stays in session for as long as the media is streaming. It streams at the rate of the media, not at the bit rate of the connection. If it is an hour long video, your client will have to remain connected for an hour.

PHP 是一种查询/响应脚本语言——你向它发送请求,它发送一个答案,挂断然后忘记它为你的请求所做的一切——它不维护状态"(除非你推送会话数据返回浏览器客户端).Web 服务器最终将使脚本超时并终止它(不可否认,您可以使超时时间很长)......但实际上拥有一个可以保存"彩信流的 php 客户端意味着本质上是用 PHP 编写 Windows Media Player 并执行因此它管理两个套接字——一个在每个方向——都试图实现一个专有的未记录的复杂流协议.

PHP is a query/response scripting language - you send it a request, it sends an answer, hangs up and then forgets everything it was doing for your request - it doesn't maintain "state" (unless you push sesstion data back to the browser client). The web server will time out the script eventually and kill it (admittedly you could make the timeout very long)... but to actually have a php client that could "save" an MMS stream means essentially writing Windows Media Player in PHP and doing it so it manages two sockets - one in each direction - all trying to implement a proprietary undocumented complex streaming protocol.

正如其他人指出的那样,您需要从服务器名称中删除 mms://才能连接到服务器 - 但这并不简单.Windows Media Player 使用各种端口来尝试连接到服务器,因为防火墙和路由器可能会阻止它.它的最终回退是端口 80,以愚弄守门员,WMP 只是在下载一个未知大小的又大又长的无辜图形图像.您或许可以验证另一端是否有实时彩信服务器,但除此之外,它会变得非常复杂且非常快.

As others pointed out, you need to drop the mms:// from the server name in order to connect to the server - but even that is not simple. Windows Media Player uses a variety of ports in order to try to connect to the server, because firewalls and routers may be blocking its way. It's ultimate fallback is port 80, to fool the gatekeepers that WMP is just downloading a big long innocent grahpics image of unknown size. You might be able to verify that you have a live MMS server on the other end, but beyond that it gets very complicated very fast.

这是错误的工作工具.

这篇关于RTSP &PHP中的mms协议实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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