# How to speed up video conversion in opencv's VideoCapture/Gstreamer

**URL:** <https://forums.developer.nvidia.com/t/how-to-speed-up-video-conversion-in-opencvs-videocapture-gstreamer/120841>\
**Category:** Jetson Nano\
**Tags:** opencv\
**Created:** [April 23, 2020, 8:01pm UTC](https://forums.developer.nvidia.com/t/how-to-speed-up-video-conversion-in-opencvs-videocapture-gstreamer/120841 "2020-04-23T20:01:42Z")\
**Posts on this page:** 3\
**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:** [April 23, 2020, 8:01pm UTC](https://forums.developer.nvidia.com/t/how-to-speed-up-video-conversion-in-opencvs-videocapture-gstreamer/120841/1 "2020-04-23T20:01:42Z")

</div>

Hi guys,  
I want to use multi-stream decoder using harware of jetson nano in opencv’s VideoCapture+Gstreamer1.0. I use the below codes for that processing.

> gstream\_elemets = (‘rtspsrc location={} latency=300!’ ‘queue !’  
> 'rtph264depay ! h264parse ! omxh264dec enable-low-outbuffer=1 ! ’  
> 'nvvidconv ! ’  
> ‘video/x-raw , format=(string)RGBA !’  
> 'videoconvert ! ’  
> ‘appsink sync=false’)  
> cv2.VideoCapture(gstream\_elemets, cv2.CAP\_GSTREAMER)

My problem is that in the convertor step, opencv use CPU for this work, Is it possible to optimize this stage?

---

<div class="post-metadata">

**Author:** ![fabian.solano](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/fabian.solano/32/15649_2.png) [@fabian.solano](https://forums.developer.nvidia.com/u/fabian.solano)\
**Post date:** [April 24, 2020, 2:30pm UTC](https://forums.developer.nvidia.com/t/how-to-speed-up-video-conversion-in-opencvs-videocapture-gstreamer/120841/3 "2020-04-24T14:30:17Z")

</div>

Hi @LoveNvidia,

You may want to try with the ‘ **nvvidconv** ’ plugin which can be used as a replacement with hardware optimization for videoconvert. However, as you are using appsink you may want to check the following topic

> [@NVMM memory](https://forums.developer.nvidia.com/t/nvmm-memory/50217):
>
> Hi Folks, Where can we know more about NVMM memory, in terms of its architectural location on Tegra SoC or external DDR ? Would like to understand where buffer are created when we do - Gstreamer CAPS like - filtercaps = gst\_caps\_from\_string("video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1 "); I need to transfer contents of Gstreamer - GstBuffer to opencv CV::Mat. While doing so I run into problems/issues related to NVMM (I think). He…

For instructions on how to use the nvvidconv with appsink.

Regards,  
Fabian  
[www.ridgerun.com](http://www.ridgerun.com)

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 18, 2021, 5:41pm UTC](https://forums.developer.nvidia.com/t/how-to-speed-up-video-conversion-in-opencvs-videocapture-gstreamer/120841/5 "2021-10-18T17:41:46Z")

</div>


