1. Reflect function of DSS
Darwin can receive and forward RTP data. This feature is described in the official document "reflect ".
Using VLC, you can easily demonstrate this function by running the following command:
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}"
Run the preceding command to generate an SDP description file channel. SDP. VLC will send the RTP packet to the specified port of the specified destination IP address. To ensure that the command is correct, check whether there is an error message in the VLC menu "tool"> "message". Normally, you can see the generated SDP information in the "message" window. Change the channel. copy SDP to the directory where the DSS media file is located on the target PC. Then, use VLC to directly open the channel. SDP can play the video. If you use mplayer, you cannot open it directly *. the SDP file should use the command "mplayer SDP: // channel. SDP ". Start DSS and run "rtsp: // <DSS
Ip>/channel. SDP "to connect to DSS.
In this way, you need to manually copy the SDP file to DSS. There is also an "automatic" method, which requires an RTSP client and implements the "announce" command. "Announce" can carry SDP information. After receiving the command, DSS can automatically create SDP files in the movies directory.
2. live555 provides DSS with data
Live555 supports the "announce" command to provide data to DSS and provides a testmpeg4videotodarwin sample program to test this function. Run the test. m4e (m4e file can then download the http://www.live555.com/liveMedia/public/m4e/ idea to the testmpeg4videotodarwin.exe directory, start the command line and enter:
$ ./testMPEG4VideoToDarwin.exe 127.0.0.1Beginning 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 fileBeginning to read from file...
Now open the movies directory of DSS and you will find that a file named test. SDP is automatically generated. Use VLC to open rtsp: // <DSS ip>/test. SDP to play back the file.
3. DSS permission Control
In my test environment, dssand testmpeg4videotodarwin.exe are on the same PC and the address 127.0.0.1 is used. If you use a local IP address or send data to DSS on another PC, an error is prompted:
$ ./testMPEG4VideoToDarwin.exe 192.168.1.188Beginning streaming...Beginning to read from file...injector->setDestination() failed: 401 Unauthorized
The prompt message is obvious, which is related to permissions. Create a text file "qtaccess" in the movies directory. The content is as follows:
<Limit WRITE>require any-user</Limit>require any-user
After saving, restart the DSS service and test again.
$ ./testMPEG4VideoToDarwin.exe 192.168.1.188Beginning streaming...Beginning to read from file...Play this stream (from the Darwin Streaming Server) using the URL: rtsp://192.168.1.188/test.sdp
The above permission configuration allows any user to log on, or does not provide the user name and password. By default, when the address 127.0.0.1 is used, all permissions are available. For more information about DSS permission control, see http://manuals.info.apple.com/en/quicktimestreamingsrvradminguide.htm.
4. RTSP command Interaction
The interaction process of the RTSP command captured by Wireshark is as follows:
PS:
If other PCs cannot connect to the DSS server, disable the firewall and try again. This problem occurs in my win7 by default.