GstCUDA - cudafilter: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
mNo edit summary
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{GstCUDA Page |  
{{GstCUDA/Head|previous=GstCUDA Quick Prototyping Elements|next=cudamux|keywords=GstCUDA elements, GstCUDA GStreamer elements, GstCUDA Prototyping,cudafilter,Cudafilter Description,Cudafilter Key features,Cudafilter element documentation}}
[[GstCUDA - Elements Detailed Description|Elements Detailed Description]]|
[[GstCUDA - cudadebayer|cudadebayer]]|


This page describes in detail the cudafilter element of the GstCUDA plugin.
This page describes in detail the '''''cudafilter''''' element of the GstCUDA plugin.


__TOC__
__TOC__
Line 11: Line 9:
'''''Cudafilter''''' is a one input/output pad video filter GStreamer element, that allows video frames to be processed by the GPU using a custom CUDA library algorithm. With this element users can now develop their own CUDA processing library, pass the library into '''''cudafilter''''', which executes the library on the GPU, passing upstream frames from the GStreamer pipeline to the GPU and passing the modified frames downstream to the next element in the GStreamer pipeline.
'''''Cudafilter''''' is a one input/output pad video filter GStreamer element, that allows video frames to be processed by the GPU using a custom CUDA library algorithm. With this element users can now develop their own CUDA processing library, pass the library into '''''cudafilter''''', which executes the library on the GPU, passing upstream frames from the GStreamer pipeline to the GPU and passing the modified frames downstream to the next element in the GStreamer pipeline.


This element executes the CUDA algorithm from a custom CUDA library (XXX.so file) loaded dynamically during run-time, passed trough an element's property. The CUDA algorithm is separated from the GStreamer element, so the developer could make modifications to the CUDA algorithm, recompile the custom CUDA library and run the GStreamer pipeline again to test the changes. This process can be iterated as many times as needed to debug a custom CUDA algorithm. This feature make '''''cudafilter''''' ideal for quick prototyping, because it offers flexibility and adaptability to many project requirements.


The key feature of this element is the capability to load the CUDA algorithm to be executed on the GPU to process the incoming frames, from an external compiled custom CUDA library. This gives the advantage of having the GStreamer element separated from the CUDA algorithm. So, the developer don't have to worry about the GStreamer-CUDA interface and complex memory handling, because the '''''cudafilter''''' will take care of that. Instead, the developer can be focused on the CUDA custom CUDA algorithm development, and test any change made during the debugging process by just recompiling the CUDA library and just execute the GStreamer pipeline again without the necessity to modify, recompile and reinstall the GstCUDA plugin. This feature is crucial in reducing the time to market on project development, because considerably accelerates the prototyping stage.   
This element executes the CUDA algorithm from a custom CUDA library (XXX.so file) loaded dynamically during run-time, passed trough an element's property. The CUDA algorithm is separated from the GStreamer element, so the developer could make modifications to the CUDA algorithm, recompile the custom CUDA library and run the GStreamer pipeline again to test the changes. This process can be iterated as many times as needed to debug a custom CUDA algorithm. This feature make '''''cudafilter''''' ideal for quick prototyping because it offers flexibility and adaptability to many project requirements.
 
 
The key feature of this element is the capability to load the CUDA algorithm to be executed on the GPU to process the incoming frames, from an external compiled custom CUDA library. This gives the advantage of having the GStreamer element separated from the CUDA algorithm. So, the developer doesn't have to worry about the GStreamer-CUDA interface and complex memory handling, because the '''''cudafilter''''' will take care of that. Instead, the developer can be focused on the custom CUDA algorithm development, and test any change made during the debugging process by just recompiling the CUDA library and just execute the GStreamer pipeline again without the necessity to modify, recompile and reinstall the GstCUDA plugin. This feature is crucial in reducing the time to market on project development because considerably accelerates the prototyping stage.   
 
 
The '''''cudafilter''''' could be viewed as a generic single input/single output pads video filter element that executes any custom CUDA algorithm provided by the user. So, this allows the user to develop different CUDA algorithms at the same time and test them using the same '''''cudafilter''''' element, by just changes the element's property that specifies the CUDA library that should be loaded during pipeline execution.




==Key features==
==Key features==
* Single input/single output pads filter element topology.
* Dynamically load of an external compiled CUDA library that contains the CUDA algorithm to be executed in the GPU to process the incoming frames.
* Dynamically load of an external compiled CUDA library that contains the CUDA algorithm to be executed in the GPU to process the incoming frames.
* Independence between GStreamer element and CUDA algorithm.
* Independence between the GStreamer element and CUDA algorithm.
* Generic GStreamer element that could execute custom CUDA algorithms.
* Adaptability to many project requirements.
* Ideal for quick prototyping and reducing time to market of project development.
* High performance, due to zero memory copies interface between CUDA and GStreamer.  
* High performance, due to zero memory copies interface between CUDA and GStreamer.  
* Directly handle of NVMM memory type buffers.
* Directly handle of NVMM memory type buffers.
* Ideal for quick prototyping and reducing time to market of a project development




==Element properties description==
==Documentation==
'''Under construction'''
[https://ridgerun.github.io/gst-cuda/plugins/gst-cuda-plugin-gstcudafilter.html Cudafilter element documentation].
 


==Element inspect==
==Element inspect==
<syntaxhighlight lang=bash line=true>
<syntaxhighlight lang=bash line=true>
$ sudo apt-get update
$ gst-inspect-1.0 cudafilter
Factory Details:
Factory Details:
   Rank                    none (0)
   Rank                    none (0)
   Long-name                cudafilter
   Long-name                cudafilter
   Klass                    Filter
   Klass                    Filter
   Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
   Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm.
  Single input single output topology filter element.
   Author                  Adrian Cervantes <adrian.cervantes@ridgerun.com>  
   Author                  Adrian Cervantes <adrian.cervantes@ridgerun.com>  
  Diego Chaverri <diego.chaverri@ridgerun.com>
  Daniel Garbanzo <daniel.garbanzo@ridgerun.com>  
  Daniel Garbanzo <daniel.garbanzo@ridgerun.com>  
  Enrique Ramirez <enrique.ramirez@ridgerun.com>
  Michael Gruner <michael.gruner@ridgerun.com>
  Michael Gruner <michael.gruner@ridgerun.com>


Line 43: Line 53:
   Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
   Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
   Filename                /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcuda.so
   Filename                /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcuda.so
   Version                  0.1.0.1
   Version                  0.3.0.1
   License                  Proprietary
   License                  Proprietary
   Source module            gst-cuda
   Source module            gst-cuda
   Source release date      2017-09-21 17:31 (UTC)
   Source release date      2017-12-26 19:30 (UTC)
   Binary package          GStreamer CUDA Plug-in
   Binary package          GStreamer CUDA Plug-in
   Origin URL              Unknown package origin
   Origin URL              Unknown package origin
Line 55: Line 65:
             +----GstElement
             +----GstElement
                   +----GstBaseTransform
                   +----GstBaseTransform
                         +----GstCudafilter
                         +----GstCudaBaseFilter
                              +----GstCudaFilter


Pad Templates:
Pad Templates:
   SRC template: 'src'
   SINK template: 'sink'
     Availability: Always
     Availability: Always
     Capabilities:
     Capabilities:
       ANY
       video/x-raw(memory:NVMM)
                format: I420
                  width: [ 1, 2147483647 ]
                height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]


   SINK template: 'sink'
   SRC template: 'src'
     Availability: Always
     Availability: Always
     Capabilities:
     Capabilities:
       ANY
       video/x-raw
                format: I420
                  width: [ 1, 2147483647 ]
                height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw(memory:NVMM)
                format: I420
                  width: [ 1, 2147483647 ]
                height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]




