How can I unable Gstreamer suport on opencv-python Jetson Orin Nano

Hi, I am working on Jetson Orin Nano 8Gb running Jetpack 5.1.2 and I am trying to access my imx219 MIPI CSI camera video feed through the opencv-python library (cv2).

The following pipeline successfully launches my camera in CLI:

gst-launch-1.0 nvarguscamerasrc sensor_id =0 ! 'video/x-raw(memory:NVMM), width=1280  ,height=720 , format=(string)NV12' ! nvvidconv ! nvegltransform ! nveglglessink

I adapted the pipeline to work as an input to the openCV function “VideoCapture()” as follows:

pipeline1 = "nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=1280 , height=720 , format=(string)NV12 , framerate = 30/1 ! nvvidconv flip-method=2 ! video/x-raw , width=640 , height=360 , format=(string)BGRx ! videoconvert ! video/x-raw , format=(string)BGR ! appsink"

video_capture = cv2.VideoCapture.open(pipeline1,cv2.CAP_ANY)

But this didn’t work. After a while I realized opencv has Gstreamer support disabled by default by running this python code:

import cv2
print(cv2.getBuildInformation())

the output says “[…] Gstreamer = NO […]”
How can I enable Gstreamer support for opencv-python ?

Any help would be greatly appreciated, thank you.

Jad.

Hi,
It seems like you manually update OpenCV package which does not enable gstreamer. If you use the package installed through SDKManager, it should work. We would suggest re-flash the system and install SDK Components through SDKManager. And try again.

You may also try the samples:
[Gstreamer] nvvidconv, BGR as INPUT - #4 by DaneLLL
OpenCV Video Capture with GStreamer doesn't work on ROS-melodic - #3 by DaneLLL

Thank you for your response. Just to let you know I am currently running the OS on an SD card and I don’t have any SSD available for installation. Would SDK manager still work in this case? The only other linux device I have available for flashing is a raspberry pi 4.

Hi,
We would suggest have a host PC in Ubutn 18.04 or 20.04. So that you can install SDKMamager on the host and use it to flash Jetson devices.

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