最后,我想从 Axis 安全摄像头获取 RSTP 流,然后使用 Gstreamers GstRTSPServer 对象使其可用于重新流式传输。现在虽然我什至无法让示例 videotestsrc 在任何播放器中播放。
我一直在关注这里找到的帖子:
GStreamer 启动 RTSP 服务器,用于重新流式传输 IP 摄像机 H264
我已经在控制台中构建并运行了示例代码,但无法在我找到的任何播放器中查看流。我在这里使用的确切代码:
https://github.com/GStreamer/gst-rtsp-server/blob/master/examples/test-readme.c
我使用的两台 Windows 10 计算机都在同一个网络上,我可以双向 ping,两台计算机上的防火墙都完全关闭。
我使用命令尝试了 VLC 播放器、Axis Media Control SDK 修改示例和 GStreamer:
gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/test latency=0 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
gst-launch-1.0 rtspsrc location=rtsp://10.2.3.10:8554/test latency=0 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
VLC 在日志中声明连接被主动拒绝。它似乎正在尝试连接到端口 80?不确定我是否正确阅读。请参阅下面的 VLC 日志。完整日志从本地机器粘贴到此处: https ://pastebin.com/my3kTsRV ,此处从第二台机器 粘贴: https ://pastebin.com/g1q47UBm
...Connection to server failed: No connection could be made because the target machine actively refused it
Opening connection to 127.0.0.1, port 80...
...Connection to server failed: No connection could be made because the target machine actively refused it
[06421494] live555 demux debug: connection error -10057
[06421494] live555 demux error: Failed to connect with rtsp://127.0.0.1:8554/test
Axis Media Control (AMC) 在本地和辅助计算机上都出现错误:
503 Service Unavailable
The maximum number of clients are already connected.
尝试使用 GStreamer 命令进行连接时,我在本地和辅助计算机上都收到以下错误:
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Unhandled error
Additional debug info:
gstrtspsrc.c(5633): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Service Unavailable (503)
ERROR: pipeline doesn't want to preroll.
使用 VLC、AMC 和 GStreamer,我可以直接从摄像机中提取流,所以至少有些东西可以工作。在没有 GstRTSPServer 的情况下,我也能够成功运行其他 GStreamer 示例。
如果您想/需要我尝试任何事情,请告诉我。