2.12 RTSP

2.12.1 URI parameters

While connecting external server, there is a possibility to set several parameters to tune VASTreaming library. These parameters are not propagated to external server. If original URI does not contain parameter string, the format of URI is as follows:

rtsp://<server-name>[:<server-port>][/<server-path-if-any>]?<vast-parameter-name1>=<vast-parameter-value1>&<vast-parameter-name2>=<vast-parameter-value2>
...

Example of original server URI:

rtsp://192.168.0.101/stream1

The same URI with VASTreaming library parameter:

rtsp://192.168.0.101/stream1?vast-transport=TCP

The format of URI if original URI already has parameter string:

rtsp://<server-name>[:<server-port>][/<server-path-if-any>]?<server-parameters>&<vast-parameter-name1>=<vast-parameter-value1>&<vast-parameter-name2>=<vast-parameter-value2>...

Example of original server URI:

rtsp://192.168.0.101/stream1?resolution=hi

The same URI with VASTreaming library parameter:

rtsp://192.168.0.101/stream1?resolution=hi&vast-transport=TCP

The following URI parameters are supported (sorted in alphabetical order):

  • vast-check-rtcp-timeout enables / disables check of receiving RTCP packets. Since there are lots of third-party peers which do not send RTCP packages despite of announcing it, check of receiving RTCP packets is disabled by default. But user can enable this check if it is known that remote peer sends RTCP packets. Value can be 0 or 1.
  • vast-enable-send-control can be used to enable or disable the mechanism of congestion control of the data being sent. This mode ensures continuous working in case of temporary network problems. Value can be 0 or 1. By default, this mode is enabled.
  • vast-force-payload-type can be used for RTP sources for declaration of payload type if SDP is not available.
  • vast-force-ssrc can be used for RTP sources for declaration of stream SSRC in case of SDP is not available.
  • vast-ignore-sequence-no can be used to disable control of sequence number in RTP packets. This parameter can be used when a remote peer is sending invalid sequence numbers in RTP packets. Value can be 0 or 1. By default, the mode is disabled, i.e., sequence numbers are verified.
  • vast-local-ip can be used to set NIC which UDP stream will bind to. Value is IP address of NIC.
  • vast-loose-assembling can be used to enable / disable mode of loose assembling. Mode of loose assembling tries to form a frame from packets even if one or more packets are lost. This mode is quite dangerous because corrupted frames can cause hang or crash of decoder, so the mode is disabled by default, and in case of losing packets, the entire frame is dropped. Value can be 0 or 1.
  • vast-override-h264-packetization-mode can be used to override packetization mode for H264 codec. It is necessary because some third party peers send invalid packetization mode. Value can be 0, 1, or 2.
  • vast-playback-buffer-ms can be used in RTSP source to create playback buffer for smoothing of incoming media data. This buffer should be used only if input flow goes with uneven intervals, not smoothly. Playback buffer increases latency, so it is disabled by default. Value is set in milliseconds.
  • vast-rtp-port can be used to set a fake RTP port in case of use of VirtualRtpSource. Value is an integer number, ranging from 1 to 65,535.
  • vast-scale can be used to set playback speed for a remote RTSP server. It is intended only for VOD sources. By default, value is 1.0, i.e., it is real-time playback speed. Value more than 1 means receiving data faster than real time. Value less 1 means slower than real time.
  • vast-send-ping can be used to enable or disable sending RTSP "ping". Since RTSP "ping" is not standardized, some remote peers do not support it and even can disconnect upon its receiving. In this case, user can disable this mode. By default, sending "pings" is enabled. Value can be 0 or 1.
  • vast-session-timeout. RTSP sends session timeout in RTSP protocol exchange, but user can override this value and set it manually. By default, the library uses the value received from server. Value is set in seconds.
  • vast-timestamp-mode can be used to set format and time scale of timestamps of frames being received from an RTSP source. By default, the library uses the internal timescale (1/10000000) and starts counting timestamps from 0. If user sets this parameter value to rtp, then the library will use original RTP timestamps received from server and time scale of these timestamps will be taken from SDP. If user sets value to ntp, then the library will use absolute NTP time as timestamps. RTCP packets with NTP timestamps received from a remote peer will be used for synchronization.
  • vast-transport can be used to set an RTP transport for current session. By default, the library uses UDP. Value can be UDP or TCP. The library does not support automatic fallback from UDP to TCP, so if a remote peer does not support UDP transport, then user should set vast-transport=TCP explicitly in URI. Moreover, in case of a noisy network, it is highly recommended to use TCP transport.


2.12.2 Classes

RtspClientSource implements INetworkSource interface and creates an object pulling data from an RTSP server.

RtspInteractiveSource implements IInteractiveMediaSource interface. This is an interactive source, which on the fly downloads data from a VOD source located on RTSP server. It is supposed that RTSP server supports VOD streaming. It can be a surveillance recording server, for example. RtspInteractiveSource provides full interactive functionality including such functions as seek and pause. Moreover, this object optionally caches data on local disk to provide faster access to already played parts.

RtspPublisherSink is an object implementing INetworkSink and intended for publishing data onto external RTSP server.

RtspServer implements RTSP server protocol and can work both as a stand-alone and as a part of multi-protocol streaming server.

RtspServerParameters contains extra parameters for creating RTSP server.

VirtualRtpSource is an object implementing a fake RTP source which does not receive actual RTP data but depends on a user who is pushing RTP packets to this object. This object can be used when a user receives an RTP stream through some other means and wants to decode RTP data and integrate this data into VASTreaming infrastructure.

contact us

info@vastreaming.net