Accessing zed x one stereo virtual camera with python api

I have a pair of zed x one cameras in stereo configuration and am unable to access the stereo virtual camera with the python api.

This is my test script:

import pyzed.sl as sl

print(f'SDK VERSION: {sl.Camera.get_sdk_version()}')
camera_list = sl.Camera.get_device_list()
print(f'CAMERAS: {camera_list}')

Output:

SDK VERSION: 5.0.1
CAMERAS:

For background:

  • The virtual camera configuration has been set up in the ZED Media Server and saved (this results in a new file being created in the directory where ZED_Media_Server was run, named ‘’$‘\001’ that contains: {“102836226”:{“FPS”:30,“HDR”:0,“Height”:1200,“IMU”:true,“Left”:301398000,“Port”:
    30000,“Right”:304038312,“Width”:1920}})
  • Calibration has been completed successfully, the resulting file has been renamed SN102836226.conf and moved to /usr/local/zed/settings
  • When ZED_Media_Server is run from the same directory as ''$'\001', the log contains the line: [ZEDMediaServer] Loading virtual camera configuration S/N 102836226
  • ZED Depth Viewer is unable to access the virtual stereo camera

System:

  • Setup: ZED Box Orin NX and two ZED X One cameras, connected with GMSL2, in stereo configuration
  • ZED Driver: stereolabs-zedbox-duo
  • ZED SDK version: 5.0.1

What I’ve done to attempt to resolve the issue:

I tried streaming the cameras using ZED Media Server (even though I would like to not have to use streaming to access the cameras) and accessing them with ZED_Depth_Viewer.

In ZED_Media_Server GUI I made sure “Enable Media Server Deamon” toggle was set to on then pressed “Stream” for the virtual camera. I closed the GUI. This was the end of the output:

[Streaming] Streaming is now running....
[VirtualCameraStreamer] --> Exit <--
[ZEDMediaServer] Restarting Media Server
[ZEDMediaServer] Activate CLI mode

I then ran ZED_Depth_Viewer and selected the Streaming icon, I input the ZED_Media_Server stream settings.

ZED_Depth_Viewer did not succeed in opening the camera, this is the output:

[Streaming] Warning: Failed to retrieve camera settings from sender
[Streaming] Error: Stream Opening returned TIMEOUT (350)
[Streaming] Metadata timeout. the size is equal to -1 instead of 21960. Skipping.
[2025-06-16 21:19:30 UTC][ZED][WARNING] FAILURE in sl::ERROR_CODE sl::Camera::open(sl::InitParameters)

Hi @jlrk
Welcome to the Stereolabs community.

I recommend you use the latest ZED SDK v5.0.2 GA that was released yesterday. It introduces many fixes to the ZED Media Server application.

This only works with physical cameras. It does not detect virtual streams.

Can you please paste the settings that you are using on both applications?

Thank you for the suggestions! I installed SDK v5.0.2 and this did allow ZED Depth viewer to access the virtual camera, although the calculated point cloud is low confidence.

Questions I have now are:

  • Is streaming the only way to access the zed x one virtual stereo camera locally? If so, how much latency does this introduce into the system? (this page mentions streaming locally but doesn’t specify that it is the only option or discuss latency)
  • How can the confidence values of the depth points be increased? Is this related to the Self-Calibration and CAMERA NOT INITIALIZED warnings reported by Zed Depth Viewer?

Here is the response to your request for more information:

In ZED Media Server GUI:

  1. Virtual Cam S/N: 106374888 Left Sensor: 301398000 Right Sensor 304038312 Resolution (this has no box for input) Port: 30000

  2. Press Save → Popup stating “Configuration has been saved in /usr/local/zed/settings/virtual_Xone_config.json”

  3. Ensure Media Server Deamon is toggled to on

  4. Press Stream → “Streaming”, output to cmd:

    [Streaming] Streaming is now running.... 
    
  5. Close GUI → Output to cmd

    [VirtualCameraStreamer] --> Exit <--
    [ZEDMediaServer] Restarting Media Server
    [ZEDMediaServer] Activate CLI mode
    [ "Wed Jun 18 21:09:54 2025" ]   Process  "sudo systemctl restart zed_media_server_cli.service" outputs  "Warning: The unit file, source configuration file or drop-ins of zed_media_server_cli.service changed on disk. Run 'systemctl daemon-reload' to reload units.\n"
    

In shell:

$ systemctl daemon-reload
$ cd /usr/local/zed/settings
$ more virtual_xone_config.json 
{"106374888":{"FPS":30,"HDR":0,"Height":1200,"IMU":true,"Left":301398000,"Port":30000,"Right":304038312,"Width":1920}}
$ mv SN102836225.conf SN106374888.conf
$ cd -

In ZED Depth Viewer

  1. Does not progress from “Waiting for Camera” on its own
  2. Press Streaming Icon, settings: IP Address: 127.0.0.1, Port 30000 → output to shell:
[2025-06-18 21:33:31 UTC][ZED][INFO] Logging level INFO
[ZED][Streaming] Switching to SHM-boost backend input
[Streaming] Warning : receiving port 30000 is not available (already used)... switching to port 30002. Retrying...
[Streaming] No backward compatibility required.
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 279 
NvMMLiteBlockCreate : Block : BlockType = 279 
[2025-06-18 21:33:31 UTC][ZED][INFO] [Init]  Depth mode: NEURAL LIGHT
[2025-06-18 21:33:31 UTC][ZED][INFO] [Init]  Serial Number: S/N 106374888
[2025-06-18 21:33:32 UTC][ZED][WARNING] [Init]  Self-calibration skipped. Scene may be occluded or lack texture. (Error code: 0x02) 
[2025-06-18 21:33:42 UTC][ZED][WARNING] CAMERA NOT INITIALIZED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
[2025-06-18 21:33:50 UTC][ZED][WARNING] CAMERA NOT INITIALIZED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
[2025-06-18 21:33:59 UTC][ZED][WARNING] CAMERA NOT INITIALIZED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
[2025-06-18 21:34:07 UTC][ZED][WARNING] CAMERA NOT INITIALIZED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
[2025-06-18 21:34:15 UTC][ZED][WARNING] CAMERA NOT INITIALIZED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 277)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 379)
[2025-06-18 21:34:24 UTC][ZED][WARNING] CAMERA NOT INITIALIZED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)

The view is changed to a screen with the camera feed in the upper left, depth at bottom and point cloud visualization on the right. The depth and point cloud screens are nearly empty until “Confidence 95” is unselected. The scene is an office wall with a person sitting at the computer in the foreground, about 2m away (the baseline of the stereo pair according to stereo calibration is Baseline = 222.755 which should have 1cm error at 2m according to this chart.

Yes, it is. The latency is about 100 msec. I recommend using 127.0.0.1 as the connection address to leverage memory sharing and minimize latency.

A good initial calibration is required.

Thanks for the info on streaming being required and the latency. I’ll start another thread to look into the ZED Depth Viewer calibration issue.

1 Like