Skip to content

RTSP transport, HTTP modes and latency

RTSP transport mode

When connecting to RTSP URLs, if the connection fails or takes too long, the origin of the problem can be the default transport mode. Retry after specifying the tcp, udp or http transport as follows:

  • at the end of the RTSP URL, by adding >rtsp_transport=value:
rtsp://admin:admin@192.168.0.33>rtsp_transport=tcp
rtsp://admin:admin@192.168.0.33>rtsp_transport=udp
rtsp://admin:admin@192.168.0.33>rtsp_transport=http
rtsp://admin:admin@192.168.0.33>rtsp_transport=https
rtsp://admin:admin@192.168.0.33>rtsp_transport=udp_multicast
  • or programmatically, by invoking IDatasteadRTSPSourceConfig.SetInt (RTSP_Source_RTSPTransport_int, Value).

The possible values are:

Value Transport
0 automatic (default, UDP is tried first)
1 tcp
2 udp
3 http
4 udp_multicast
5 https

HTTP URLs in JPEG, MJPEG or MXPEG mode

If the connection to an HTTP URL in JPEG or MJPEG mode fails, specify the MJPEG mode:

  • at the end of the URL, e.g.:
http://192.168.0.24>srcformat=mjpeg
  • or programmatically, by invoking IDatasteadRTSPSourceConfig.SetStr (RTSP_Source_Format_str, "mjpeg").

If the URL is a MXPEG URL, specify "mxg" instead of "mjpeg".

Latency

To minimize the latency, specify a zero buffering:

  • at the end of the URL, e.g.:
rtsp://192.168.0.24>buffer=0
  • or programmatically:
IDatasteadRTSPSourceConfig.SetInt (RTSP_Source_BufferDuration_int, 0);

See also How to reduce the latency in the FAQ.