【发布时间】:2016-05-16 18:17:48
【问题描述】:
我想使用 RTSP 协议连接到 IP 摄像机。为此,我使用 Visual C++。我搜索并找到 cURL 库并从 libcurl 站点下载了 rtsp.c。
我使用 CMake 将 cURL 代码转换为适用于 Visual Studio 的 sln 文件,然后我创建了一个解决方案并执行其他步骤来运行 rtsp.c 示例。
现在我可以使用rtsp.c 连接到我的IP 摄像机并且没有收到运行时错误,但是我在WireShark 上收到“ICMP Destination Unreachable (Port Unreachable)”并且没有收到流。
另一方面,我可以使用 VLC Player 连接到我的 IP 摄像机。我更改了rtsp.c 上的端口号,但问题没有解决。
我读了this,但我不知道问题出在哪里?我该如何解决?
已编辑:
我使用了this RTSP code 和this RTP code,现在我只收到一个包含此消息的 RTP 数据包:
<?xml version="1.0" encoding="UTF-8"?>
<tt:MetaDataStream xmnls:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
<tt:Event>
<wsnt:NotificationMessage>
<wsnt:Topic Dialect="http://www.onvif.org/ver10/tec/topicExpression/ConcreteSet">
tns1:Device/Tampering
</wsnt:Topic>
<wsnt:Message>
<tt:Message UtcTime="2016-05-03T00:14:33.775">
<tt:Source>
<tt:SimpleItem Name="VideoSourceConfigurationToken" Value="VideoSource0">
</tt:SimpleItem>
</tt:Source>
<tt:Data>
<tt:SimpleItem Name="Level" Value="Trigger">
</tt:SimpleItem>
<tt:SimpleItem Name="Percentage" Value="32">
</tt:SimpleItem>
</tt:Data>
</tt:Message>
</wsnt:Message>
</wsnt:NotificationMessage>
</tt:Event>
EDITED-2:
我搜索了,现在我知道上面的消息是设备篡改消息,它在相机上显示运动检测事件,但我不知道为什么 RTSP 播放命令在 RTP 端口上接收设备篡改数据包?
【问题讨论】:
标签: c libcurl rtsp ip-camera onvif