IP address

Do you want the IP address to be based on the camera serial number?
 
You can programmatically get serial number of all LAN devices on same subnet.

You might want to check out the official NetSDK:


Alternatively, you might want to try mimicking what the SADP tool does, namely sending out a broadcast packet and check the responses. Wireshark or tcpdump will help here.

uPnP (SSDP) will also provide another method, but uPnP is not recommended and is disabled by default on Hikvision devices.
 
  • Like
Reactions: alastairstevenson
The serial number and ip address aren’t linked in any way logically and very much depends on your exact network and how it’s configured so how are you proposing that this be implemented?
 
I'm still not really clear on what you are trying to do, as what you've said is open to interpretation, but another possible relevant option is to use your own local DNS zone (or simply the hosts file on your computer(s)).

So you could resolve say DS-2CD2385G1-I20190111AAWRD49029004 or 49029004 to 192.168.1.10 or whatever. This would be good practice if you need to address devices by serial.


If you mean you want camera DS-2CD2385G1-I20190111AAWRD49029004 to be assigned an IP address based on 49029004 then you could convert it to hex (0x2EC1F8C) and then use the last 6 digits on a /8 subnet. So 10. 236.31.140

That's pretty bad practice though, and if you had a serial to IP that a) conflicts b) was 10.255.255.255 broadcast etc then you have a problem. All in all I wouldn't recommend this, and might not be what you were trying to ask for anyway.

You would have more options if using IPv6 rather than IPv4