Getting black screen from GStreamer depth map

I’m using GStreamer to get both RGB and depth map images with the following pipeline from
documentation:

gst-launch-1.0 zedsrc stream-type=4 ! zeddemux name=demux \
 demux.src_left ! queue ! autovideoconvert ! fpsdisplaysink \
 demux.src_aux ! queue ! autovideoconvert ! fpsdisplaysink

The problem is that the depth map is almost completely black and not the normalized depth map I was expecting to see (a grayscale image). The same happens if I get a stream with only the depth information.

I am able to get a normalized depth map using the python API with

image = sl.Mat(1920, 1080, sl.MAT_TYPE.U8_C4)
zed.retrieve_image(image, sl.VIEW.DEPTH)
image_depth = image.get_data()

but I need this information from a GStreamer pipeline, since I’m syncing ZED with other cameras. There’s any way to get a normalized depth map from a GStreamer pipeline? I tried changing depth-minimum-distance and depth-maximum-distance values in the pipeline but I doesn’t seem to make a difference.

Hi @jessicalfr
Welcome to the Stereolabs community.

The zedsrc element sends out the depth map with real depth values to be used as they are.
If you must render it you must design a normalizer element.

1 Like

Hi @Myzhar , thanks for the answer.

What exactly are the values I get from the frames and how can I save the video without loosing the information? I tried to save the video as .avi (using videoconvert to RGB, jpegenc and avimux) but I don’t think this is the right approach for this. What would you suggest? I’m a bit lost

The format of the depth stream is grayscale 16 bit [GRAY16_LE], and the depth values are stored in mm.
You can get more information on the online documentation:
https://www.stereolabs.com/docs/gstreamer/zed-camera-source/#properties

When saving the stream you must be sure that the encoder supports the 16 bit format