RTSP Source URL syntax

The format of the string for RTSP streaming is as follows (optional components are enclosed in square brackets):

rtsp://[username[:password]@]ip_address[:rtsp_port]/server_URL[?param1=val1[&param2=val2]...[&paramN=valN]]

 

Components of the URL:
  1. ip_address: The server's IP address (mandatory). Typically, the RTSP servers use DHCP to obtain an IP address automatically. The servers usually provide a utility for detecting the server's IP address.

  2. server_URL: The server's relative URL (mandatory). Each RTSP server has its own relative URL, so you need to consult the server's manual to obtain it. The end of this page contains a list of server URLs for servers that we tested.

  3. username:password@: The username and password (optional). Some servers restrict access and require the use of a username and password to connect to it. In this situation, the filter will bring up a message box for entering this information. But you can also add it to the URL to speed up the connection and avoid the message box from coming up.

  4. ?param1=val1[...]: Extra parameters used to modify the filter or server's behavior (optional). They can be filter parameters (eg: Transport=xxx) or server parameters (eg: compression=jpeg). They can be used to control the connection mode, compression, video size, etc.

For more details and the general form of the complete RTSP URL, please go to IFileSourceFilter::Load.

 

The Transport optional parameter can be used to select one of the 3 possible streaming modes: Unicast, Multicast and using RTSP tunneling over HTTP. Here are the advantages and disadvantages for each mode:

Unicast (selected with Transport=unicast or by leaving it out):

Syntax:

rtsp://ip_address[:rtsp_port]/server_URL

rtsp://username:password@ip_address[:rtsp_port]/server_URL

 

Multicast (selected with Transport=multicast)

Syntax:

rtsp://ip_address[:rtsp_port]/server_URL?Transport=multicast

rtsp://username:password@ip_address[:rtsp_port]/server_URL?Transport=multicast

 

RTSP Tunneling over HTTP (selected with Transport=HTTP):

Syntax:

rtsp://ip_address[:rtsp_port]/server_URL?Transport=HTTP

rtsp://username:password@ip_address[:rtsp_port]/server_URL?Transport=HTTP

 

Examples of various forms of valid strings for particular camera (an Axis v5 camera):

rtsp://192.168.0.164/axis-media/media.amp - Connect to a RTSP server running on 192.168.0.164 at the "axis-media/media.amp" URL. The data will be streamed using the default compression (H264) and Unicast over UDP.

rtsp://192.168.0.164/axis-media/media.amp?Transport=multicast - Connect to a RTSP server running on 192.168.0.164 at the "axis-media/media.amp" URL. The data will be streamed using the default compression (H264) and Multicast over UDP.

rtsp://192.168.0.164/axis-media/media.amp?Transport=HTTP - Connect to a RTSP server running on 192.168.0.164 at the "axis-media/media.amp" URL. The data will be streamed using the default compression (H264) and HTTP tunneling over TCP.

rtsp://192.168.0.164/axis-media/media.amp?videocodec=jpeg - Connect to a RTSP server running on 192.168.0.164 at the "axis-media/media.amp" URL. The data will be streamed using the jpeg compression and Unicast over UDP.

rtsp://192.168.0.164/axis-media/media.amp?Transport=HTTP?videocodec=jpeg - Connect to a RTSP server running on 192.168.0.164 at the "axis-media/media.amp" URL. The data will be streamed using the jpeg compression and HTTP tunneling over TCP.

rtsp://root:pass@192.168.0.164/axis-media/media.amp?videocodec=jpeg - Connect to a RTSP server running on 192.168.0.164 at the "axis-media/media.amp" URL. The data will be streamed using the jpeg compression and Unicast over UDP. This server is using authentication, and we are connecting as username 'root' and with the password 'pass' in order to avoid having to enter a username and password.

rtsp://root:pass@192.168.0.164/axis-media/media.amp?Transport=HTTP&videocodec=jpeg - Connect to a RTSP server running on 192.168.0.164 at the "axis-media/media.amp" URL. The data will be streamed using the jpeg compression and HTTP tunneling over TCP. This server is using authentication, and we are connecting as username 'root' and with the password 'pass' in order to avoid having to enter a username and password.

 

One of the above URLs shows how to combine a server parameter (videocodec=jpeg) with a LEAD RTSP Source built-in parameter (Transport=HTTP). In general, options are added to the regular URL using '?' character. Multiple options are separated using the '&' character. The order of the options does not matter, so the following two commands will give the same result:

rtsp://192.168.0.164/axis-media/media.amp?Transport=HTTP&videocodec=jpeg

rtsp://192.168.0.164/axis-media/media.amp?videocodec=jpeg&Transport=HTTP

 

All of the above examples assume the server is listening to the default RTSP port (554). So they omit the port when they specify the URL. If the server is set to respond to a different port number, you will need to add the optional ":rtsp_port" after the server address. The following example assumes the server is listening on port 8003:

rtsp://192.168.0.164:8003/axis-media/media.amp

Note: RTSP URLs for servers that we tested

RTSP server

Command

Notes

Axis v5 platform

rtsp://192.168.0.164/axis-media/media.amp

rtsp://192.168.0.164/axis-media/media.amp?videocodec=jpeg

This server can stream H.264/jpeg video and AAC audio. First command streams H.264, while the second streams jpeg video.

It seems to support Unicast, Multicast and HTTP modes.

Axis v4 platform (eg: 214 PTZ camera)

 

rtsp://192.168.6.100/mpeg4/media.amp

Streams mpeg4 video and G.711 audio. G.726 audio are not supported

It seems to support Unicast, Multicast and HTTP modes.

Vivotek VS8102

rtsp://192.168.0.172/live.sdp

rtsp://192.168.0.172/live2.sdp

rtsp://192.168.0.172/live3.sdp

rtsp://192.168.0.172/live4.sdp

This server can set up to 4 types of streams. Select the video and audio compression for each stream.

We support H.264, MPEG4 and jpeg video and AAC/AMR audio.

It seems to support Unicast, Multicast modes. The HTTP mode did not seem to be supported.

 

Darwin Streaming Server

rtsp://192.168.6.101/<filename.mp4>

 

<filename.mp4> can be any file or playlist present on the server. The video and audio compression is the same as the audio and video compression of the file. We have tested successfully playback of MPEG4 video and AAC/AMR audio files.

CISCO RTSP

 

rtsp://192.168.0.172/StreamingSetting?version=1.0&action=getRTSPStream

&sessionID=<session_id>&ChannelID=1&ChannelName=Channel1

 

<session_id> is the session id obtained from the url you get when clicking on View Video in the browser.

The server uses H264 video and AAC audio.