Line 94: Line 118:
                         flags: readable, writable
                         flags: readable, writable
                         Boolean. Default: false
                         Boolean. Default: false
  location            : Location of the CUDA algorithm library to load
                        flags: readable, writable
                        String. Default: null
  in-place            : Use in-place transform mode configuration
                        flags: readable, writable
                        Boolean. Default: false
</syntaxhighlight>   
</syntaxhighlight>   


}}
{{GstCUDA/Foot|previous=GstCUDA Quick Prototyping Elements|next=cudamux}}

Latest revision as of 20:57, 11 September 2020



Previous: GstCUDA Quick Prototyping Elements Index Next: cudamux




This page describes in detail the cudafilter element of the GstCUDA plugin.

Description

Cudafilter is a one input/output pad video filter GStreamer element, that allows video frames to be processed by the GPU using a custom CUDA library algorithm. With this element users can now develop their own CUDA processing library, pass the library into cudafilter, which executes the library on the GPU, passing upstream frames from the GStreamer pipeline to the GPU and passing the modified frames downstream to the next element in the GStreamer pipeline.


This element executes the CUDA algorithm from a custom CUDA library (XXX.so file) loaded dynamically during run-time, passed trough an element's property. The CUDA algorithm is separated from the GStreamer element, so the developer could make modifications to the CUDA algorithm, recompile the custom CUDA library and run the GStreamer pipeline again to test the changes. This process can be iterated as many times as needed to debug a custom CUDA algorithm. This feature make cudafilter ideal for quick prototyping because it offers flexibility and adaptability to many project requirements.


