See Far, Go Further
(HIKVISION's slogan. Me likey)
I've been running my truenas server at home for a couple of years now. Initially, I used it for media streaming and peer-to-peer file sharing :). Later on, I learned about this app - Frigate NVR, and learned that I can easily connect my Google-Coral TPU to it, streaming video to models like YOLO, enjoying local high-level AI detections without choking my server's CPU. Like many NVR's Frigate tags and creates clips of captured interesting things; it runs inference both on video and audio streamed from the camera (So I could be alerted if there's a crying baby, or get a fire-alarm detection). Although applications that come with off-the-shelf cameras can do the same (usually for the price of some online storage), the privacy of running it locally is a relief.
A few months back, I bought an IP camera and started tinkering with Frigate.
Quickly learning that it is really powerful open-source software!
Having just 1 IP camera doesn't suffice. Wanted more coverage, I got this old IP camera - HIKVISION DS-2CD1021 from a friend.
These cameras's designed to work with a DVR, which creates a local network, with a fixed IP.
Connecting it to my network did nothing since the camera is configured to have a static IP.
I can configure it to DHCP through the camera's login page, but first I needed to access it...
Step 1 - Reading HIKVISION DS-2CD1021 specs
Frigate can be configured to work with many streaming protocols.
This camera supports many:
TCP/IP, ICMP, HTTP, HTTPS, FTP, DHCP, DNS, DDNS, RTP, RTSP, RTCP,
NTP, UPnP, SMTP, SNMP, IGMP, QoS, IPv6, Bonjour, IPv4, UDP, SSL/TLS
I will use the RSTP.
According to the specs, the default IP address is 192.168.1.64. I need to create a static IP network with subnet 192.168.1.1. Luckily, I have an Omada controller running on my TrueNAS server, which made this procedure rather easy:

Also, I need to set my PC to have a static IP network connection:

Now, I should just enter 192.168.1.64 in the browser and get a login screen of the camera.
Sadly, and expectedly, it didn't work., well, this camera is used and was connected to a DVR before, so my guess is that the default IP changed.
In their user guide, there's a Windows-only program called SADP that automatically detects the connected camera's IP address.
Switching to a Windows machine.: The SADP software surprisingly worked, figured out that the camera's IP is - 192.168.254.3:

Once I've configured a static IP wired-network connection, I've managed to access http://192.168.254.3/doc/page/login.asp yey! Yet it was password-protected (and the obvious admin admin didn't work).
After some reading online:
- I need to use the SADP; select the problematic camera from the list, press the forget password, and export a code.
- Then send this code to the local HIKVISION vendor's tech support (In my case
tech@hviil.co.il). - They will return a generated XML file containing the temporary password.
- Using the SADP tool - I need to import this XML and insert a new password.
- I've successfully reset the password! Now we can start tinkering with it :)
One last thing before integrating with Frigate - have a sanity test, and stream video-feed to VLC.
Using this URL rtsp://admin:anIPCamera1!@192.168.0.143:554/Streaming/Channels/101, and voila!:

This camera will come in handy.
It has two streaming channels.
It supports up to 1080p, enough for object detection.
It can be powered with PoE, which is generally a good thing
Most importantly, adding it to should be straightforward, just expand my Frigate camera's config JSON file with this:
cameras:
hikvision_ds_2cd1021:
ffmpeg:
inputs:
- path: rtsp://admin:anIPCamera1!@192.168.0.143:554/Streaming/Channels/101
roles:
- detect
- path: rtsp://admin:anIPCamera1!@192.168.0.143:554/Streaming/Channels/102
roles:
- record # Changed to record for this camera, assuming it's the higher res for 510a
- audio # Add this if you want to enable audio detection later
audio:
enabled: True # <- enable audio events for the upstairs camera
listen:
- bark
- fire_alarm
- scream
- speech
- yell
detect:
width: 1280
height: 720
fps: 10
objects:
track:
- person
# - car
- dog
snapshots:
enabled: true
timestamp: true
bounding_box: true
record:
enabled: true
retain:
days: 7
mode: motion
Yup - plug and play :)
In the image below, Frigate's UI, with 2 cameras. The left one is this HIKVISION

Final thoughts
I must confess, HIKVISION's security is tight.
Also, I was sceptical they would help me with this old 2018 IP camera that a friend gave me.
Playing with Frigate is fun. But it's a fraction of what I plan:
Every frigate detection can be published over MQTT... (food for thought)
Cheers, Gal