Deploy Azure Video Analyzer to an IoT Edge device
Alternatively, check out topics under Create video applications in the service.
Note
Azure Video Analyzer has been retired and is no longer available.
Azure Video Analyzer for Media is not affected by this retirement. It is now rebranded to Azure Video Indexer. Click here to read more.
This article describes how you can deploy the Azure Video Analyzer edge module on an IoT Edge device which has no other modules previously installed. When you finish the steps in this article you will have a Video Analyzer account created and the Video Analyzer module deployed to your IoT Edge device, along with a module that simulates an RTSP-capable IP camera. The process is intended for use with the quickstarts and tutorials for Video Analyzer. You should review the production readiness and best practices article if you intend to deploy the Video Analyzer module for use in production.
Note
The process outlined in this article will uninstall edge modules, if any, that are installed on your IoT Edge device.
Prerequisites
- An x86-64 or an ARM64 device running one of the supported Linux operating systems
- An Azure account that has an active subscription
- Create and setup IoT Hub
- Register IoT Edge device
- Install the Azure IoT Edge runtime on Debian-based Linux systems
Create resources on IoT Edge device
Azure Video Analyzer module should be configured to run on the IoT Edge device with a non-privileged local user account. The module needs certain local folders for storing application configuration data. For this how-to guide we are leveraging a RTSP simulator that relays a video feed in real time to AVA module for analysis. This simulator takes as input pre-recorded video files from an input directory. The following script will prepare your device to be able to be used with our quickstarts and tutorials.
https://aka.ms/ava/prepare-device
bash -c "$(curl -sL https://aka.ms/ava-edge/prep_device)"
The prep-device script used above automates the task of creating input and configuration folders, downloading video input files, and creating user accounts with correct privileges. Once the command finishes successfully, you should see the following folders created on your edge device.
/home/localedgeuser/samples
/home/localedgeuser/samples/input
/var/lib/videoanalyzer
/var/media
Note the video files ("*.mkv") in the /home/localedgeuser/samples/input folder, which are used to simulate live video.
Creating Azure resources and deploying edge modules
The next step is to create the required Azure resources (Video Analyzer account, storage account, user-assigned managed identity), registering a Video Analyzer edge module with the Video Analyzer account, and deploying the Video Analyzer edge module and the RTSP simulator module to the IoT Edge device.
Click the Deploy to Azure button
Warning
Do not use this with IoT Edge devices that already have edge modules installed, such as a Percept DK. Also not supported with Azure Stack Edge.
Select your subscription
Select your preferred region
Select the resource group to which your IoT Hub and IoT Edge device belong
In the dropdown menu for Do you need an edge device?, select the Use an existing edge device option
Click Next
Select the Existing IoT Hub Name that your IoT Edge device is connected to
Click Next
On the final page, click Create
It may take a few moments for the Azure resources to be created and the edge modules to be deployed.
Verify your deployment
After creating the deployment, in the Azure portal navigate to the IoT Edge device page of your IoT hub.
- Select the IoT Edge device that you targeted with the deployment to open its details.
- In the device details, verify that the modules are listed as both Specified in deployment and Reported by device.
It may take a few moments for the modules to be started on the device and then reported back to IoT Hub. Refresh the page to see an updated status. Status code: 200 –OK means that the IoT Edge runtime is healthy and is operating fine.
Invoke a direct method
Next, lets test the sample by invoking a direct method. Read direct methods for Azure Video Analyzer to understand all the direct methods provided by our avaEdge module.
Clicking on the edge module you created, will take you to its configuration page.
Click on the Direct Method menu option.
Note
You will need to add a value in the Connection string sections as you can see on the current page. You do not need to hide or change anything in the Setting name section. It is ok to let it be public.
Next, Enter "pipelineTopologyList" in the
Method Name
box.Next, copy and paste the below JSON payload in the payload box.
{ "@apiVersion": "1.1" }
Click on Invoke Method option on top of the page
You should see a status 200 message in the
Result
box
Next steps
Try Quickstart: Get started - Azure Video Analyzer
Tip
If you proceed with the above quickstart, when invoking the direct methods using Visual Studio Code, you will use the device that was added to the IoT Hub via this article, instead of the default avasample-iot-edge-device
.