The SVO file format is a proprietary format that can only be read by the ZED SDK and its tools. It stores the unrectified images of the camera along with metadata such as timestamps, sensor data (IMU, barometer, magnetometer, when available), and, starting with the SVO2 format introduced in ZED SDK 4.1, high-frequency sensor data and user-defined custom data.
SVO/SVO2 is the only video format accepted as an input by the ZED SDK; other video formats (AVI, MP4, etc.) cannot be used with the SDK. However, you can easily export an SVO file to standard formats for external use.
SVO Export sample
The ZED SVO Export sample demonstrates how to convert an SVO file into:
- an AVI video (side-by-side LEFT+RIGHT, or LEFT+DEPTH view)
- a PNG image sequence (LEFT+RIGHT, LEFT+DEPTH view, or LEFT+DEPTH 16-bit)
The 16-bit depth sequence stores the depth values in millimeters as 16-bit PNG files, useful for offline processing of metric depth data.
The sample is available in C++, Python, and C# on GitHub: https://github.com/stereolabs/zed-sdk/tree/master/recording/export/svo
A copy is also installed with the ZED SDK in the local samples folder:
- Windows:
C:\Program Files (x86)\ZED SDK\samples\recording\export\svo - Linux:
/usr/local/zed/samples/recording/export/svo
Export modes
| Mode | Output |
|---|---|
| 0 | LEFT+RIGHT AVI video |
| 1 | LEFT+DEPTH view AVI video |
| 2 | LEFT+RIGHT PNG image sequence |
| 3 | LEFT+DEPTH view PNG image sequence |
| 4 | LEFT+DEPTH 16-bit PNG image sequence |
Using the C++ tool
The sample is a command line tool with the following syntax:
ZED_SVO_Export <input SVO file> <output AVI file or output folder> <mode>
Notes:
- For modes 0 and 1, the second parameter is the path of the AVI file to be created.
- For modes 2, 3, and 4, the second parameter is the path of an existing output folder and it must end with
/(Linux) or\(Windows).
Examples:
Windows (from the folder containing the built executable):
ZED_SVO_Export.exe "C:\path\to\your\file.svo2" "C:\Users\YOUR-USER-NAME\Desktop\output.avi" 0 ZED_SVO_Export.exe "C:\path\to\your\file.svo2" "C:\Users\YOUR-USER-NAME\Desktop\sequence\" 2
Linux (from your build directory):
./ZED_SVO_Export "/path/to/your/file.svo2" "/home/YOUR-USER-NAME/Desktop/output.avi" 0 ./ZED_SVO_Export "/path/to/your/file.svo2" "/home/YOUR-USER-NAME/Desktop/sequence/" 4
Using the Python script
The same conversion can be performed with the Python script svo_export.py, without compiling anything:
python svo_export.py --mode <mode> --input_svo_file <input.svo2> --output_avi_file <output.avi> python svo_export.py --mode <mode> --input_svo_file <input.svo2> --output_path_dir <existing/output/folder>
-
--output_avi_fileis required for modes 0 and 1. -
--output_path_diris required for modes 2, 3, and 4, and must point to an existing folder.
Examples:
python svo_export.py --mode 0 --input_svo_file recording.svo2 --output_avi_file output.avi python svo_export.py --mode 4 --input_svo_file recording.svo2 --output_path_dir ./depth_sequence/
Exporting to MP4 or other video formats
The sample uses OpenCV VideoWriter to generate the AVI file. If you want to export to another container/codec (for example MP4), you can modify the codec settings in the sample code; depending on your platform, this may require an OpenCV build with FFmpeg support (WITH_FFMPEG). Alternatively, you can convert the generated AVI file with FFmpeg:
ffmpeg -i output.avi -c:v libx264 output.mp4
Other export samples
The ZED SDK also provides samples to export other types of data:
- PLY point clouds: depth sensing sample
- OBJ 3D meshes from spatial mapping: spatial mapping sample
- Sensor data as JSON: sensors export sample
- Body tracking data as JSON or FBX: body tracking export samples
Support
If you need assistance with SVO export, please visit our community forum at https://community.stereolabs.com/.