# Real-Time Object Tracking with ZED 2i and GStreamer Metadata

**URL:** <https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242>\
**Category:** Python\
**Tags:** zed-gstreamer\
**Created:** [March 3, 2025, 11:38am UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242 "2025-03-03T11:38:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashfaq](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ashfaq](https://community.stereolabs.com/u/ashfaq)\
**Post date:** [March 3, 2025, 11:38am UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/1 "2025-03-03T11:38:26Z")

</div>

Hi ,

I am currently working with the ZED 2i camera, both with and without object detection, and it is functioning as expected.

NOTE : I’M USING PYTHON AND CAN’T USE OTHER PROGRAMMING LANGUAGES

My objective now is to implement object tracking based on user-defined (x, y) coordinates. Specifically, I want to track a designated detected object while eliminating bounding boxes associated with all other objects.

However, I am facing two key challenges:

1. I am unsure how to retrieve real-time tracking information (including x, y, and z coordinates) directly, without first storing the data in a CSV file.

2. I need guidance on accessing ZED Metadata via GStreamer, particularly how to obtain the object array and other relevant information to facilitate object tracking.

---

<div class="post-metadata">

**Author:** ![ashfaq](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ashfaq](https://community.stereolabs.com/u/ashfaq)\
**Post date:** [March 4, 2025, 4:55am UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/2 "2025-03-04T04:55:14Z")

</div>

@Myzhar, kindly assist

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [March 4, 2025, 8:39am UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/3 "2025-03-04T08:39:53Z")

</div>

Hi @ashfaq,

If you are using Gstreamer, you can use the following script to retrieve and display Object detection bounding boxes on the image: [https://github.com/stereolabs/zed-gstreamer?tab=readme-ov-file#local-leftright-stream–multiclass-object-detection-result-displaying](https://github.com/stereolabs/zed-gstreamer?tab=readme-ov-file#local-leftright-stream--multiclass-object-detection-result-displaying)

The object data is formatted in the following structure, which contains the position, velocity and class information (among other data): [https://github.com/stereolabs/zed-gstreamer/blob/master/gst-zed-meta/gstzedmeta.h#L139](https://github.com/stereolabs/zed-gstreamer/blob/master/gst-zed-meta/gstzedmeta.h#L139)

You can then filter the data based on the id or class id.

---

<div class="post-metadata">

**Author:** ![ashfaq](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ashfaq](https://community.stereolabs.com/u/ashfaq)\
**Post date:** [March 9, 2025, 2:41pm UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/4 "2025-03-09T14:41:52Z")

</div>

Thank u for replying.

I told u before , I checked this.

Ok, object detection working perfect. But when I want to track can’t retreive the metadata to use it in my code.

> [@mattrouss](#):
>
> You can then filter the data based on the id or class id.

Can’t retreive the data which can make a filter depends on it, this is my main problem. Can u assist by simple example ?

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [March 10, 2025, 1:00pm UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/5 "2025-03-10T13:00:57Z")

</div>

Hi @ashfaq,

I am not familiar with the python bindings of Gstreamer so I cannot provide an example, please contact the gstreamer support team for help on using the gstreamer API.

If Python is your only constraint, I can suggest using the ZED SDK’s [python wrapper](https://www.stereolabs.com/docs/app-development/python/install) which provides more features and is more flexible than the GStreamer package.

---

<div class="post-metadata">

**Author:** ![ashfaq](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ashfaq](https://community.stereolabs.com/u/ashfaq)\
**Post date:** [March 17, 2025, 2:48am UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/6 "2025-03-17T02:48:54Z")

</div>

Thanks  
Please can u confirm that is possible to access metada library using python, this’s meaning possible ?

Actually, I opened a topic with gstreamer but without response, so I will try until successful.

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [March 20, 2025, 9:24am UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/7 "2025-03-20T09:24:51Z")

</div>

I can confirm that the metadata are available in gstreamer, I cannot confirm if they are available using the python bindings.

---

<div class="post-metadata">

**Author:** ![ashfaq](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@ashfaq](https://community.stereolabs.com/u/ashfaq)\
**Post date:** [April 14, 2025, 4:46pm UTC](https://community.stereolabs.com/t/real-time-object-tracking-with-zed-2i-and-gstreamer-metadata/8242/8 "2025-04-14T16:46:10Z")

</div>

Thanks for replying.

Can I know if [stereolabs](https://www.stereolabs.com/) provides paid support for custom case, like mine ?
