SVO Recordings from ROS2 service calls seem to be corrupted sometimes

Hi @Myzhar, I am using the zed multi camera launch file to launch 3 ZED Cameras. I then make ROS2 service calls to each of the cameras, to start and stop the SVO recordings. The SVO recordings that get saved seem to be corrupted on some occasions or have only 1 frame in the recording.

Note: It was observed that when using pyzed or ZED_Explorer to record the SVOs, I didn’t seem to find any issues with the SVO files being corrupt.

Hi @abhishekpavani
how do you call the service? What parameters do you use?

Hi @Myzhar ,

I first launch the camera using

ros2 launch zed_wrapper zed_camera.launch.py serial_number:=52408201 camera_model:=zedxm stream_address:=192.168.10.40 stream_port:=30000 namespace:=onboard_sensors camera_name:=gripper_right

Then, I start the SVO recording by running the following in the terminal

ros2 service call /onboard_sensors/gripper_right/start_svo_rec zed_msgs/srv/StartSvoRec "{bitrate: 7000, 
compression_mode: 2, target_framerate: 60, input_transcode: true, svo_filename: 
'output.svo2'}"

Note: I have tried experimenting with different bitrate values upto 20000 as well as tried different compression modes.

To stop the service I have been running,

ros2 service call /onboard_sensors/gripper_right/stop_svo_rec std_srvs/srv/Trigger "{}"

Here are an update from some more experiments that I ran:

  1. I observe that once I launch the camera using zed_camera.launch.py and make the service calls like above to start the svo recording and then stop it, I see that the SVOs get saved properly the very first time I make the call. After stopping the recording if I start the recording again, the subsequent recordings all have just 1 frame in them. This is particularly true for the streaming cameras only.
  2. I tried running the same experiment directly on the jetson where streaming is disabled and GMSL cameras are directly connected to the jetson, the SVOs get recorded without any data corruption(i.e having only 1 frame in the recording). Based on this I can say that there is some issue when it comes to streaming cameras and then making the ros service call to start and stop the svo recording multiple times in succession.

When replaying the svo files with only 1 frame in the ZED_Explorer, I see the following
[2025-04-28 18:06:22 UTC][ZED][WARNING] Frame with index 0 not found in SVO2 file.

I have shared the data on support@stereolabs.com for you to have a look at.

Update: Setting the streaming bitrate to 0 both while streaming as well as while making the ros service call helped us solve the issue. While the SVOs are recorded properly, I see that when i replay the SVOs in ZED_Explorer, they seem to have been playing at “2x” instead of the original speed. Any thoughts on why this maybe happening?

Also a followup on the bitrate issue is that, even when setting the value to 0, should we also make sure that the parameters in common_stereo.yaml reflect the same values as that of the ros service call?
For example, the streaming bitrate is set to 12500 by default in the common_stereo.yaml. So does passing in a bitrate of 0 while making the ROS service call, override the value in common_stereo.yaml?

This is expected. ZED Explorer does not use “realtime” mode when replaying SVO2

No, they are overwritten by the service call.

This is expected. ZED Explorer does not use “realtime” mode when replaying SVO2

Is there any other way of replaying the SVO in “realtime” mode if not the ZED explorer?

Additionally there is another issue I have found while recording the SVOs. Some frames seem to have been shifted towards the right as shown in the first image. I have also shared how all the other frames look like in the SVO. Any idea on why this could be happening?


You can use ZED Depth Viewer

This problem affects the USB cameras; it happens when the USB 3 controller buffer is full because the host’s CPU is overloaded, and frames are not processed quickly enough.

You can use ZED Depth Viewer

The ZED Depth Viewer (v 5.0.0) has a problem replaying the SVO files. I do not see the point clouds nor the images in the viewer

This problem affects the USB cameras; it happens when the USB 3 controller buffer is full because the host’s CPU is overloaded, and frames are not processed quickly enough

Is there a way to get around this problem without changing resolution or frame rate?