EDIT: I do know how to access camera when I have its IP address. The question is how to check if the specified IP address in local network belongs to an IP camera.
I work in a small local network with one router. The Range of available addresses in that network is: from 192.168.0.0
to 192.168.0.255
There is an IP camera connected to that network. The address of that camera is: 192.168.0.12
.
I queried the router for its ARP table in command line by using the arp -a
command. It is shown here (green color).
I discovered that address by AXIS IP Utility , but I would like to be able to do so programatically.
The camera model is: Axis m1011w
EDIT2 : Thanks to OnoSendai I got the possible IP addresses pool from the router's ARP table:
How do I query each one of the listed IP addresses (for example 192.168.0.12
) to make sure it is an IP camera?
I do believe this model offers a HTTP RTSP service at port 554. You can try to open a TCP connection to it - if the device accepts the incoming connection, then it may be the camera.
If you have a proper username/password credential pair to access it, then you may access the RTSP service by using this URL:
rtsp://[username]:[password]@[ip.address]:554/axis-media/media.amp
Here's a link to their spec:
http://www.axis.com/en/products/cam_m1011w/index.htm
And here the access instructions:
http://www.wowza.com/forums/content.php?39
In order to list all IP addresses on your local network, you can read the information dumped by the ARP command by using this snippet:
static List<string> GetARP()
{
List<string> _ret = new List<string>();
Process netUtility = new Process();
netUtility.StartInfo.FileName = "arp.exe";
netUtility.StartInfo.CreateNoWindow = true;
netUtility.StartInfo.Arguments = "-a";
netUtility.StartInfo.RedirectStandardOutput = true;
netUtility.StartInfo.UseShellExecute = false;
netUtility.StartInfo.RedirectStandardError = true;
netUtility.Start();
StreamReader streamReader = new StreamReader(netUtility.StandardOutput.BaseStream, netUtility.StandardOutput.CurrentEncoding);
string line = "";
while ((line = streamReader.ReadLine()) != null)
{
if (line.StartsWith(" "))
{
var Itms = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (Itms.Length == 3)
_ret.Add(Itms[0]);
}
}
streamReader.Close();
return _ret;
}
The function will return a List<string>
containing all local IP addresses (as present at the router's ARP table).
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.