我的 rtsp 流网址是
rtsp://192.17.3.2/user=admin&password=&channel=2&stream=0.sdp?
该网址在 Windows 中使用 VLC 工作。
在 Ubuntu 中,我使用了 gst-launch,如下所示。
gst-launch-1.0 --gst-debug=rtspsrc:5 rtspsrc location=rtsp://192.17.3.2/user=admin&password=&channel=2&stream=0.sdp? ! rtph264depay ! queue ! nvv4l2decoder ! queue ! nvvideoconvert ! nveglglessink
可能是什么问题?完整的错误是
xavier@xavier-desktop:~$ gst-launch-1.0 --gst-debug=rtspsrc:5 rtspsrc location=rtsp://192.17.3.2/user=admin&password=&channel=2&stream=0.sdp? ! rtph264depay ! queue ! nvv4l2decoder ! queue ! nvvideoconvert ! nveglglessink
[2] 16954
[3] 16955
[4] 16956
bash: !: command not found
[1] Exit 1 gst-launch-1.0 --gst-debug=rtspsrc:5 rtspsrc location=rtsp://192.17.3.2/user=admin
[3]- Done password=
[4]+ Done channel=2
xavier@xavier-desktop:~$ 0:00:00.062975168 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:8617:gst_rtspsrc_uri_set_uri:<rtspsrc0> parsing URI
0:00:00.063076992 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:8624:gst_rtspsrc_uri_set_uri:<rtspsrc0> configuring URI
0:00:00.063111072 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:8640:gst_rtspsrc_uri_set_uri:<rtspsrc0> set uri: rtsp://192.17.3.2/user=admin
0:00:00.063131680 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:8642:gst_rtspsrc_uri_set_uri:<rtspsrc0> request uri is: rtsp://192.17.3.2/user=admin
Setting pipeline to PAUSED ...
0:00:00.063379360 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:8391:gst_rtspsrc_start:<rtspsrc0> starting
0:00:00.063515584 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd OPEN
0:00:00.063541280 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:5598:gst_rtspsrc_loop_send_cmd:<rtspsrc0> not interrupting busy cmd unknown
Pipeline is live and does not need PREROLL ...
0:00:00.063948992 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command OPEN
0:00:00.063994560 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
0:00:00.064058752 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4614:gst_rtsp_conninfo_connect:<rtspsrc0> creating connection (rtsp://192.17.3.2/user=admin)...
Progress: (open) Opening Stream
0:00:00.064632000 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4625:gst_rtsp_conninfo_connect:<rtspsrc0> sanitized uri rtsp://192.17.3.2/user=admin
0:00:00.064716384 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4659:gst_rtsp_conninfo_connect:<rtspsrc0> connecting (rtsp://192.17.3.2/user=admin)...
Progress: (connect) Connecting to rtsp://192.17.3.2/user=admin
0:00:00.133218848 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7342:gst_rtspsrc_retrieve_sdp:<rtspsrc0> create options... (async)
0:00:00.133296448 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7351:gst_rtspsrc_retrieve_sdp:<rtspsrc0> send options...
0:00:00.133489696 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
Progress: (open) Retrieving server options
0:00:00.133759744 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
0:00:00.133788736 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5964:gst_rtspsrc_try_send:<rtspsrc0> sending message
0:00:00.136703776 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5866:gst_rtsp_src_receive_response:<rtspsrc0> received response message
0:00:00.136736352 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5885:gst_rtsp_src_receive_response:<rtspsrc0> got response message 200
0:00:00.136763936 16954 0x5565d205e0 INFO rtspsrc gstrtspsrc.c:7364:gst_rtspsrc_retrieve_sdp:<rtspsrc0> Now using version: 1.0
0:00:00.136794016 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7371:gst_rtspsrc_retrieve_sdp:<rtspsrc0> create describe...
0:00:00.136816096 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7388:gst_rtspsrc_retrieve_sdp:<rtspsrc0> send describe...
0:00:00.136872896 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
0:00:00.136897760 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
0:00:00.136917120 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5964:gst_rtspsrc_try_send:<rtspsrc0> sending message
Progress: (open) Retrieving media info
0:00:00.142664832 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5866:gst_rtsp_src_receive_response:<rtspsrc0> received response message
0:00:00.142694656 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5885:gst_rtsp_src_receive_response:<rtspsrc0> got response message 451
0:00:00.142748704 16954 0x5565d205e0 WARN rtspsrc gstrtspsrc.c:6161:gst_rtspsrc_send:<rtspsrc0> error: Unhandled error
0:00:00.142766432 16954 0x5565d205e0 WARN rtspsrc gstrtspsrc.c:6161:gst_rtspsrc_send:<rtspsrc0> error: ERROR (451)
0:00:00.142861824 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7514:gst_rtspsrc_retrieve_sdp:<rtspsrc0> free connection
0:00:00.142881632 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4715:gst_rtsp_conninfo_close:<rtspsrc0> closing connection...
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unhandled error
Additional debug info:
gstrtspsrc.c(6161): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
ERROR (451)
0:00:00.142999552 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4721:gst_rtsp_conninfo_close:<rtspsrc0> freeing connection...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
0:00:00.143094272 16954 0x5565d205e0 WARN rtspsrc gstrtspsrc.c:7548:gst_rtspsrc_open:<rtspsrc0> can't get sdp
0:00:00.143167552 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command LOOP
0:00:00.143190560 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
0:00:00.143211872 16954 0x5565d205e0 WARN rtspsrc gstrtspsrc.c:5628:gst_rtspsrc_loop:<rtspsrc0> we are not connected
0:00:00.143229376 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5636:gst_rtspsrc_loop:<rtspsrc0> pausing task, reason flushing
0:00:00.143245600 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd WAIT
0:00:00.143261536 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5585:gst_rtspsrc_loop_send_cmd:<rtspsrc0> cancel previous request LOOP
0:00:00.143277120 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush busy LOOP
Setting pipeline to READY ...
0:00:00.143292736 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
0:00:00.143406048 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd CLOSE
0:00:00.144448928 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush busy WAIT
0:00:00.144490976 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
0:00:00.144570816 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command CLOSE
0:00:00.144601280 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
Setting pipeline to NULL ...
0:00:00.144779040 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:8422:gst_rtspsrc_stop:<rtspsrc0> stopping
0:00:00.144832896 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd WAIT
0:00:00.144854048 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush busy CLOSE
0:00:00.144873824 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
0:00:00.144906176 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7569:gst_rtspsrc_close:<rtspsrc0> TEARDOWN...
0:00:00.144926176 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7574:gst_rtspsrc_close:<rtspsrc0> not ready, doing cleanup
0:00:00.144944000 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:7637:gst_rtspsrc_close:<rtspsrc0> closing connection...
0:00:00.144960768 16954 0x5565d205e0 DEBUG rtspsrc gstrtspsrc.c:2058:gst_rtspsrc_cleanup:<rtspsrc0> cleanup
0:00:00.145016928 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:7569:gst_rtspsrc_close:<rtspsrc0> TEARDOWN...
0:00:00.145036704 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:7574:gst_rtspsrc_close:<rtspsrc0> not ready, doing cleanup
0:00:00.145054016 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:7637:gst_rtspsrc_close:<rtspsrc0> closing connection...
0:00:00.145070752 16954 0x5565d95150 DEBUG rtspsrc gstrtspsrc.c:2058:gst_rtspsrc_cleanup:<rtspsrc0> cleanup
Freeing pipeline ...