Getting Started with GstCUDA Wrapper
Getting the code
GstCUDA wrapper source code is delivered after the purchase of a GstCUDA or a product that is GstCUDA-based.
For more information regarding GstCUDA and GstCUDA wrapper, don't hesitate to contact us:
Installing dependencies
Meson building system
At the building system level:
- ninja-build
- python3-pip
- pkg-config
- meson
Please, install them using (in Debian-based systems):
sudo apt install -y \
python3 \
python3-pip \
ninja-build \
pkg-config
The process should be similar in other systems, not based on Debian.
GStreamer Installation
It is required to provide a custom GStreamer build since the default one included in the JetPack may not expose the CUDA library. The only necessary option is nvcodec for the gst-plugins-bad subproject.
meson setup builddir -Dgst-plugins-bad:nvcodec=enabled --prefix=/usr ninja -C build sudo ninja -C build install
Building the code
Once fulfilled the dependencies, you can run a default compilation with:
meson build --optimization 3 --prefix /usr -Denable-docs=disabled -Ddeveloper-mode=false ninja -C build sudo ninja -C build install
For additional customization, you may refer to the following table of options:
| Project Option | Default Value | Possible Values | Description |
|---|---|---|---|
| developer-mode | true | [True, False] | Enable developer mode |
| enable-docs | enabled | [enabled, disabled, auto] | Build documentation with Doxygen |
| enable-docs-only | disabled | [enabled, disabled, auto] | Build documentation with Doxygen without compiling the project |
| gstcuda-backend | ridgerun | [ridgerun, gstreamer] | Select which GstCUDA implementation to use |
Some additional options are required:
| Configure Option | Description |
|---|---|
| --prefix /usr | Set the installation path of the library. |
| --optimization 3 | Set the optimization level to the maximum |
Testing the code
After installing GstCUDA Wrapper, it installs a new element capable of demonstrating the functionality.
Check element installation
First, check that the element is detected by GStreamer:
gst-inspect-1.0 cudawrapperfilter
It should show the inspect of the element.
Run the example element
For Jetpack < 7:
gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! "video/x-raw(memory:NVMM)" ! rrcudawrapperfilter in-place=false ! fakesink gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! "video/x-raw(memory:NVMM)" ! rrcudawrapperfilter in-place=true ! fakesink
For Jetpack >= 7:
gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! "video/x-raw(memory:NVMM)" ! cudaupload ! rrcudawrapperfilter in-place=false ! cudadownload ! fakesink gst-launch-1.0 videotestsrc is-live=1 ! nvvidconv ! "video/x-raw(memory:NVMM)" ! cudaupload ! rrcudawrapperfilter in-place=true ! cudadownload ! fakesink