Using the Video API
The ZED API provides low-level access to the camera hardware and video features, facilitating camera control and high-quality video recording and streaming.
Camera Configuration
To configure the camera, create a Camera object and specify your InitParameters. Initial parameters let you adjust camera resolution, FPS, depth sensing parameters and more. These parameters can only be set before opening the camera and cannot be changed while the camera is in use.
InitParameters contains a default configuration.
Camera settings such as exposure, white balance and others can be manually set at runtime using setCameraSettings().
To see the list of available video modes and settings, read Camera Controls.
Identifying the Camera Model
The camera model is reported as an sl::MODEL value. Depending on what you have at hand, there are three ways to get it:
- From an opened camera or an SVO file, with
getCameraInformation(). - From a connected camera, without opening it, with
getDeviceList(). - From the serial number only, for example the one printed on the camera label or in the name of a calibration file (
SNxxxxxxx.conf).
From an opened camera or an SVO file
Once the camera is opened, getCameraInformation() returns its model and serial number. This also works when playing back an SVO file: the values are the ones of the camera that recorded it.
When using a monocular camera through the CameraOne class, getCameraInformation() provides the same camera_model and serial_number fields.
From a connected camera, without opening it
The static getDeviceList() method lists the connected cameras with their model and serial number, without opening them. Use it to choose which camera to open with InitParameters.input.setFromSerialNumber(), as described in Multi-Camera.
Camera::getDeviceList() lists stereo cameras only. ZED X One cameras are listed by CameraOne::getDeviceList() (C++ and Python).
From the serial number only
The serial number of a ZED camera encodes its model: the model is the serial number divided by 10,000,000 (integer division), and the result is the value of the sl::MODEL enum. For example, the serial number 31234567 belongs to a ZED 2i (31234567 / 10000000 = 3 = MODEL::ZED2i), and 301234567 to a ZED X One GS (30 = MODEL::ZED_XONE_GS).
The sl::MODEL values are the same in all the APIs. Model IDs that are not in the table do not correspond to a known camera model, so the following functions check the result against the list of known models.
New camera models are added to sl::MODEL with new releases of the ZED SDK. If a serial number does not match any model of your ZED SDK version, update the ZED SDK.
Image Capture
To capture images from the ZED, specify your RuntimeParameters and call grab() to grab a new frame and retrieveImage() to retrieve the grabbed frame. retrieveImage() lets you select between different views such as left, right, unrectified and grayscale images.
Video Recording
The ZED SDK uses StereoLabs’ SVO format to store videos along with additional metadata such as timestamps and sensor data. An SVO file only holds the raw unrectified images and the sensor data: depth, rectification and all other processing are performed live by the ZED SDK when the file is played back. See What an SVO File Contains for details.
To record SVO files, you need to enable the Recording module with enableRecording(). Specify an output file name (eg: output.svo) and SVO_COMPRESSION_MODE, then then call grab(): each grabbed frame is added to the SVO file. SVO lets you record video and associated metadata (timestamp, IMU data and more if available).
Video Playback
To play SVO files, simply add the file path as an argument in setFromSVOFile(). When loading SVO files, the ZED API will behave as if a ZED was connected and a live feed was available. Every module of the ZED API will be available: depth, tracking, spatial mapping and more, regardless of what was enabled during the recording session. When an SVO file is read entirely, END_OF_SVOFILE_REACHED error code is returned.
Local Streaming
To learn how to stream stereo video on the local network using the ZED SDK, read Local Streaming section.
Code Examples
Get started with stereo video capture, recording and streaming using the following code samples on GitHub:

