Restrict Discoverable Cameras with Cameras.yml
To restrict which cameras Zivid SDK can connect to, download Cameras.yml, list the allowed IP addresses or hostnames in it, and place it in the Zivid configuration folder.
How does Zivid SDK find cameras?
Zivid SDK uses Multicast DNS (mDNS) for auto-discovering cameras on the network.
In SDK 2.7 and earlier, cameras with non-default IPs had to be listed in the Cameras.yml file in the Zivid configuration folder, which the SDK searched through to discover cameras.
Even though mDNS removes the requirement of Cameras.yml, this file can still be used to override which cameras the SDK can connect to.
Cameras.yml therefore has the function of restricting which cameras the PC can connect to, if provided.
If you only need to connect to a specific camera at a known address, you can connect to it directly by its IP address or hostname, without Cameras.yml.
See Capture Tutorial for how to do this.
Cameras.yml
If you wish to restrict the IPs Zivid SDK searches for, download Cameras.yml and place it in the Zivid configuration folder, as shown below.
Windows
mkdir %LOCALAPPDATA%\Zivid\API
move %HOMEPATH%\Downloads\Cameras.yml %LOCALAPPDATA%\Zivid\API\
Ubuntu
mkdir --parents "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API
mv ~/Downloads/Cameras.yml "${XDG_CONFIG_HOME-$HOME/.config}"/Zivid/API/
Caution
Any existing Config file will be overwritten.
Caution
Zivid configuration files must use .yml file extension ( not .yaml).
Some examples of how Cameras.yml can look like are shown below, either using hostnames or IP addresses.
Option: Restrict IP addresses
__version__: 1
Cameras:
NetworkCameras:
- NetworkCamera:
Host: 172.28.60.5
- NetworkCamera:
Host: 172.28.60.6
- NetworkCamera:
Host: 172.28.60.7
Option: Restrict hostnames
__version__: 1
Cameras:
NetworkCameras:
- NetworkCamera:
Host: zivid-2152D404.local
- NetworkCamera:
Host: zivid-20205M19.local
- NetworkCamera:
Host: zivid-21389K63.local
Next Steps
Go back to Connecting to the camera.