OpenCV/Pythin doesn't support Gstreamer

I can use the following gstreamer command and it works well

gst-launch-1.0 filesrc location=<filename_h264.mp4> ! qtdemux ! h264parse ! nvv4l2decoder ! nvoverlaysink -e

But my OpenCV/Python doesn’t support Gstreamer when print(cv2.getBuildInormation()).

I have built OpenCV with -D WITH_GSTREAMER=ON and the output of cmake also showed GStreamer YES.

I check OpenCV/Python on PC(Ubuntu) and it support GStreamer by print(cv2.getBuildInormation()).

It looks like python3 of Jetson doesn’t connect to the OpenCV I built (I make install OpenCV to /opt/opencv4) because GTK+ also doesn’t support.
Is there any steps I need to do for Jetson Orin for GStreamer support for OpenCV/Python?

Platform: Jetson AGX Orin
Jetpack: 5.1.1
OpenCV: 4.8 (re-built from source code)
Python: 3.8
Gstreamer: 1.16.3

Hi,
The OpenCV package installed through SDKManager has gstreamer enabled. You may try the package.

For manually building/installing OpenCV, please try

Jetson AGX Orin FAQ
Q: How to build an OpenCV with CUDA support on JetPack 6.0 GA?

Thanks DaneLLL,

I think it may the reason that I make install OpenCV to /opt/opencv4 not /usr/local.
Since we use custom board and need to config opencv manually so can’t install Jetpack 6.0 by SDKmandger. I am not sure if I make install opencv to /usr/local can solve this issue. just want to know it is possible to let Python3 to use th opencv I built in other path. Thanks

Hi DaneLLL, Are you sure - I just installed via SDKManager and when checking opencv I see:

Video I/O:
DC1394: NO
FFMPEG: YES
avcodec: YES (59.37.100)
avformat: YES (59.27.100)
avutil: YES (57.28.100)
swscale: YES (6.7.100)
avresample: NO
GStreamer: NO
v4l/v4l2: YES (linux/videodev2.h)

I literally read your answer yesterday and this morning rebuilt the Orin.
Do let me know if you need further information.
I can stream outside of opencv just fine, but as GStreamer: NO I’m a tad confused!

Regards
James

Update from me:
Reinstalled Orin, numpy is the only thing that was pulled in on the install.
Installing fresh Jetpack got me to the right version of cv2 with gstreamer available.

I found my issue though, installing ultralytics via pip overwrote cv2 and removes gstreamer enablement.

I could use no-deps though is this the right, way to add ultralytics in, I’m not sure what other JP components its hosing.

Quite new to Orin/JP6.

Hi,
Not sure if it works but you may try to install ultralytics first. And then install SDK Components.

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