# Gst-nvivafilter

**URL:** <https://forums.developer.nvidia.com/t/gst-nvivafilter/183138>\
**Category:** Jetson Nano\
**Tags:** gstreamer, cuda\
**Created:** [July 8, 2021, 3:36pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138 "2021-07-08T15:36:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jetsonnvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jetsonnvidia](https://forums.developer.nvidia.com/u/jetsonnvidia)\
**Post date:** [July 8, 2021, 3:36pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/1 "2021-07-08T15:36:08Z")

</div>

I want to use the video from my Raspberry Pi camera in CUDA.

In this document it says you can use a gstreamer pipeline to do this:

[https://developer.download.nvidia.com/embedded/L4T/r32\_Release\_v1.0/Docs/Accelerated\_GStreamer\_User\_Guide.pdf](https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/Docs/Accelerated_GStreamer_User_Guide.pdf)

The command line it says to run is this:

gst-launch-1.0 nvarguscamerasrc ! ‘video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)30/1’ ! nvivafilter cuda-process=true customer-lib-name=“libnvsample\_cudaprocess.so” ! ‘video/x-raw(memory:NVMM), format=(string)NV12’ ! nvoverlaysink -e

However when I run this command line, nothing happens on screen. It just produces this output in the console and nothing else seems to happen:

```auto

nano@jetson-nano:~$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, format=(string)NV12, framerate=(fraction)30/1' ! nvivafilter cuda-process=true customer-lib-name="libnvsample_cudaprocess.so" ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink -e
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode = 5 
   Output Stream W = 1280 H = 720 
   seconds to Run = 0 
   Frame Rate = 120.000005 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.

```

Please can someone help me to get the gstreamer CUDA demo working? Thanks.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [July 8, 2021, 7:36pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/2 "2021-07-08T19:36:04Z")

</div>

A few things that may help:

- _customer-lib-name=“libnvsample\_cudaprocess.so”_  
if you are not running the command in a directory where such lib exists, it would silently fall back to default version of the lib /usr/lib/aarch64-linux-gnu/libnvsample\_cudaprocess.so.

- You would download the public sources and get this plugin sources. Then you would be able to build your own customer lib defining your custom CUDA processing and give its path to nvivafilter plugin.

- For using opencv CUDA with nvivafilter, you may find some examples and information from [here](https://forums.developer.nvidia.com/t/how-to-use-cuda-in-gstreamer-pipeline/175568/4).

---

<div class="post-metadata">

**Author:** ![jetsonnvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jetsonnvidia](https://forums.developer.nvidia.com/u/jetsonnvidia)\
**Post date:** [July 12, 2021, 11:26pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/5 "2021-07-12T23:26:16Z")

</div>

Apparently nvoverlaysink is out of date so I should not have used that.

At this link it specifies a different command to use:

[https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/accelerated\_gstreamer.html#wwpID0EXHA](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/accelerated_gstreamer.html#wwpID0EXHA)

However, the command they say to use does not work either!!!

```auto
gst-launch-1.0 nvarguscamerasrc ! \
  'video/x-raw(memory:NVMM), width=(int)3840, height=(int)2160, \
  format=(string)NV12, framerate=(fraction)30/1' ! \
  nvivafilter cuda-process=true \
  customer-lib-name="libnvsample_cudaprocess.so" ! \
  'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink -e

```

Does not work. :-(

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [July 13, 2021, 11:27am UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/6 "2021-07-13T11:27:57Z")

</div>

Just checked now, it does work (tested on NX devkit, I have no Nano).  
Does your camera provide 3840x2160@30 ? You may just try:

```auto
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=(string)NV12, framerate=(fraction)30/1' ! nvivafilter cuda-process=true customer-lib-name="libnvsample_cudaprocess.so" ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink -e

```

that should produce a green rectangle near top left corner.

nvoverlaysink would only work with a local display, not remotely.

---

<div class="post-metadata">

**Author:** ![jetsonnvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jetsonnvidia](https://forums.developer.nvidia.com/u/jetsonnvidia)\
**Post date:** [July 13, 2021, 12:30pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/7 "2021-07-13T12:30:40Z")

</div>

What works on NX does not work on Nano in this case.

```auto
nano@jetson-nano:~$ gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=(string)NV12, framerate=(fraction)30/1' ! nvivafilter cuda-process=true customer-lib-name="libnvsample_cudaprocess.so" ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink -e
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode = 2 
   Output Stream W = 1920 H = 1080 
   seconds to Run = 0 
   Frame Rate = 29.999999 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.

```

And there is no video or popup window.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [July 13, 2021, 12:49pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/8 "2021-07-13T12:49:43Z")

</div>

It seems running… my guess would be that you are using a DP monitor, while nvoverlaysink expects hdmi by default. You would try setting display-id property of nvoverlaysink :

```auto
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), format=(string)NV12, framerate=(fraction)30/1' ! nvivafilter cuda-process=true customer-lib-name="libnvsample_cudaprocess.so" ! 'video/x-raw(memory:NVMM), format=(string)NV12' ! nvoverlaysink display-id=1 -e

```

---

<div class="post-metadata">

**Author:** ![jetsonnvidia](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jetsonnvidia](https://forums.developer.nvidia.com/u/jetsonnvidia)\
**Post date:** [July 13, 2021, 12:55pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/9 "2021-07-13T12:55:00Z")

</div>

Thank you, that fixed it.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [September 11, 2021, 12:55pm UTC](https://forums.developer.nvidia.com/t/gst-nvivafilter/183138/10 "2021-09-11T12:55:32Z")

</div>

Closed on September 11, 2021, 12:55pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
