*RTSP Video

Configuration Article | CA-20220907-TP-08

VDG Sense | API | Usage

Live Video URL

The generic URL is formatted as follows:

rtsp:///?device=&

The figures illustrates how this information can be obtained from Sense Client.

Figure 1: Server ID, Description and IP Address. (Server tab, Sense Client)

Figure 2: Device ID. (Devices tab, Sense Client)

Within the boundaries of the given example, both of the following URLs would be valid (since it supports both the server id and description):

  • rtsp://172.21.240.91/VDG-Tutorial?device=19

  • rtsp://172.21.240.91/17167089910108338829?device=19

The minimum request URL should always contain at least the server-address, server-ID and device-id. This will return the native video. Resolution, quality and codec are the same as the camera stream.

Video on-demand URL

In order to play recorded video, the timestamp argument can be added to the RTSP URL. This argument identifies from which point in time playback needs to commence. The date and time are formatted in a specific way:

YEAR (4 digits); MONTH (2 digits); DAY (2 digits); HOUR (2 digits); MINUTE (2 digits); SECOND (2 digits); MILLISECOND (3 digits, optional)

By this notations, the following 2 timestamps are formatted correctly:

  • 20130226181722 (26-2-2013 18:17:22)

  • 20130226181722455 (26-2-2013 18:17:22.455)

In addition, the following operators can be used combined with the argument:

  • =
    Commences playback on exactly the given date and time.

  • =>
    Commences playback on the first available data after the given date and time.

  • =< Commences playback on the last available data before the given date and time.

Example

rtsp://172.21.240.91/VDG-Tutorial?device=3&timestamp=>20170226181722

The request above will play video from camera 3 from 26-2-2017 18:17:22 or later.

Note: Transcoding playback data is not supported!

Authentication

After initiating an RTSP stream, the server will require a username and password. These are identical to those set within the Sense Plugin Manager, please note that the Sense user needs to have sufficient permission for the camera which is requested. Both the username and password are case-sensitive. Figure 3 illustrate the login procedure within VLC media player.

Figure 3: Logging in on the RTSP server.

Dual Streaming

By providing a width URI parameter, it’s possible to make use of the dual streaming capabilities of a device. 

Example

  • Dual stream url:
    rtsp://
    /?device=&width=320
    The width parameter is send to the server, the server determines the correct stream, based on the dual stream setting for the max panel width. No transcoding is performed.

Transcoding

The supplied video can be transcoded. In that case the video will always be supplied in JPEG format, and can be adjusted for the required height, width, quality and bandwidth, if specified. This can be accomplished by combining the transcode (do or do not transcode), width (videowidth) and height videoheight) arguments within the URL.

Note: Transcoding playback data is not supported

Whether to do or do not transcode is identified by the server using a 0 (do not) or 1 (do) value. The video’s height and width are given in pixels.

URI

Type

Description

URI

Type

Description

transcode

 Boolean (0|1)

 If set to 1, image will be transcoded

bandwidth

 Integer (Kb/s)

 Set the maximum bandwidth

width

 Integer (pixel)

 Video width in pixels

height

 Integer (pixel)

 Video height in pixels

quality

 Integer (percentage)

 Quality of the RTSP stream (default 70)

fittopanel

 Boolean (0|1)

 Add black bars if requested image height/width does not correspond with video resolution

Examples

  • Transcode stream url:
    rtsp://
    /?device=&width=320&height=240&transcode=1
    The width, height and transcode parameters are send to the server, the server determines the correct stream, based on the dual stream setting for the max panel width. The stream is transcoded to a JPEG stream with the requested width and height, but it keeps the original aspect-ratio.

     

  • Transcoding over limited bandwidth url:
    rtsp://
    /?device=&width=320&height=240&transcode=1&bandwidth=32
    The stream is transcoded to half the requested width and height, balanced over the limited bandwidth, and keeps the original aspect-ratio.
    The resulting frame-rate will differ and be irregular compared to the original frame-rate, due to the load-balancing.