Conflict between video/x-raw and rtsp source

Hi guys,
I want to decode video streaming using gstreamer and opencv with jetson nano.
I installed jetpack 4.2 and opencv 3.4.6 cuda and gstreamer support.
I faced with some problem.

when I use these commads, they work corectly:

gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)BGRx’ ! fakesink -e

gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! queue ! h264parse ! nvv4l2decoder ! nvvidconv ! ‘video/x-raw, format=(string)BGRx’ ! fakesink -e

gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! nvvidconv ! ‘video/x-raw(memory:NVMM), format=(string)BGRx’ ! fakesink -e

gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! nvvidconv ! ‘video/x-raw, format=(string)BGRx’ ! fakesink -e

and when I use gstream + opencv, such the below, It work correctly:

gst_str = ('rtspsrc location={rtsp} latency=300 ! ’
'rtph264depay ! h264parse ! omxh264dec ! ’
'nvvidconv ! ’
'video/x-raw, ’
'format=(string)BGRx ! videoconvert ! ’
'appsink ').format(url, latency)
cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)

but I want to use video/x-raw(memory:NVMM) instead of video/x-raw , I get this error, How do i solve this problem?

g_mutex_clear() called on uninitialised or locked mutex │00C GPU@38C AO@44C thermal@39.5C POM_5V_IN 3176/2117 POM_5V_GPU 167
Aborted (core dumped)

Hi,
We have clarified that OpenCV only accepts CPU buffers(video/x-raw) in multiple posts:

Please not duplicate same question into multiple posts.

Because gstreamer corecctly use GPU buffer in the command terminal, I think it’s possible to use pipe in opencv with subprocess library, right?

Hi,

No, it is not possible. Please check the source file:

It supports video/x-raw only. video/x-raw(memory:NVMM) is not handled in the 3rdparty code.

Thanks,
Is it possible to use gstreamer with video/x-raw(memory:NVMM) in python code without opencv?

Hi,

You can launch a gstreamer pipeline in python. Here is a simple code for reference: