Discovering and Using Authentication-Enabled Onvif Cameras
Make sure you have at least one Onvif camera that is reachable so Onvif discovery handler can discovery your Onvif camera. To test accessing Onvif with credentials, make sure your Onvif camera is authentication-enabled. Write down the username and password, they are required in the flow below.
Preparation
Add Akri helm chart repo.
# add akri helm charts repo
helm repo add akri-helm-charts https://project-akri.github.io/akri/
# ensure helm repos are up-to-date
helm repo updateAcquire Onvif camera's device uuid
In real product scenarios, the device uuids are acquired directly from the vendors or already known before installing Akri Configuration. If you already know the device uuids, you can skip this and go to the next step.
First use the following helm chart to deploy an Akri Configuration and see if your camera is discovered.
helm install akri akri-helm-charts/akri-dev \
--set onvif.discovery.enabled=true \
--set onvif.configuration.name=akri-onvif \
--set onvif.configuration.enabled=true \
--set onvif.configuration.capacity=3 \
--set onvif.configuration.brokerPod.image.repository="nginx" \
--set onvif.configuration.brokerPod.image.tag="stable-alpine"Here is the result of running the installation command above on a cluster with 1 control plane and 2 work nodes. There is one Onvif camera connects to the network, thus 1 pods running on each node.
Get the device uuid from the Akri Instance. Below is an example, the Onvif discovery handler discovers the camera and expose the device's uuid. Write down the device uuid for later use. Note that in real product scenarios, the device uuids are acquired directly from the vendors or already known before installing Akri Configuration.
Set up Kubernetes secrets
Now we can set up the credential information to Kubernetes Secret. Replace the device uuid and the values of username/password with information of your camera.
Upgrade the Akri configuration
Upgrade the Akri Configuration to include the secret information and the sample video broker container.
With the secret information, the Onvif discovery handler is able to discovery the Onvif camera and the video broker is up and running
Deploying the sample video streaming application
Deploy the sample video streaming application Instructions described from the step 4 of camera demo
Deploy a video streaming web application that points to both the Configuration and Instance level services that were automatically created by Akri.
Copy and paste the contents into a file and save it as akri-video-streaming-app.yaml
Deploy the video stream app
Determine which port the service is running on. Save this port number for the next step:
SSH port forwarding can be used to access the streaming application. Open a new terminal, enter your ssh command to to access your machine followed by the port forwarding request. The following command will use port 50000 on the host. Feel free to change it if it is not available. Be sure to replace <streaming-app-port> with the port number outputted in the previous step.
Navigate to http://localhost:50000/ using browser. The large feed points to Configuration level service, while the bottom feed points to the service for each Instance or camera.
Clean up
Close the page http://localhost:50000/ from the browser
Delete the sample streaming application resources
Delete the Secret information
Delete deployment and Akri installation to clean up the system.
Last updated
Was this helpful?