Ask Your Question
0

how can use gstreamer with rtsp stream

asked 2018-08-02 02:07:12 -0600

kishan patel gravatar image

Hello, I have found that gstreamer can be use to play video frame from web-cam as below:

VideoCapture cap("v4l2src ! video/x-raw,format=BGR,width=640,height=480,framerate=30/1 ! appsink",CAP_GSTREAMER);

Now, i have tried to make some changes to read video frame for "rtsp" stream,but i got some errors. Can anyone modify above line to use "rtsp" stream instead of camera-device '0'.

Regards, Kishan Patel.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-08-11 01:36:40 -0600

kishan patel gravatar image

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

edit flag offensive delete link more

Comments

please do not post answers, if you have a question or comment .

instead -- please EDIT your question

berak gravatar imageberak ( 2018-08-11 01:43:26 -0600 )edit

Okay. Actually, there is limit of characters in comments,thats why i put it here. And Can anyone know about this issue? Please guide me how can i resolve this issue.

kishan patel gravatar imagekishan patel ( 2018-08-11 03:43:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-08-02 02:07:12 -0600

Seen: 4,608 times

Last updated: Aug 11 '18