簡體   English   中英

視頻流錯誤的 Gstreamer rtsp 管道

[英]Gstreamer rtsp pipeline for videostream error

嘗試使用 gstreamer 連接到 rtsp 視頻流時遇到問題。 視頻流源自 IP 攝像頭。

在 vlc 和 opencv(沒有 gstreamer)中使用相同的 rtsp 地址可以正常工作。

測試時使用此管道:

GST_DEBUG=1 gst-launch-1.0 -v rtspsrc location=rtsp://admin:password$@192.168.2.1:554/ch1/main/av_stream ! decodebin ! autovideosink

運行管道時出現此錯誤:

Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://admin:password192.168.2.1:554/ch1/main/av_stream
0:00:03.105886290  6248 0x559fd7cf1520 ERROR                default gstrtspconnection.c:1046:gst_rtsp_connection_connect_with_response: failed to connect: Error resolving “admin”: Name or service not known
0:00:03.105953476  6248 0x559fd7cf1520 ERROR                rtspsrc gstrtspsrc.c:5047:gst_rtsp_conninfo_connect:<rtspsrc0> Could not connect to server. (Generic error)
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and writing.
Additional debug info:
gstrtspsrc.c(7893): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Failed to connect. (Generic error)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

如果我使用的密碼不正確,我也會收到相同的錯誤消息。 這讓我相信 gstreamer 無法登錄到 ip 攝像頭視頻流。

出於跟蹤和錯誤的目的,我在沒有 usr 或密碼的情況下嘗試了此管道:

GST_DEBUG=1 gst-launch-1.0 -v rtspsrc location=rtsp://192.168.2.1:554/ch1/main/av_stream ! decodebin ! autovideosink
Setting pipeline to PAUSED ...
error: XDG_RUNTIME_DIR not set in the environment.
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.2.1:554/ch1/main/av_stream
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unauthorized
Additional debug info:
gstrtspsrc.c(6540): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Unauthorized (401)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

rtspsrc具有用於身份驗證的屬性。

嘗試使用

gst-launch-1.0 -v rtspsrc user-id=admin user-pw=password location=rtsp://192.168.2.1:554/ch1/main/av_stream ! decodebin ! autovideosink

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM