# How to use deepstream\_imagedata-multistream in custom app

**URL:** <https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836>\
**Category:** DeepStream SDK\
**Created:** [July 7, 2020, 8:36pm UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836 "2020-07-07T20:36:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoveNvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@LoveNvidia](https://forums.developer.nvidia.com/u/LoveNvidia)\
**Post date:** [July 7, 2020, 8:36pm UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/1 "2020-07-07T20:36:03Z")

</div>

Hi all,  
I want to use [deepstream\_imagedata-multistream](https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/apps/deepstream-imagedata-multistream) for decoding of multi-stream, and then use the decoded frames in my custom python app, I want to integrate decoder(deepstream\_imagedata-multistream) with my processing part and both work next to each other .

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [July 9, 2020, 7:26am UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/3 "2020-07-09T07:26:26Z")

</div>

Do you mean to process the decoded video data(in YUV or RGB format)? The sample app [deepstream\_imagedata-multistream](https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/apps/deepstream-imagedata-multistream) is not just a decoder. There is no interface for app to access the data buffer directly now.  
In c level, you can develop your own gstreamer plugin to process frame data. [https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream\_Development\_Guide/deepstream\_custom\_plugin.html#](https://docs.nvidia.com/metropolis/deepstream/dev-guide/index.html#page/DeepStream_Development_Guide/deepstream_custom_plugin.html#)

---

<div class="post-metadata">

**Author:** ![LoveNvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@LoveNvidia](https://forums.developer.nvidia.com/u/LoveNvidia)\
**Post date:** [July 9, 2020, 8:05am UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/4 "2020-07-09T08:05:12Z")

</div>

Yes I want to process the decoded streams in python.  
I cant instread of write to disk the decoded frames, push them into queue?

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [July 9, 2020, 8:07am UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/5 "2020-07-09T08:07:39Z")

</div>

Python interface is application level interface, it can not access the frame data directly.

---

<div class="post-metadata">

**Author:** ![LoveNvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@LoveNvidia](https://forums.developer.nvidia.com/u/LoveNvidia)\
**Post date:** [July 9, 2020, 8:08am UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/6 "2020-07-09T08:08:56Z")

</div>

So there is no way to use decoded frames in custom python app?

I used gstreamer + opencv in python, but this use both GPU buufer + CPU buffer,

```
        gstream_elemets = (
            'rtspsrc location=rtsp latency=300 !'
            'queue !'
            'rtph264depay ! h264parse !'
            'omxh264dec disable-dvfs=1 enable-low-outbuffer=1 !'
            'queue !'
            'video/x-raw(memory:NVMM), framerate=25/1, format=(string)NV12 !'
            'queue !'
            'nvvidconv ! video/x-raw, width={}, height={}, framerate=25/1, format=(string)BGRx !'
            'videoconvert ! video/x-raw, framerate=25/1, format=(string)BGR !'
            'appsink max-buffer=100 sync=0 ')

```

> cv2.VideoCapture(gstream\_elemets, cv2.CAP\_GSTREAMER)

I want to skip some frames, becuasethe input frame rate = 25 and output frame rate = 5, then I don’t want to decode all evey 25 input frames, I want to decode every 5th frames. This option is exist in nvv4l2decoder , but there is not such a way in omxh264dec to skip some frames. and I tested the nvv4l2decder, but I don’t know why this decoder don’t work in rtsp source but work for file source.  
I also used videorate elemnt for framerate=5/1, but this cause cpu usage dramatically increased. I have to decoder every 25 frames then take only 5 frame with counter state in python program. because of I don’t want to decode every 25 frames.

please see this [link](https://forums.developer.nvidia.com/t/doesnt-work-nvv4l2decoder-for-decoding-rtsp-in-gstreamer-opencv/140321/4).

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [July 9, 2020, 8:45am UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/7 "2020-07-09T08:45:31Z")

</div>

Do you mean you want to use “drop-frame-interval” property of nvv4l2decoder to change output framerate?

---

<div class="post-metadata">

**Author:** ![LoveNvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@LoveNvidia](https://forums.developer.nvidia.com/u/LoveNvidia)\
**Post date:** [July 9, 2020, 10:07am UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/8 "2020-07-09T10:07:52Z")

</div>

I don’t want to use “drop-frame-interval” property of nvv4l2decoder for setting framerate of output, But because the output frame rate is lower than input frame rate, why I do doing decoder for all frames, I want to drops some of frames without decoding.

---

<div class="post-metadata">

**Author:** ![Fiona.Chen](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fiona.chen/32/15508_2.png) [@Fiona.Chen](https://forums.developer.nvidia.com/u/Fiona.Chen)\
**Post date:** [July 9, 2020, 11:10am UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/9 "2020-07-09T11:10:07Z")

</div>

Dropping frame function needs to consider many conditions in pipeline. It is better to implement in c level than in python.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:17pm UTC](https://forums.developer.nvidia.com/t/how-to-use-deepstream-imagedata-multistream-in-custom-app/140836/11 "2021-10-12T16:17:20Z")

</div>


