Using Cloud RTSP from Alta Video
Last modified: Wednesday November 22, 2023.
You can use the Avigilon Alta Cloud RTSP service to view video from Alta Video Cloud directly from your application. This service allows you to request video streams from an Avigilon Alta deployment using real time streaming protocol over TLS (RTSPS).
The Avigilon AltaCloud RTSP feature uses secured real time streaming protocol, and so must only be used with applications that support real time streaming protocol over TLS(RTSPS).
This service takes care of requesting the streams using the Alta Video Cloud API's and handles the media path negotiations to the source of the video stream.
Item | Description |
---|---|
The client application makes an RTSPS request to the Cloud RTSP service. | |
The Cloud RTSP service uses the credentials from that RTSPS request to authenticate with the Alta Video Cloud deployment. | |
After successfully authenticating, Cloud RTSP performs the API requests to the Alta Video Cloud deployment to set up the required WebRTC stream. This includes information about the camera to stream, whether it is a live stream or playback, the time to start the playback, as well as other parameters. | |
The WebRTC negotiation includes the Smart Path negotiation, with the client end being the Cloud RTSP service. | |
Media flows from the requested device to the Cloud RTSP service. The Cloud RTSP service then sends the video data to the client application using RTSPS. |
Use the Alta Video Cloud API to collect the information needed to form the RTSPS URL needed to request and stream the video from an Alta Video Cloud deployment to your application.
URL structure
The URL is in the format: rtsps://<deploymentname>.stream.<region>.alta.avigilon.com:322/<streamMode>?deviceId=<deviceId>&<parameters>
For example, to view live video from https://example.us1.alta.avigilon.com:
rtsps://example.stream.us1.alta.avigilon.com:322/deviceStreams?deviceId=a1a1a1a1a1a1-a1a1-a1a1-a1a1-a1a1a1a1a1a1&height=360&width=720
To view video playback from https://example.us1.alta.avigilon.com:
rtsps://example.stream.us1.alta.avigilon.com:322/devicePlayback?deviceId=a1a1a1a1a1a1-a1a1-a1a1-a1a1-a1a1a1a1a1a1&startTimestamp=2022-09-28T07:20:00.00Z
Where:
- Only RTSPS streams encrypted with TLS, running on port 322, are allowed.
- <deployment> is the first part of the name of your Alta Video deployment. This is the information at the beginning of the URL you use at access your Alta Video Cloud deployment, or that you use to log into the Alta Video mobile app.
- <region> to keep the shortest routing of the video, use the region to which your deployment is associated. For example, us1 or eu1.
- <streamMode> is deviceStreams for viewing live video, or devicePlayback to view historic video.
- <deviceId> is the GUID for the camera to stream.
- <parameters> are the additional information needed for your chosen stream. For example:
- When streaming live video, you can optionally specify the height and width for the stream, for example, &height=360&width=720.
- When playing back historic video, specify the time that the video should start, for example, &startTimestamp=2021-09-23T07:20:00.00Z
- Authentication of the application user is done via the credentials supplied with the RTSPS request. The same credentials can be used for the RTSPS and other API requests.
The
RTSP stream users credentials used for local streaming do not work for Cloud RTSP.You can take the URL you use to connect to your Alta Video deployment, and edit it by replacing https with rtsps, and then adding .rtsp between the deployment name and the region. You then need to add the <streamMode>, <deviceId>, and <parameters> for your chosen RTSP stream.
Any existing streams set up with the previous format for defining the cloud RTSP streams will continue to function, but any new streams being configured should use the format given in this topic, as the older format has been deprecated.
To embed the username and password into the RTSP URL, edit the string to include <username>:<password>@ immediately before the deployment information, as follows: rtsps://<username:password>@<deploymentname>.stream.<region>.alta.avigilon.com:322/<streamMode>?deviceId=<deviceId>&<parameters>
For security reasons, you might prefer to not embed the user credentials in the URL, and to rely on any credentials dialog within the application that is consuming the RTSP streams.
When entering the email address used as the user name within the URL, replace the
Example: rtsps://user%40example.com:<password>@<deploymentname>.stream.<region>.alta.avigilon.com:322/<streamMode>?deviceId=<deviceId>&<parameters>
Use the credentials for a configured Alta Video user that has the relevant permissions for the selected device.
Required permissions
When using the Cloud RTSP service, ensure that the Alta Video user account used to with the Cloud RTSP service has the relevant permissions:
View device information permission for the relevant device.- For streaming of live video — the Alta Video Cloud user account must include the
View live video general permission for the relevant device. - For playback of historic video — the Alta Video Cloud user account must include the
View historic video general permission for the relevant device. - Additionally, the user must have access to the relevant Alta Video tools:
Devices ,Video view ,Alarms ,Rules ,Search , orCounts .