Skip to content

Azure/video-analyzer-vscode-extension

Repository files navigation

Deprecated. Azure Video Analyzer Extension for VSCode

Deprecated. We’re retiring the Azure Video Analyzer preview service, you're advised to transition your applications off of Video Analyzer by 01 December 2022. This extension is no longer being maintained.

The Azure Video Analyzer extension makes it easy to edit and manage Video Analyzer pipelines. The steps below closely mirror our how-to guide on how to use the Visual Studio Code extension for Azure Video Analyzer.

If you have already connected to your IoT Hub and are looking for reference on how to use the extension, please go to our reference guide on the Visual Studio Code extension for Azure Video Analyzer.

Suggested Pre-reading

Prerequisites

Note

The images in this article are based on the Continuous video recording and playback tutorial.

Set up Azure resources

Deploy to Azure

The deployment process will take about 20 minutes. Upon completion, you will have certain Azure resources deployed in the Azure subscription, including:

  1. Video Analyzer account - This cloud service is used to register the Video Analyzer edge module, and for playing back recorded video and video analytics.
  2. Storage account - For storing recorded video and video analytics.
  3. Managed Identity - This is the user assigned managed identity used to manage access to the above storage account.
  4. Virtual machine - This is a virtual machine that will serve as your simulated edge device.
  5. IoT Hub - This acts as a central message hub for bi-directional communication between your IoT application, IoT Edge modules and the devices it manages.

If you run into issues with Azure resources that get created, please view our troubleshooting guide to resolve some commonly encountered issues.

Set up your development environment

Obtain your IoT Hub connection string

To make calls to the Video Analyzer Edge module, a connection string is first needed to connect the Visual Studio Code extension to the IoT Hub.

  1. In the Azure portal, go to your IoT Hub account.
  2. Look for Shared access policies in the left pane and select it.
  3. Select the policy named iothubowner.
  4. Copy the Primary connection string value. It will look like HostName=xxx.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=XXX.

Connect the Visual Studio Code extension to the IoT Hub

Using your IoT Hub connection string, connect the Visual Studio Code extension to the Video Analyzer module.

  1. In Visual Studio Code, select the Azure Video Analyzer icon from the activity bar on the far left-hand side.

  2. In the Video Analyzer extension pane, click on the Enter Connection String button.

  3. At the top, paste the IoT Hub connection string.

  4. Select the device where AVA is deployed. The default is named avasample-iot-edge-device.

  5. Select the Video Analyzer module. The default is named avaedge.

    Gif showing how to enter the connection string

The Video Analyzer extension pane should now show the connected device with all of its modules. Below the modules are where pipeline topologies are listed. By default, there are no pipeline topologies deployed.

Create a pipeline topology

A pipeline topology enables you to describe how live video or recorded videos should be processed and analyzed for your custom needs through a set of interconnected nodes.

  1. On the left under Modules, right click on Pipeline topologies and select Create pipeline topology.

  2. Along the top, under Try sample topologies, under Continuous Video Recording, select Record to Azure Video Analyzer video. When prompted, click Proceed.

  3. Click Save in the top right.

    Gif showing how to add a topology

Notice that there is now an entry in the Pipeline topologies list on the left labeled CVRToVideoSink. This is a pipeline topology, where some of the parameters are defined as variables.

Create a live pipeline

A live pipeline is an instance of a pipeline topology. The variables in a pipeline topology are filled when a live pipeline is created.

  1. On the left under Pipeline topologies, right click on CVRToVideoSink and select Create live pipeline.

  2. For Instance name, put in livePipeline1.

  3. In the Parameters section, under the rtspUrl parameter, put in rtsp://rtspsim:554/media/camera-300s.mkv.

  4. In the top right, click Save and activate.

    Gif showing how to create and activate a live pipeline

Now that a live pipeline has been activated, operational events can be viewed by clicking on the Start Monitoring Built-in Event Endpoint button on the IoT Hub extension, as shown in the Continuous video recording and playback tutorial.

If you are looking for more instructions on the extension, please go to our reference doc on the Visual Studio Code extension for Azure Video Analyzer.

Contributing

Have a suggestion for the Azure Video Analyzer extension? Submit a new issue and a PR with an updated package.json and README.md and we'll take a look!

Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

MIT