简体   繁体   中英

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. I already have the IPs of the camera from /proc/net/arp. I am also able to run the video for known rtsp URLs, for testing cameras. But end user can connect to any cameras with their hotspot. So, I need to know the rtsp URL at runtime. For RTSP on android port is always 554 for RTSP. I have su access to the device and am ready to use SOAP as well.

Also, app is running on Android 7.0 and up.

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)
  2. Get the XAddr of the media service, by invoking GetServices or GetCapabilities on the device service. It may be the same, but there are cameras that don't have a unique XAddr for all the services
  3. Invoke GetProfiles on the media service
  4. Invoke GetStreamingUri on the media service passing the profile that you want.
  5. Request streaming from the URI you got in the previous step.

Additional information

  • On android you probably may want to use ksoap2-android .
  • GetProfiles returns the list of profiles as you can see here . 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.
  • usually XAddr refers to services, URI refers to the addresses for streaming or snapshot
  • 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)

I am not familiar with your cameras, but I'd trust more che Panasonic camera than the chinese one. As you can see here , the camera from Panasonic has a public ONVIF Profile S DoC . Don't trust anything that does not have a valid DoC listed on the ONVIF website.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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