Nvarguscamerasrc issues, related to OpenCV

Hello,
I’m having trouble getting nvarguscamerasrc to run reliably: it seems to have a mind of it’s own.
These are the manipulations I’ve done, in chronological order : (I’m ommiting the formats as these aren’t necessary to have a pipeline working and would bloat this tremendously, and don’t mind the typos if there are some, i’m writing this from head)
gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! videoconvert ! nvoverlaysink -e : Worked until I launched once the following command in OpenCV’ VideoCapture.
nvarguscamerasrc ! nvvidconv ! videoconvert ! appsink which worked only once.
Since, any commands using nvoverlaysink or appsink with nvarguscamerasrc as a source no longer work.

What is frustrating is that the following pipelines still work:
gst-launch-1.0 nvarguscamerasrc ! nvegltransform ! nveglglessink
gst-launch-1.0 nvarguscamerasrc ! xvimagesink
gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! videoconvert ! gtksink

And I also have verified that GStreamer works with my OpenCV installation using a v4l2 pipeline:
v4l2src device=/dev/video0 ! nvvidconv ! videoconvert ! appsink

The VPI examples (Notably VPI Remap) also manage to make the CSI camera work.

Here’s my setup :
-Nvidia Jetson Nano 4GB
-IMX219 with fisheye lens
-JetPack 4.6, L4T 32.7.1
-Opencv 4.5.5 compiled with Cuda, VTK and GStreamer on the Jetson itself.

I’m just looking for a fast way to get it working with OpenCV, either using libargus or a gstreamer pipeline. The thing is that I haven’t found any good tutorial for libargus.
I’ve attached the terminal output for the nvoverlaysink pipeline and the nveglglessink pipeline
eglpipeline.txt (1.8 KB)
nvpipeline.txt (1.8 KB)

Thanks for reading !

The nvoverlaysink was not support from r32.6.1

I didn’t know that…
That’s weird because nvoverlaysink still works with v4l2src.

Sorry, looks like J4.x still support nvoverlaysink but J5.x
Could you try below sample.

I don’t use python, but I’ve integrated the gstreamer pipeline into my own code : It basically prints the v4l2-ctl device of lists, then prints the pipeline it’s going to use with API ID, then tries to start the camera. After that it tries to read the frames, and after 10 read failures it aborts and shuts down.
The following text file is the console output of running the script :
opencvpipeline.txt (4.2 KB)

Short answer: It didn’t work, and it has roughly the same errors as the nvoverlaysink pipeline.

Also here is my OpenCV build info, just in case:
buildinfo.txt (7.2 KB)

Add this ‘video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=NV12’ to your pipeline like below to try.

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=NV12' ! nvvidconv ! videoconvert ! nvoverlaysink -e

I’ve tried it, still no luck :/
Here’s the console output below: It just waited doing nothing so I had to terminate it
consoleoutput.txt (1.9 KB)

Hi
For imx219, do you use Raspberry Pi camera v2? This is supported by default. If you use imx219 from other vendor, the driver may not be ready and you would need to contact the vendor for support.

I use the arducam version.

What’s weird is that there are pipelines that work fully, and the Nvidia provided examples work too…

Could you check if nvgstcapture-1.0 able see the preview screen?

nvgstcapture-1.0 can’t start a video or capture an image.
Here is the console output :
nvgstout (5.2 KB)

Is there something I can run to verify the files, or something to reinstall possibly ?
What about possible alternatives ?

Hello, can you point me towards some possible resolution, either using gstreamer, libargus, or something else I don’t know ?

From your experiment any reason need to use nvoverlaysink?

There’s no reason, but the symptoms are the same as those shown by OpenCV, so I’m thinking that those two are related in implementation, by having some conversion from EGL to NVMM that’s not working. Also they don’t seem to allow the stream to be freed.

Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks

I haven’t resolved it, and i’m currently trying to get Argus to work. I will check again with a clean install in a few days.