Ajax Video SDK is a toolkit designed to integrate Ajax video surveillance into third-party software. It allows developers to stream live and recorded video from Ajax video devices and manage video streams within their own interfaces.
This toolkit is intended for software developers who need to embed Ajax video into their apps and ensure stable video streaming.
Overview
Ajax Video SDK enables developers to stream live and recorded video from Ajax video devices. It uses a two-tier architecture:
- REST API — used to authenticate and retrieve resources (spaces, video devices, channels, and video tokens).
- gRPC SDK — used to start and control video streams with tokens obtained from the REST API.
Ajax Video SDK launches a local gRPC service that manages video streaming. The app connects to the service to start and control video streams and receives an RTSP URL that can be used to play video in a compatible player.
Key features
Ajax Video SDK provides the following features:
- Live streaming via RTSP.
- Archive playback via RTSP.
- Archive control:
- selecting a time range,
- navigating to a specific date and time,
- navigating an archive using a calendar (client-side navigation),
- retrieving metadata for the selected range, including a timeline and detections.
- Stream quality selection (MAIN/SUB).
Ajax Video SDK structure
The Ajax Video SDK archive includes the SDK library, .proto files defining the gRPC API, and C++ demo apps with source code that can be used to test SDK functionality and serve as a practical example of its use.
System requirements
| OS | Minimum version |
| Windows (64-bit) | Windows 10 |
| macOS | macOS 11 |
| Linux | Ubuntu 24.04 |
Ajax Video SDK is implemented in C/C++ and can be integrated directly into C++ apps.
The toolkit can also be used with any programming language that supports gRPC: it is required to run the SDK as a local service and connect to it via gRPC.
Integration flow
To access Ajax Video SDK, fill out the request form. The Ajax team will contact you and provide an archive containing SDK files for your operating system.
Step-by-step integration instructions are included in the README file that comes with the SDK.
To start using Ajax Video SDK:
- Authenticate using one of the supported methods.
- Find the required space.
- Retrieve the required edge and channel IDs via the Ajax API. You can request the list of all devices in the space and identify the channel by its name.
- Ensure that your account has the required permissions to access the selected channel. Video streaming is available only for channels that the user or company has access to.
- Generate a video player access token using the required edge and channel IDs.
- Initialize the SDK to start a local gRPC server.
- Open a gRPC stream (LiveStreaming or ArchiveStreaming) using the generated video token.
- Get an RTSP URL from the SDK and use it to play video in a compatible player.
- Maintain the session by refreshing the session and video tokens before they expire.
Authentication methods
Ajax Video SDK supports two authentication methods:
- User authentication — requires logging in and provides a session token and a refresh token.
- Company token — allows access without logging in using a pre-issued token.
Access to video streams depends on the permissions associated with the authenticated user or company. Permissions are validated on the Ajax Cloud side. If the user or company does not have access to a specific channel, the stream cannot be retrieved.
The authentication method defines how API requests are authorized and which endpoints are used.
Token management
Tokens used in Ajax Video SDK have a limited lifetime and must be refreshed:
- Session token — must be refreshed periodically (approximately every 30 minutes).
- Video token — must be refreshed during an active stream via the gRPC connection.
Failure to refresh tokens may result in interrupted video streaming.
Video streaming flow
The video streaming process is as follows:
App → REST API → SDK (gRPC) → RTSP → Video player.
Ajax Video SDK handles communication with Ajax services and provides a local streaming endpoint, while the app is responsible for playback.
The number of simultaneous video streams is limited: up to 16 streams per user and up to 2 streams per camera.