GStreamer - ZED Camera Source
GStreamer - ZED Camera Source
The ZED Camera Source, zedsrc GStreamer element, is the main plugin of the package. It allows injecting ZED data into a GStreamer pipeline and accessing the information provided by the ZED SDK.
Properties
The following listing is the output of gst-inspect-1.0 zedsrc on a desktop Linux machine with ZED SDK 5.5.
area-file-path : Area localization file that describes the surroundings, saved from a previous tracking session.flags: readable, writableString. Default: ""async-grab-camera-recovery: Async Grab Camera Recoveryflags: readable, writableBoolean. Default: falseasync-image-retrieval: Async Image Retrievalflags: readable, writableBoolean. Default: falseblocksize : Size in bytes to read per buffer (-1 = default)flags: readable, writableUnsigned Integer. Range: 0 - 4294967295 Default: 4096bt-allow-red-prec : Set to TRUE to enable Body Tracking reduced inference precisionflags: readable, writableBoolean. Default: falsebt-body-fitting : Set to TRUE to enable Body Tracking model fittingflags: readable, writableBoolean. Default: truebt-body-tracking : Set to TRUE to enable body tracking across images flowflags: readable, writableBoolean. Default: truebt-confidence : Minimum Detection Confidenceflags: readable, writableFloat. Range: 0 - 100 Default: 20bt-detection-model : Body Tracking Modelflags: readable, writableEnum "GstZedSrcBtModel" Default: 1, "Body Tracking MEDIUM"(0): Body Tracking FAST - Keypoints based, specific to human skeleton, real time performance even on Jetson or low end GPU cards(1): Body Tracking MEDIUM - Keypoints based, specific to human skeleton, compromise between accuracy and speed(2): Body Tracking ACCURATE - Keypoints based, specific to human skeleton, state of the art accuracy, requires powerful GPUbt-enabled : Set to TRUE to enable Body Trackingflags: readable, writableBoolean. Default: falsebt-format : Body Tracking formatflags: readable, writableEnum "GstZedSrcBtFormat" Default: 1, "Body 34 Key Points"(0): Body 18 Key Points - 18 keypoints format. Basic Body format(1): Body 34 Key Points - 34 keypoints format. Body format, requires body fitting enabled(2): Body 38 Key Points - 38 keypoints format. Body format, including feet simplified face and handsbt-max-range : Maximum Detection Rangeflags: readable, writableFloat. Range: -1 - 20000 Default: 20000bt-min-keypoints : Specify the Minimum keypoints threshold.flags: readable, writableInteger. Range: 0 - 70 Default: 5bt-prediction-timeout-s: Body Tracking prediction timeout (sec)flags: readable, writableFloat. Range: 0 - 1 Default: 0.2bt-smoothing : Smoothing of the fitted fused skeletonflags: readable, writableFloat. Range: 0 - 1 Default: 0camera-disable-self-calib: Disable the self calibration processing when the camera is openedflags: readable, writableBoolean. Default: falsecamera-fps : Camera frame rateflags: readable, writableEnum "GstZedSrcFPS" Default: 15, "15 FPS"(120): 120 FPS - only SVGA (GMSL2) resolution(100): 100 FPS - only VGA (USB3) resolution(60): 60 FPS - VGA (USB3), HD720, HD1080 (GMSL2), and HD1200 (GMSL2) resolutions(30): 30 FPS - VGA (USB3), HD720 (USB3) and HD1080 (USB3/GMSL2) resolutions(15): 15 FPS - all resolutions (NO GMSL2)camera-id : Select camera from cameraIDflags: readable, writableInteger. Range: 0 - 255 Default: 0camera-image-flip : Use the camera in forced flip/no flip or automatic modeflags: readable, writableEnum "GstZedSrcFlip" Default: 2, "Auto"(0): No Flip - Force no flip(1): Flip - Force flip(2): Auto - Auto mode (ZED2/ZED2i/ZED-M only)camera-resolution : Camera Resolutionflags: readable, writableEnum "GstZedSrcRes" Default: 6, "Default value for the camera model"(0): HD2K (USB3) - 2208x1242(1): HD1080 (USB3/GMSL2) - 1920x1080(2): HD1200 (GMSL2) - 1920x1200(3): HD720 (USB3) - 1280x720(4): SVGA (GMSL2) - 960x600(5): VGA (USB3) - 672x376(6): Default value for the camera model - Automaticcamera-sn : Select camera from camera serial numberflags: readable, writableInteger64. Range: 0 - 9223372036854775807 Default: 0confidence-threshold: Specify the Depth Confidence Thresholdflags: readable, writableInteger. Range: 0 - 100 Default: 50coordinate-system : 3D Coordinate Systemflags: readable, writableEnum "GstZedsrcCoordSys" Default: 0, "Image"(0): Image - Standard coordinates system in computer vision. Used in OpenCV.(1): Left handed, Y up - Left-Handed with Y up and Z forward. Used in Unity with DirectX.(2): Right handed, Y up - Right-Handed with Y pointing up and Z backward. Used in OpenGL.(3): Right handed, Z up - Right-Handed with Z pointing up and Y forward. Used in 3DSMax.(4): Left handed, Z up - Left-Handed with Z axis pointing up and X forward. Used in Unreal Engine.(5): Right handed, Z up, X fwd - Right-Handed with Z pointing up and X forward. Used in ROS (REP 103).ctrl-aec-agc : Camera automatic gain and exposureflags: readable, writableBoolean. Default: truectrl-aec-agc-roi-h : Auto gain/exposure ROI height (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 1242 Default: -1ctrl-aec-agc-roi-side: Auto gain/exposure ROI sideflags: readable, writableEnum "GstZedsrcSide" Default: 2, "BOTH"(0): LEFT - Left side only(1): RIGHT - Right side only(2): BOTH - Left and Right sidectrl-aec-agc-roi-w : Auto gain/exposure ROI width (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 2208 Default: -1ctrl-aec-agc-roi-x : Auto gain/exposure ROI top left 'X' coordinate (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 2208 Default: -1ctrl-aec-agc-roi-y : Auto gain/exposure ROI top left 'Y' coordinate (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 1242 Default: -1ctrl-brightness : Image brightnessflags: readable, writableInteger. Range: 0 - 8 Default: 4ctrl-contrast : Image contrastflags: readable, writableInteger. Range: 0 - 8 Default: 4ctrl-exposure : Camera exposureflags: readable, writableInteger. Range: 0 - 100 Default: 80ctrl-exposure-range-max: Maximum exposure time in microseconds for the automatic exposure settingflags: readable, writableInteger. Range: 28 - 66000 Default: 66000ctrl-exposure-range-min: Minimum exposure time in microseconds for the automatic exposure settingflags: readable, writableInteger. Range: 28 - 66000 Default: 28ctrl-gain : Camera gainflags: readable, writableInteger. Range: 0 - 100 Default: 60ctrl-gamma : Image gammaflags: readable, writableInteger. Range: 1 - 9 Default: 8ctrl-hue : Image hueflags: readable, writableInteger. Range: 0 - 11 Default: 0ctrl-led-status : Camera LED on/offflags: readable, writableBoolean. Default: truectrl-saturation : Image saturationflags: readable, writableInteger. Range: 0 - 8 Default: 4ctrl-sharpness : Image sharpnessflags: readable, writableInteger. Range: 0 - 8 Default: 4ctrl-whitebalance-auto: Image automatic white balanceflags: readable, writableBoolean. Default: truectrl-whitebalance-temperature: Image white balance temperatureflags: readable, writableInteger. Range: 2800 - 6500 Default: 4600depth-maximum-distance: Maximum depth valueflags: readable, writableFloat. Range: 500 - 40000 Default: 20000depth-minimum-distance: Minimum depth valueflags: readable, writableFloat. Range: 100 - 3000 Default: 300depth-mode : Depth Modeflags: readable, writableEnum "GstZedsrcDepthMode" Default: 0, "NONE"(6): NEURAL_PLUS - More accurate Neural disparity estimation, Requires AI module.(5): NEURAL - End to End Neural disparity estimation, requires AI module(4): NEURAL_LIGHT - End to End Neural disparity estimation (light), requires AI module(3): ULTRA - Computation mode favorising edges and sharpness. Requires more GPU memory and computation power.(2): QUALITY - Computation mode designed for challenging areas with untextured surfaces.(1): PERFORMANCE - Computation mode optimized for speed.(0): NONE - This mode does not compute any depth map. Only rectified stereo images will be available.depth-stabilization : Enable depth stabilizationflags: readable, writableInteger. Range: 0 - 100 Default: 1do-timestamp : Apply current stream time to buffersflags: readable, writableBoolean. Default: falseenable-area-memory : This mode enables the camera to remember its surroundings. This helps correct positional tracking drift, and can be helpful for positioning different cameras relative to one other in space.flags: readable, writableBoolean. Default: trueenable-image-enhancement: Enable Image Enhancementflags: readable, writableBoolean. Default: trueenable-image-validity-check: Enable Image Validity Checkflags: readable, writableBoolean. Default: trueenable-imu-fusion : This setting allows you to enable or disable IMU fusion. When set to false, only the optical odometry will be used.flags: readable, writableBoolean. Default: trueenable-pose-smoothing: This mode enables smooth pose correction for small drift correction.flags: readable, writableBoolean. Default: trueenable-positional-tracking: Enable positional trackingflags: readable, writableBoolean. Default: falsefill-mode : Specify the Depth Fill Modeflags: readable, writableBoolean. Default: falsegrab-compute-capping-fps: Grab Compute Capping FPSflags: readable, writableFloat. Range: 0 - 1000 Default: 0initial-world-transform-pitch: Pitch orientation of the camera in the world frame when the camera is startedflags: readable, writableFloat. Range: 0 - 360 Default: 0initial-world-transform-roll: Roll orientation of the camera in the world frame when the camera is startedflags: readable, writableFloat. Range: 0 - 360 Default: 0initial-world-transform-x: X position of the camera in the world frame when the camera is startedflags: readable, writableFloat. Range: -3.402823e+38 - 3.402823e+38 Default: 0initial-world-transform-y: Y position of the camera in the world frame when the camera is startedflags: readable, writableFloat. Range: -3.402823e+38 - 3.402823e+38 Default: 0initial-world-transform-yaw: Yaw orientation of the camera in the world frame when the camera is startedflags: readable, writableFloat. Range: 0 - 360 Default: 0initial-world-transform-z: Z position of the camera in the world frame when the camera is startedflags: readable, writableFloat. Range: -3.402823e+38 - 3.402823e+38 Default: 0input-stream-ip : Specify IP address when using streaming inputflags: readable, writableString. Default: ""input-stream-port : Specify port when using streaming inputflags: readable, writableInteger. Range: 1 - 65535 Default: 30000max-working-res-h : Maximum Working Resolution Heightflags: readable, writableInteger. Range: 0 - 10000 Default: 0max-working-res-w : Maximum Working Resolution Widthflags: readable, writableInteger. Range: 0 - 10000 Default: 0measure3D-reference-frame: Specify the 3D Reference Frameflags: readable, writableEnum "GstZedsrc3dMeasRefFrame" Default: 0, "WORLD"(0): WORLD - The positional tracking pose transform will contains the motion with reference to the world frame.(1): CAMERA - The pose transform will contains the motion with reference to the previous camera frame.name : The name of the objectflags: readable, writable, 0x2000String. Default: "zedsrc0"num-buffers : Number of buffers to output before sending EOS (-1 = unlimited)flags: readable, writableInteger. Range: -1 - 2147483647 Default: -1od-allow-reduced-precision-inference: Set to TRUE to allow inference to run at a lower precision to improve runtimeflags: readable, writableBoolean. Default: falseod-conf-animal : Animal Detection Confidence Thresholdflags: readable, writableFloat. Range: -1 - 100 Default: 35od-conf-bag : Bag Detection Confidence Thresholdflags: readable, writableFloat. Range: -1 - 100 Default: 35od-conf-electronics : Electronics Detection Confidence Thresholdflags: readable, writableFloat. Range: -1 - 100 Default: 35od-conf-fruit-vegetables: Fruit/Vegetables Detection Confidence Thresholdflags: readable, writableFloat. Range: -1 - 100 Default: 35od-conf-people : People Detection Confidence Thresholdflags: readable, writableFloat. Range: -1 - 100 Default: 35od-conf-sport : Sport Detection Confidence Thresholdflags: readable, writableFloat. Range: -1 - 100 Default: 35od-conf-vehicle : Vehicle Detection Confidence Thresholdflags: readable, writableFloat. Range: -1 - 100 Default: 35od-confidence : Minimum Detection Confidenceflags: readable, writableFloat. Range: 0 - 100 Default: 50od-custom-onnx-dynamic-input-shape-h: Object Detection Custom ONNX Dynamic Input Shape Heightflags: readable, writableInteger. Range: 0 - 10000 Default: 512od-custom-onnx-dynamic-input-shape-w: Object Detection Custom ONNX Dynamic Input Shape Widthflags: readable, writableInteger. Range: 0 - 10000 Default: 512od-custom-onnx-file : Object Detection Custom ONNX Fileflags: readable, writableString. Default: ""od-detection-filter-mode: Object Detection Filter Modeflags: readable, writableEnum "GstZedSrcOdFilterMode" Default: 2, "NMS3D_PER_CLASS"(0): NONE - SDK will not apply any preprocessing to the detected objects(1): NMS3D - SDK will remove objects that are in the same 3D position as an already tracked object (independant of class ID)(2): NMS3D_PER_CLASS - SDK will remove objects that are in the same 3D position as an already tracked object of the same class ID.od-detection-model : Object Detection Modelflags: readable, writableEnum "GstZedSrcOdModel" Default: 1, "Object Detection Multi class MEDIUM"(0): Object Detection Multi class FAST - Any objects, bounding box based(1): Object Detection Multi class MEDIUM - Any objects, bounding box based, compromise between accuracy and speed(2): Object Detection Multi class ACCURATE - Any objects, bounding box based, more accurate but slower than the base model(3): Person Head FAST - Bounding Box detector specialized in person heads, particularly well suited for crowded environments, the person localization is also improved(4): Person Head ACCURATE - Bounding Box detector specialized in person heads, particularly well suited for crowded environments, the person localization is also improved, more accurate but slower than the base model(6): Custom YOLO-like Box Objects - For internal inference using your own custom YOLO-like model. Requires od-custom-onnx-file property to be set.od-enable-tracking : Set to TRUE to enable tracking for the detected objectsflags: readable, writableBoolean. Default: trueod-enabled : Set to TRUE to enable Object Detectionflags: readable, writableBoolean. Default: falseod-instance-id : Object Detection Instance IDflags: readable, writableUnsigned Integer. Range: 0 - 4294967295 Default: 0od-max-range : Maximum Detection Rangeflags: readable, writableFloat. Range: -1 - 20000 Default: 20000od-prediction-timeout-s: Object prediction timeout (sec)flags: readable, writableFloat. Range: 0 - 1 Default: 0.2open-timeout-sec : Open Timeout Secondsflags: readable, writableFloat. Range: 0 - 600 Default: 5opencv-calibration-file: Optional OpenCV Calibration Fileflags: readable, writableString. Default: ""optional-settings-path: Optional Settings Pathflags: readable, writableString. Default: ""parent : The parent of the objectflags: readable, writable, 0x2000Object of type "GstObject"pos-depth-min-range : This setting allows you to change the minmum depth used by the SDK for Positional Tracking.flags: readable, writableFloat. Range: -1 - 65535 Default: -1positional-tracking-mode: Positional tracking modeflags: readable, writableEnum "GstZedsrcPtMode" Default: 0, "GEN_1"(0): GEN_1 - Generation 1(1): GEN_2 - Generation 2(2): GEN_3 - Generation 3remove-saturated-areas: Remove Saturated Areasflags: readable, writableBoolean. Default: falseroi : Enable region of interest filteringflags: readable, writableBoolean. Default: falseroi-h : Region of interest height (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 1242 Default: -1roi-w : Region of interest width (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 2208 Default: -1roi-x : Region of interest top left 'X' coordinate (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 2208 Default: -1roi-y : Region of interest top left 'Y' coordinate (-1 to not set ROI)flags: readable, writableInteger. Range: -1 - 1242 Default: -1sdk-gpu-id : SDK GPU IDflags: readable, writableInteger. Range: -1 - 128 Default: -1sdk-verbose : ZED SDK Verbose levelflags: readable, writableInteger. Range: 0 - 1000 Default: 0sdk-verbose-log-file: SDK Verbose Log Fileflags: readable, writableString. Default: ""sensors-required : Sensors Requiredflags: readable, writableBoolean. Default: falseset-as-static : Set to TRUE if the camera is staticflags: readable, writableBoolean. Default: falseset-floor-as-origin : This mode initializes the tracking to be aligned with the floor plane to better position the camera in space.flags: readable, writableBoolean. Default: falseset-gravity-as-origin: This setting allows you to override of 2 of the 3 rotations from initial-world-transform using the IMU gravity default: trueflags: readable, writableBoolean. Default: truestream-type : Image stream typeflags: readable, writableEnum "GstZedSrcStreamType" Default: -1, "Auto [prefer NV12 zero-copy]"(-1): Auto [prefer NV12 zero-copy] - Auto-negotiate format based on downstream (prefer NV12 zero-copy)(0): Left image [BGRA] - 8 bits- 4 channels Left image(1): Right image [BGRA] - 8 bits- 4 channels Right image(2): Stereo couple up/down [BGRA] - 8 bits- 4 channels bit Left and Right(3): Depth image [GRAY16_LE] - 16 bits depth(4): Left and Depth up/down [BGRA] - 8 bits- 4 channels Left and Depth(image)(5): Stereo couple left/right [BGRA] - 8 bits- 4 channels Left and Right side-by-sidesvo-file-path : Input from SVO fileflags: readable, writableString. Default: ""svo-real-time-mode : SVO Real Time Modeflags: readable, writableBoolean. Default: falsesvo-recording-compression: Compression mode for SVO recordingflags: readable, writableEnum "GstZedsrcSvoCompression" Default: 2, "H265"(0): LOSSLESS - Lossless (PNG/ZSTD, CPU)(1): H264 - H264 (GPU)(2): H265 - H265/HEVC (GPU)(3): H264_LOSSLESS - H264 Lossless (GPU)(4): H265_LOSSLESS - H265 Lossless (GPU)svo-recording-enable: Start/stop SVO recording at runtime (requires svo-recording-filename to be set)flags: readable, writableBoolean. Default: falsesvo-recording-filename: Output filename for SVO recording (.svo2 extension recommended)flags: readable, writableString. Default: ""texture-confidence-threshold: Specify the Texture Confidence Thresholdflags: readable, writableInteger. Range: 0 - 100 Default: 100typefind : Run typefind before negotiating (deprecated, non-functional)flags: readable, writable, deprecatedBoolean. Default: false
Jetson zero-copy NV12 stream types
On NVIDIA® Jetson™ platforms, when the plugin is built against ZED SDK v5.2 or newer, zedsrc exposes three extra stream-type values that deliver NV12 buffers in memory:NVMM without any CPU copy. They only work with GMSL2 cameras (ZED X, ZED X Mini, ZED X Nano):
(6):Raw NV12 zero-copy [NV12]- left image only(7):Raw NV12 stereo zero-copy [NV12]- left and right images side-by-side(8):Raw NV12 right zero-copy [NV12]- right image only
The default stream-type value (-1) (Auto [prefer NV12 zero-copy]) negotiates the format with the downstream element and selects the zero-copy NV12 path automatically when the pipeline and the camera support it, falling back to Left image [BGRA] otherwise.
stream-type=7 additionally requires the nvbufsurftransform library from the Jetson Multimedia API. If it is missing at build time, only stream-type=6 and stream-type=8 are available.
Example pipelines
Display the left image on the screen
This simple pipeline starts the ZED grabbing using the default parameters of the zedsrc element and automatically converts (autovideoconvert) the frames to the correct format for the fpsdisplaysink element so they can be displayed on the screen with FPS information.
gst-launch-1.0 zedsrc ! autovideoconvert ! queue ! fpsdisplaysink
The queue element is used to decouple frames into a separate queue thread, which is useful for data synchronization in more complex pipelines.
Display color stereo couple with VGA resolution at 100 FPS
This pipeline is the same as the previous example, but the properties of zedsrc are changed to set VGA resolution and 100 FPS while retrieving the synchronized stereo image.
gst-launch-1.0 zedsrc camera-resolution=5 camera-fps=100 stream-type=2 ! autovideoconvert ! queue ! fpsdisplaysink
Display depth map with HD720 resolution at 60 FPS
Again the same pipeline, but the parameters are changed to retrieve only the non-normalized depth map with HD720 resolution at 60 FPS.
gst-launch-1.0 zedsrc camera-resolution=3 camera-fps=60 stream-type=3 ! autovideoconvert ! queue ! fpsdisplaysink
H264 streaming over UDP on the local network
GStreamer is well known for providing an easy way to transmit media data over networks. TCP, UDP, RTP, and many other protocols are available, together with many encoding algorithms such as H264, H265, VP8, VP9, Matroska, etc.
The following gst-launch pipeline acquires an RGB stream from a ZED camera, displays it on the local machine and sends it over the network using the UDP protocol with H264 encoding:
gst-launch-1.0 zedsrc ! timeoverlay ! tee name=split has-chain=true ! \queue ! autovideoconvert ! fpsdisplaysink \split. ! queue max-size-time=0 max-size-bytes=0 max-size-buffers=0 ! autovideoconvert ! \x264enc byte-stream=true tune=zerolatency speed-preset=ultrafast bitrate=3000 ! \h264parse ! rtph264pay config-interval=-1 pt=96 ! queue ! \udpsink clients=192.168.1.169:5000 max-bitrate=3000000 sync=false async=false
- Line 1: the
zedsrcelement is left at its default configuration, so it acquires the left camera RGB data at the default resolution of the connected camera model. The timestamp is printed on the image using the timeoverlay element and the pipeline is split into two branches using tee. - Line 2: the first branch of the pipeline is used to display the frames on the local machine with FPS and timestamp information.
- Line 3: the second branch of the pipeline is decoupled with a queue and converted to a format suitable for the encoder.
- Line 4: the stream is encoded using the H264 encoder (x264enc) configured to reduce the latency to the minimum possible.
- Line 5: the H264 stream is parsed (h264parse) and an RTP payload is created (rtph264pay).
- Line 6: the RTP payload is sent using UDP (udpsink) to the client at address 192.168.1.169 (change the address according to your listener IP), which will be listening on port 5000.
the element queue max-size-time=0 max-size-bytes=0 max-size-buffers=0 is necessary to synchronize the two branches generated by the tee element, otherwise the stream gets frozen after a few milliseconds.
The receiver machine can acquire the stream using this simple pipeline:
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,clock-rate=90000,payload=96 ! \queue ! rtph264depay ! h264parse ! avdec_h264 ! \queue ! autovideoconvert ! fpsdisplaysink
- Line 1: a UDP source (udpsrc) is configured to listen on port 5000 for an RTP payload of type 96.
- Line 2: the payload is processed (rtph264depay) to extract the H264 data, which is then parsed (h264parse) and decoded (avdec_h264).
- Line 3: the decoded stream is finally converted and displayed on the screen with FPS information.
By visually comparing the timestamp printed on each frame on the sender and receiver machines, you can roughly estimate the network latency.

