简体   繁体   English

获取连接到Android上的WiFi热点的IP摄像机(无线摄像机)的URL

[英]get URL of the IP camera (Wireless Camera) connected to my WiFi Hotspot on Android

I have Wireless cameras connected to my WiFi hotspot on my Android device. 我将无线摄像头连接到了Android设备上的WiFi热点。 I already have the IPs of the camera from /proc/net/arp. 我已经从/ proc / net / arp获得了摄像机的IP。 I am also able to run the video for known rtsp URLs, for testing cameras. 我还可以针对已知的rtsp URL运行视频,以测试摄像机。 But end user can connect to any cameras with their hotspot. 但是最终用户可以使用其热点连接到任何摄像机。 So, I need to know the rtsp URL at runtime. 因此,我需要在运行时知道rtsp URL。 For RTSP on android port is always 554 for RTSP. 对于Android上的RTSP,RTSP始终为554。 I have su access to the device and am ready to use SOAP as well. su可以访问该设备,并且也可以使用SOAP。

Also, app is running on Android 7.0 and up. 此外,该应用程序在Android 7.0及更高版本上运行。

Any help is really appreciated. 任何帮助都非常感谢。

The steps you must perform are the following: 您必须执行的步骤如下:

  1. Discover the device (if you don't know the IP address and the XAddr of the device service) 发现设备(如果您不知道设备服务的IP地址和XAddr)
  2. Get the XAddr of the media service, by invoking GetServices or GetCapabilities on the device service. 通过在设备服务上调用GetServices或GetCapabilities,获取媒体服务的XAddr。 It may be the same, but there are cameras that don't have a unique XAddr for all the services 可能是一样的,但是有些相机没有针对所有服务的唯一XAddr
  3. Invoke GetProfiles on the media service 在媒体服务上调用GetProfiles
  4. Invoke GetStreamingUri on the media service passing the profile that you want. 在媒体服务上调用GetStreamingUri,以传递所需的配置文件。
  5. Request streaming from the URI you got in the previous step. 从上一步中获得的URI请求流式传输。

Additional information 附加信息

  • On android you probably may want to use ksoap2-android . 在android上,您可能要使用ksoap2-android
  • GetProfiles returns the list of profiles as you can see here . GetProfiles返回配置文件列表,如此处所示 You don't get the streaming URI from GetProfilesResponse, you have to invoke GetStreamURI on the profile for which you want to get the address for RTSP playback. 您没有从GetProfilesResponse获取流URI,必须在要为其获取RTSP播放地址的配置文件上调用GetStreamURI。
  • usually XAddr refers to services, URI refers to the addresses for streaming or snapshot 通常, XAddr指服务, URI指流或快照的地址
  • knowing the IP address can save you time guessing that the camera has the device service on http://<ip_address>/onvif/device_service , which is the most common entyr point, but I found some devices not following it (different ports, running only https, ooo) 知道IP地址可以节省您的时间,因为您猜测相机在http://<ip_address>/onvif/device_service上具有设备服务,这是最常见的入口点,但是我发现某些设备没有跟随它(不同的端口,正在运行只有https,哦)

I am not familiar with your cameras, but I'd trust more che Panasonic camera than the chinese one. 我对您的相机不熟悉,但是我会比中国相机更信任che Panasonic相机。 As you can see here , the camera from Panasonic has a public ONVIF Profile S DoC . 正如您在此处看到的那样,松下的摄像机具有公开的ONVIF配置文件S DoC。 Don't trust anything that does not have a valid DoC listed on the ONVIF website. 不要信任ONVIF网站上没有列出有效DoC的任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM