Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello, When i play rtsp video stream using command line, its working fine.But with VideoCapture function of OpenCV,it could not. Please check the below command:


gst-launch-1.0 -v rtspsrc location="rtsp://admin:[email protected]:554" latency=10 ! rtph264depay ! h264parse ! ducatih264dec ! videoconvert ! waylandsink ---------------------(WORKING FINE)


cv::VideoCapture cap("rtspsrc location=\"rtsp://admin:[email protected]:554\" latency=10 ! rtph264depay ! h264parse ! ducatih264dec ! videoconvert ! appsink "); ----------------------(Not Working).

Error log as below:

(play_rtsp_stream:5304): GStreamer-CRITICAL **: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed

(play_rtsp_stream:5304): GStreamer-CRITICAL **: gst_pad_get_current_caps: assertion 'GST_IS_PAD (pad)' failed

(play_rtsp_stream:5304): GStreamer-CRITICAL **: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(play_rtsp_stream:5304): GStreamer-CRITICAL **: gst_structure_get_int: assertion 'structure != NULL' failed

(play_rtsp_stream:5304): GStreamer-CRITICAL **: gst_structure_get_int: assertion 'structure != NULL' failed

(play_rtsp_stream:5304): GStreamer-CRITICAL **: gst_structure_get_fraction: assertion 'structure != NULL' failed GStreamer Plugin: Embedded video playback halted; module udpsrc8 reported: Internal data stream error. OpenCV Error: Unspecified error (GStreamer: unable to start pipeline ) in icvStartPipeline, file /oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/opencv/3.1+gitAUTOINC+9b88e8c746-r3/git/modules/videoio/src/cap_gstreamer.cpp, line 393 terminate called after throwing an instance of 'cv::Exception' what(): /oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/opencv/3.1+gitAUTOINC+9b88e8c746-r3/git/modules/videoio/src/cap_gstreamer.cpp:393: error: (-2) GStreamer: unable to start pipeline in function icvStartPipeline

Aborted (core dumped)

What should i make changes in this function?.

Regards,

Kishan Patel