RTSP for Multimedia Communication

Source: Internet
Author: User

The real-time stream protocol RTSP is jointly proposed by RealNetworks and Netscape, which defines how one-to-multiple applications can effectively transmit multimedia data over an IP network. RTSP is located on RTP and RTCP in the architecture. It uses TCP or RTP for data transmission.

Specific implementation:

Player = manager. createplayer (rtspurl );
Player. addplayerlistener (this );
Player. Realize ();
Volumecontrol = (volumecontrol) player
. Getcontrol ("volumecontrol ");
Volumecontrol. setlevel (level );
Player. prefetch ();
Player. Start ();

 

 

RTSP Protocol

Use RTSP Protocol

Application to: Windows Server 2008

You can use the real-time stream protocol (RTSP) to transmit content in the form of unicast streams. This is an application-level protocol dedicated to controlling the transmission of real-time data (such as audio and video content. It is implemented through correction-oriented transmission protocols. This protocol supports player control operations, such as stopping, pausing, retreating, and fast-indexing windows media files. You can use RTSP to transfer content to a computer running Windows Media Player 9 series or later, or Windows Media Services 9 series or later. RTSP is a control protocol that provides content to the client together with the real-time data transfer protocol (RTP.

If the connection URL uses RTSP (for example, RTSP ://Server/Publishing_point/File), The RTSP will automatically negotiate the best transfer mechanism of the content. Then, it indicates that the RTP protocol uses UDP (the TCP-based protocol is used on the network that does not support udp) to transmit the stream content.

To force the server to use a specific protocol, you can identify the Protocol to be used in the announcement file. You can also go to the content address (for example, rtspu ://Server/Publishing_point/File. To facilitate Protocol scrolling, we recommend that you use the common RTSP protocol for URLs. In this way, the player can use the rtspu or rtspt protocol to connect to the stream. If the player cannot successfully connect to the stream using any RTSP protocol, it will try to connect to the stream using HTTP protocol.

Windows Media Services implements RTSP through the wms rtsp server control protocol plug-in. This plug-in is enabled in the default installation of Windows Media Services and bound to TCP port 554.

About unicast streams

Application to: Windows Server 2008

A unicast stream is a one-to-one connection between the server and the client. This means that each client receives a unique stream and can only receive it from the client requesting the stream. You can transmit the content as a unicast stream from the request publishing point or broadcast publishing point.

Unicast streams are the default method for passing content on the Windows Media Server. Unicast streams are automatically enabled by the WMS unicast data writer plug-in (enabled by default ).

The following shows an example of using the content of a request publishing point as a unicast stream.

On the server running Windows Media Services (server1), there is a request publishing point named TV1. This release point determines the location of the content to be transmitted. You can place the content on a local server or a network file system. You can obtain content from a specific file, playlist file, or directory. In this example, the release point is a playlist file stored locally on Server 1. When you want users to start transmission, you can create an announcement to provide users with a URL pointing to the content. As this content is transmitted as a unicast stream, each player has a unique connection to server1.

After the client connects to the server, content can be transmitted through UDP or TCP. The difference between the two Protocols is that the client confirms that the packet is received.

If the rtspu method is used, the server does not need to transmit another data packet after receiving the verification that the data packet has been successfully received. This method is most suitable for transmission. If the client does not receive the packet, it can request the server to resend the lost packet. This is calledUDP Resend Request. When the server receives a UDP resend request, it checks its buffer to see if the data is still available. If the data can be obtained, the data is resent to the client. If the request cannot be obtained, the server cannot implement the request. The client can bear some packet losses, or even continue to provide content after the UDP resend request fails.

If you use the TCP transmission method (such as HTTP or rtspt), the server must wait for the client to confirm that one data packet is successfully received before sending another data packet. If the packet is lost, the server must resend the packet before continuing to transmit data. This method is most suitable for connecting platform components (such as encoder, Cache/Proxy Server, and distribution server) because it maintains the highest quality of stream.

By default, Windows Media Services determines the optimal data packet size based on the content. If you want to use the RTSP protocol to transmit content through unicast connections and encounter a large number of data packet loss or split, you may want to use the WMS unicast data to write the properties page of the program management unit, set a specific unicast packet size for your server. Consider the following when determining whether the server's correct data package is large:

  • If the packet size exceeds the capacity of the router that forwards the packet to the client, the router divides the packet into fragments and sends the fragments to the client. After the client receives all the packet fragments, It reassembles them into the original packet. This may cause the loss of a large number of data packets, because the loss of any part will lead to the loss of the entire data packet.
  • Each packet sent by the server has an additional bandwidth requirement for transmitting header information (such as control protocols, stream formats, and server addresses. Sending a large number of small data packets may greatly increase the bandwidth used.
  • Each re-transmission requires the same number of bandwidth and sending time as the original data packet.
  • Different users may support different data packet sizes. Optimize the data packet size for your target users.
  • When using UDP through the RTSP protocol (rtspu), setting the RTP packet size to a value that is too small may prevent the Windows Media Server from transmitting the data.

The advantage of unicast stream is that it can interact between the player and the server, make it easier to set up, and have the multi-Bit Rate stream function. However, the number of users that can receive unicast streams is limited by the bit rate of the content and the network speed of the server. Large unicast may cause the network or server to crash quickly. To use unicast streams, consider the following scenarios:

  • We hope to use multi-bit rate encoding and smart stream.
  • The planned number of users and content bit rate are consistent with the capacity of the network and server.
  • Detailed client logs are required.
  • Your network does not support multicast.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.