# Getting black screen from GStreamer depth map

**URL:** <https://community.stereolabs.com/t/getting-black-screen-from-gstreamer-depth-map/2158>\
**Category:** Software\
**Tags:** zed-gstreamer\
**Created:** [February 22, 2023, 2:28pm UTC](https://community.stereolabs.com/t/getting-black-screen-from-gstreamer-depth-map/2158 "2023-02-22T14:28:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessicalfr](https://community.stereolabs.com/user_avatar/community.stereolabs.com/jessicalfr/32/1044_2.png) [@jessicalfr](https://community.stereolabs.com/u/jessicalfr)\
**Post date:** [February 22, 2023, 2:28pm UTC](https://community.stereolabs.com/t/getting-black-screen-from-gstreamer-depth-map/2158/1 "2023-02-22T14:28:38Z")

</div>

I’m using GStreamer to get both RGB and depth map images with the following pipeline from  
[documentation](https://www.stereolabs.com/docs/gstreamer/zed-demux/):

```auto
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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [February 22, 2023, 3:16pm UTC](https://community.stereolabs.com/t/getting-black-screen-from-gstreamer-depth-map/2158/2 "2023-02-22T15:16:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jessicalfr](https://community.stereolabs.com/user_avatar/community.stereolabs.com/jessicalfr/32/1044_2.png) [@jessicalfr](https://community.stereolabs.com/u/jessicalfr)\
**Post date:** [February 22, 2023, 6:09pm UTC](https://community.stereolabs.com/t/getting-black-screen-from-gstreamer-depth-map/2158/3 "2023-02-22T18:09:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Myzhar](https://community.stereolabs.com/user_avatar/community.stereolabs.com/myzhar/32/11_2.png) [@Myzhar](https://community.stereolabs.com/u/Myzhar)\
**Post date:** [February 23, 2023, 8:04am UTC](https://community.stereolabs.com/t/getting-black-screen-from-gstreamer-depth-map/2158/4 "2023-02-23T08:04:33Z")

</div>

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](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