The key feature of this element is the capability to load the CUDA algorithm to be executed on the GPU to process the incoming frames, from an external compiled custom CUDA library. This gives the advantage of having the GStreamer element separated from the CUDA algorithm. So, the developer doesn't have to worry about the GStreamer-CUDA interface and complex memory handling, because the cudafilter will take care of that. Instead, the developer can be focused on the custom CUDA algorithm development, and test any change made during the debugging process by just recompiling the CUDA library and just execute the GStreamer pipeline again without the necessity to modify, recompile and reinstall the GstCUDA plugin. This feature is crucial in reducing the time to market on project development because considerably accelerates the prototyping stage.


The cudafilter could be viewed as a generic single input/single output pads video filter element that executes any custom CUDA algorithm provided by the user. So, this allows the user to develop different CUDA algorithms at the same time and test them using the same cudafilter element, by just changes the element's property that specifies the CUDA library that should be loaded during pipeline execution.


Key features

  • Single input/single output pads filter element topology.
  • Dynamically load of an external compiled CUDA library that contains the CUDA algorithm to be executed in the GPU to process the incoming frames.
  • Independence between the GStreamer element and CUDA algorithm.
  • Generic GStreamer element that could execute custom CUDA algorithms.
  • Adaptability to many project requirements.
  • Ideal for quick prototyping and reducing time to market of project development.
  • High performance, due to zero memory copies interface between CUDA and GStreamer.
  • Directly handle of NVMM memory type buffers.


Documentation

Cudafilter element documentation.


Element inspect

$ gst-inspect-1.0 cudafilter
Factory Details:
  Rank                     none (0)
  Long-name                cudafilter
  Klass                    Filter
  Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm.
			   Single input single output topology filter element.
  Author                   Adrian Cervantes <adrian.cervantes@ridgerun.com> 
			   Diego Chaverri <diego.chaverri@ridgerun.com> 
			   Daniel Garbanzo <daniel.garbanzo@ridgerun.com> 
			   Enrique Ramirez <enrique.ramirez@ridgerun.com> 
			   Michael Gruner <michael.gruner@ridgerun.com>

Plugin Details:
  Name                     cuda
  Description              Allows frames to be processed by the GPU using a custom CUDA library algorithm
  Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstcuda.so
  Version                  0.3.0.1
  License                  Proprietary
  Source module            gst-cuda
  Source release date      2017-12-26 19:30 (UTC)
  Binary package           GStreamer CUDA Plug-in
  Origin URL               Unknown package origin

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstCudaBaseFilter
                               +----GstCudaFilter

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw(memory:NVMM)
                 format: I420
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: I420
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
      video/x-raw(memory:NVMM)
                 format: I420
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]


Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: gst_element_change_state_func

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "cudafilter0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  qos                 : Handle Quality-of-Service events
                        flags: readable, writable
                        Boolean. Default: false
  location            : Location of the CUDA algorithm library to load
                        flags: readable, writable
                        String. Default: null
  in-place            : Use in-place transform mode configuration
                        flags: readable, writable
                        Boolean. Default: false


Previous: GstCUDA Quick Prototyping Elements Index Next: cudamux