Unable to initalize gstreamer pipeline

My GStreamer pipeline is as follows:

decklinkvideosrc device-number=$CAMERA_NUMBER$ mode=25 ! 
videoconvert ! tee name=t 
t. ! queue ! 
    video/x-raw,width=3840,height=2160 ! 
    nvvidconv ! 
    video/x-raw(memory:NVMM) ! 
    nvv4l2h264enc maxperf-enable=1 bitrate=14000000 preset-level=1 num-B-Frames=0 ! 
    h264parse ! 
    rtspclientsink latency=0 protocols=tcp name=s location=rtsp://localhost:8554/2 
t. ! queue ! 
    videorate ! video/x-raw,framerate=30/1 ! 
    videocrop bottom=16 ! 
    video/x-raw,format=BGR ! 
    queue max-size-buffers=10 leaky=downstream ! 
    appsink max-buffers=5 drop=True sync=False

I am initializing it using:

cap = cv::VideoCapture(pipeline, cv::CAP_GSTREAMER);

When I try to launch the RTSP part from the command line, it works perfectly fine, but when using OpenCV (cv2), it fails with the following log:

`Opening in BLOCKING MODE 
0:00:01.097629341 678956 0xaaab0e288690 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaab0e268630 Failed to determine interlace mode
0:00:01.097703230 678956 0xaaab0e288690 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaab0e268630 Failed to determine interlace mode
0:00:01.097730014 678956 0xaaab0e288690 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaab0e268630 Failed to determine interlace mode
0:00:01.097751390 678956 0xaaab0e288690 WARN                    v4l2 gstv4l2object.c:2420:gst_v4l2_object_add_interlace_mode:0xaaab0e268630 Failed to determine interlace mode
0:00:01.097829407 678956 0xaaab0e288690 WARN                    v4l2 gstv4l2object.c:4561:gst_v4l2_object_probe_caps:<nvv4l2h264enc0:src> Failed to probe pixel aspect ratio with VIDIOC_CROPCAP: Unknown error -1
0:00:01.102590827 678956 0xaaab0e288690 WARN                decklink gstdecklink.cpp:1306:init_devices: selected device does not have output interface: 0xffffffff80000004
0:00:01.103418226 678956 0xaaab0e288690 WARN                decklink gstdecklink.cpp:1306:init_devices: selected device does not have output interface: 0xffffffff80000004
0:00:01.104089848 678956 0xaaab0e288690 WARN                decklink gstdecklink.cpp:1306:init_devices: selected device does not have output interface: 0xffffffff80000004
0:00:01.104681470 678956 0xaaab0e288690 WARN                decklink gstdecklink.cpp:1306:init_devices: selected device does not have output interface: 0xffffffff80000004
0:00:01.106613935 678956 0xaaab0e319c60 FIXME                default gstutils.c:3980:gst_pad_create_stream_id_internal:<decklinkvideosrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
0:00:01.188129788 678956 0xaaab0e319c60 WARN           basetransform gstbasetransform.c:1362:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)3840, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)UYVY, colorimetry=(string)bt2020, chroma-site=(string)mpeg2 in anything we support
0:00:01.189748331 678956 0xaaab0e319c60 WARN           basetransform gstbasetransform.c:1362:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)3840, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)UYVY, colorimetry=(string)bt2020, chroma-site=(string)mpeg2 in anything we support
0:00:01.191096215 678956 0xaaab0e319c60 WARN           basetransform gstbasetransform.c:1362:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)3840, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)UYVY, colorimetry=(string)bt2020, chroma-site=(string)mpeg2 in anything we support
0:00:01.191276281 678956 0xaaab0e319c60 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<decklinkvideosrc0> error: Internal data stream error.
0:00:01.191299737 678956 0xaaab0e319c60 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<decklinkvideosrc0> error: streaming stopped, reason not-negotiated (-4)
0:00:01.192856359 678956 0xaaab0e319c60 WARN           basetransform gstbasetransform.c:1362:gst_base_transform_setcaps:<videoconvert0> transform could not transform video/x-raw, width=(int)3840, height=(int)2160, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)25/1, format=(string)UYVY, colorimetry=(string)bt2020, chroma-site=(string)mpeg2 in anything we support
0:00:01.788315682 678956 0xaaab0e2aa120 ERROR                default gstrtspconnection.c:1046:gst_rtsp_connection_connect_with_response: failed to connect: Operation was cancelled
0:00:01.788365315 678956 0xaaab0e2aa120 ERROR         rtspclientsink gstrtspclientsink.c:2022:gst_rtsp_conninfo_connect:<s> Could not connect to server. (Generic error)
0:00:01.788380483 678956 0xaaab0e2aa120 WARN          rtspclientsink gstrtspclientsink.c:3236:gst_rtsp_client_sink_connect_to_server:<s> error: Failed to connect. (Generic error)
0:00:01.788434947 678956 0xaaab0e2aa120 WARN          rtspclientsink gstrtspclientsink.c:3302:gst_rtsp_client_sink_open:<s> Failed to connect to server` 


However, if I remove the tee element and only keep the appsink, the pipeline works fine:

decklinkvideosrc device-number=$CAMERA_NUMBER$ mode=25 latency=0 !
videoconvert ! 
videorate ! video/x-raw,framerate=30/1 ! 
videocrop bottom=16 ! 
video/x-raw,format=BGR !
queue max-size-buffers=10 leaky=downstream ! 
appsink max-buffers=5 drop=True sync=False

Hi,
We support jetson_multimedia_api and gstreamer. Please make sure you have checked the document:
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/Multimedia.html
https://docs.nvidia.com/jetson/archives/r36.3/ApiReference/index.html
There are some examples in

Q: Is there any example of running RTSP streaming?
Q: Is there an example for running UDP streaming?
Q: I have a USB camera. How can I launch it on AGX Orin?

For further issues, please share a method to replicate the issue through gstreamer command, or either sample. We will set up developer kit and check.

Thanks!

yeah but i am confused regarding the failure of the pipeline because logically it seem fine and it should run but it fails just because of the tee element and the pipeline splitting

Hi,
There is a similar sample in
Problems using gstreamer pipeline in openCV for recording video - #5 by DaneLLL

You may apply your pipeline to the sample for a try. And in your pipeline, it is rtspclientsink. You can try to save to a video file as the sample demonstrates. See if this works.

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