1.DSS的reflect功能
Darwin可以接收RTP数据,进行转发,这个功能官方文档描述为"reflect "。使用VLC很容易演示这个功能,命令:
- vlc -vvv test.mp4 --sout "#dst=rtp{dst=127.0.0.1,port-audio=20000,port-video=20002,ttl=127,name=CHANNEL,sdp=file:///f:/channel.sdp}"
这种方式,需要手动将SDP文件copy到DSS中。其实还有一种"自动"的方式,这需要一个RTSP客户端,并且实现"ANNOUNCE"命令。"ANNOUNCE"可以携带SDP信息,DSS接收到命令后,能够自动在Movies目录中建立SDP文件。
2.live555给DSS提供数据
live555支持"ANNOUNCE"命令,可以用来向DSS提供数据,并提供了一个testMPEG4VideoToDarwin的示例程序,用来测试这个功能。将测试文件test.m4e(m4e文件可以到这时下载http://www.live555.com/liveMedia/public/m4e/)放到testMPEG4VideoToDarwin.exe目录,启动命令行输入:- $ ./testMPEG4VideoToDarwin.exe 127.0.0.1
- Beginning streaming...
- Beginning to read from file...
- Play this stream (from the Darwin Streaming Server) using the URL:
- rtsp://127.0.0.1/test.sdp
- ...done reading from file
- Beginning to read from file...
3.DSS的权限控制
我的测试环境中,DSS与testMPEG4VideoToDarwin.exe在同一台PC上,上面使用的是127.0.0.1这个地址,如果使用使用本地IP或者是在在其它PC上向DSS发送数据,会提示出错:- $ ./testMPEG4VideoToDarwin.exe 192.168.1.188
- Beginning streaming...
- Beginning to read from file...
- injector->setDestination() failed: 401 Unauthorized
- <Limit WRITE>
- require any-user
- </Limit>
- require any-user
- $ ./testMPEG4VideoToDarwin.exe 192.168.1.188
- Beginning streaming...
- Beginning to read from file...
- Play this stream (from the Darwin Streaming Server) using the URL:
- rtsp://192.168.1.188/test.sdp
4.RTSP命令交互
使用Wireshark抓取的RTSP命令交互过程如下:
PS:
如果其它PC的无法连接到DSS服务器,可以关闭防火墙试试,我的win7默认就出现这个问题。