我使用的cmd(尝试使用和不使用“”)
gst-launch-1.0 playbin uri=rtsp://admin:admin2018@192.168.1.10/ONVIF/MediaInput?profile=1_def_profile6
错误消息
INFO GST_STATES gstbin.c:2507:gst_bin_element_set_state:<rtspsrc0> current NULL pending VOID_PENDING, desired next READY
0:00:00.168067600 4356 00000000026640F0 INFO task gsttask.c:453:gst_task_set_lock: setting stream lock 0000000002694B78 on task 0000000002FBB050
0:00:00.173841100 4356 00000000026640F0 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<rtspsrc0> completed state change to READY
0:00:00.178465800 4356 00000000026640F0 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<rtspsrc0> notifying about state-changed NULL to READY (VOID_PENDING pending)
0:00:00.183956900 4356 00000000026640F0 INFO GST_STATES gstbin.c:2955:gst_bin_change_state_func:<pipeline0> child 'rtspsrc0' changed state to 2(READY) successfully
0:00:00.190056500 4356 00000000026640F0 INFO GST_STATES gstelement.c:2651:gst_element_continue_state:<pipeline0> committing state from NULL to READY, pending PAUSED, next PAUSED
0:00:00.195510100 4356 00000000026640F0 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed NULL to READY (PAUSED pending)
0:00:00.201903600 4356 00000000026640F0 INFO GST_STATES gstelement.c:2658:gst_element_continue_state:<pipeline0> continue state change READY to PAUSED, final PAUSED
0:00:00.206958900 4356 00000000026640F0 INFO GST_STATES gstbin.c:2507:gst_bin_element_set_state:<rtspsrc0> current READY pending VOID_PENDING, desired next PAUSED
0:00:00.212214500 4356 00000000026640F0 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<rtspsrc0> completed state change to PAUSED
0:00:00.217915600 4356 00000000026640F0 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<rtspsrc0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.223826400 4356 00000000026640F0 INFO GST_STATES gstbin.c:2998:gst_bin_change_state_func:<pipeline0> child 'rtspsrc0' changed state to 3(PAUSED) successfully without preroll
0:00:00.229318100 4356 00000000026640F0 INFO GST_STATES gstelement.c:2676:gst_element_continue_state:<pipeline0> completed state change to PAUSED
0:00:00.231131800 4356 0000000002FB5A40 ERROR default gstrtspconnection.c:1046:gst_rtsp_connection_connect_with_response: failed to connect: Error resolving â?o192.168.1.xn--10â??: No such host is known.
0:00:00.235026900 4356 00000000026640F0 INFO GST_STATES gstelement.c:2579:_priv_gst_element_state_changed:<pipeline0> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:00.241516800 4356 0000000002FB5A40 ERROR rtspsrc gstrtspsrc.c:5046:gst_rtsp_conninfo_connect:<rtspsrc0> Could not connect to server. (Generic error)
0:00:00.252659700 4356 0000000002FB5A40 WARN rtspsrc gstrtspsrc.c:7872:gst_rtspsrc_retrieve_sdp:<rtspsrc0> error: Failed to connect. (Generic error)
0:00:00.257538600 4356 0000000002FB5A40 INFO GST_ERROR_SYSTEM gstelement.c:2141:gst_element_message_full_with_details:<rtspsrc0> posting message: Could not open resource for reading and writing.
0:00:00.270025300 4356 0000000002FB5A40 INFO GST_ERROR_SYSTEM gstelement.c:2168:gst_element_message_full_with_details:<rtspsrc0> posted error message: Could not open resource for reading and writing.
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing.
Additional debug info:
../gst/rtsp/gstrtspsrc.c(7872): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Failed to connect. (Generic error)
如果我是通过gst-discoverer调用的
gst-discoverer-1.0.exe rtsp://admin:admin2018@192.168.1.10/ONVIF/MediaInput?profile=1_def_profile6 gst-debug=4
告诉我
Analyzing rtsp://admin:admin2018@192.168.1.10/ONVIF/MediaInput?profile=1_def_profile6
Done discovering rtsp://admin:admin2018@192.168.1.10/ONVIF/MediaInput?profile=1_def_profile6
An error was encountered while discovering the file
Could not open resource for reading and writing.
Analyzing file:///D:/armaDOCs/arma/Desktop/eyedius_client_0.9.89.21/dll/gs/1.0/x86_64/bin/gst-debug=4
Done discovering file:///D:/armaDOCs/arma/Desktop/eyedius_client_0.9.89.21/dll/gs/1.0/x86_64/bin/gst-debug=4
An error was encountered while discovering the file
Resource not found.
有什么线索吗?谢谢
编辑:可以通过以ffmpeg为后端的opencv访问rtsp流。
cv::VideoCapture cap("rtsp://admin:admin2018@192.168.1.10/ONVIF/MediaInput?profile=1_def_profile6");