Will opencv usage with gstreamer reduce CPU usage?

Michael Gruner michael.gruner at ridgerun.com
Thu Jan 21 18:14:24 UTC 2021


Hello

Yes you should be able to write an OpenCV application that captures with GStreamer and processes using CUDA. I have identified that one of the processing bottlenecks when using GStreamer video capture in OpenCV is that every buffer is copied. I’m working on a patch to remove this copy, it’s currently reviewed by the OpenCV team:

https://developer.ridgerun.com/wiki/index.php?title=RidgeRun_OpenCV_Fork#GStreamer_Video_Capture <https://developer.ridgerun.com/wiki/index.php?title=RidgeRun_OpenCV_Fork#GStreamer_Video_Capture>

Note how, for a 1080P video example, max framerate increased from 500fps to 1300fps. You’ll need to build OpenCV from source. There’s a link in that same wiki with instructions. <https://developer.ridgerun.com/wiki/index.php?title=Compiling_OpenCV_from_Source> And yes, this applies to Python as well.

Please be aware that this is a work in progress and yet subject to fixes/improvements.

Hope it somehow helps!
Michael
www.ridgerun.com <http://www.ridgerun.com/>


> On 20 Jan 2021, at 18:53, jinmc <jinmochong at gmail.com> wrote:
> 
> Hi!
> I have a script that would do what I need that uses opencv, about object
> detection.
> But the problem is that it uses too much CPU (approximately 50%)
> I want to use gstreamer with opencv, and on top of that use cuda
> gpu-accelerated opencv to reduce CPU usage and use GPU instead.
> If cuda usage is not possible would it still reduce CPU usage?
> Would this be possible? Please give me some insight!
> Also, I want to do everything in python, as the current legacy system is in
> python.
> Thanks!
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210121/d72669be/attachment.htm>


More information about the gstreamer-devel mailing list