Deprecated. Azure Video Analyzer Edge client library for Java

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 SDK is not longer maintained.

Azure Video Analyzer is an Azure Applied AI Service that provides a platform for you to build intelligent video applications that can span both edge and cloud infrastructures. The platform offers the capability to capture, record, and analyze live video along with publishing the results, video and video analytics, to Azure services at the edge or in the cloud. It is designed to be an extensible platform, enabling you to connect different video inferencing edge modules such as Cognitive services modules, or custom inferencing modules that have been trained with your own data using either open-source machine learning or Azure Machine Learning.

Use the client library for Video Analyzer Edge to:

  • Simplify interactions with the Microsoft Azure IoT SDKs
  • Programmatically construct pipeline topologies and live pipelines

Product documentation | Direct methods | Source code

Getting started


  • A Java Development Kit, version 8 or later.
  • You need an active Azure subscription and a IoT device connection string to use this package.
  • To interact with Azure IoT Hub you will need to add their dependency to your pom.xml

Include the package

Install the Azure Video Analyzer Edge client library for Java with Maven:


  • You will need to use the version of the SDK that corresponds to the version of the Video Analyzer edge module you are using.

    SDK Video Analyzer edge module
    1.0.0-beta.5 1.1
    1.0.0-beta.4 1.0
    1.0.0-beta.3 1.0
    1.0.0-beta.2 1.0
    1.0.0-beta.1 1.0

Creating a pipeline topology and making requests

Please visit the Examples for starter code.

Key concepts

Pipeline topology vs live pipeline

A pipeline topology is a blueprint or template for creating live pipelines. It defines the parameters of the pipeline using placeholders as values for them. A live pipeline references a pipeline topology and specifies the parameters. This way you are able to have multiple live pipelines referencing the same topology but with different values for parameters. For more information please visit pipeline topologies and live pipelines.


Creating a pipeline topology

To create a pipeline topology you need to define sources and sinks.

private static PipelineTopology buildPipeLineTopology() {
    IotHubMessageSource msgSource = new IotHubMessageSource("iotMsgSource")

    UsernamePasswordCredentials creds = new UsernamePasswordCredentials("${rtspUsername}", "${rtspPassword}");

    UnsecuredEndpoint endpoint = new UnsecuredEndpoint("${rtspUrl}")

    RtspSource rtspSource = new RtspSource("rtspSource", endpoint);

    NodeInput rtspInput = new NodeInput("rtspSource");

    OutputSelector rtspOutputSelector = new OutputSelector()
    ImageScale imageScale = new ImageScale()
    ImageFormatBmp imageFormat = new ImageFormatBmp();
    ImageProperties image = new ImageProperties()
    ExtensionProcessorBase httpExtension = new HttpExtension("inferenceClient", Arrays.asList(rtspInput), endpoint, image);

    NodeInput nodeInput = new NodeInput("inferenceClient");

    IotHubMessageSink msgSink = new IotHubMessageSink("msgSink",

    ParameterDeclaration userName = new ParameterDeclaration("rtspUserName", ParameterType.STRING);

    ParameterDeclaration password = new ParameterDeclaration("rtspPassword", ParameterType.SECRET_STRING);
    ParameterDeclaration url = new ParameterDeclaration("rtspUrl", ParameterType.STRING);
    ParameterDeclaration hubOutput = new ParameterDeclaration("hubSinkOutputName", ParameterType.STRING);

    PipelineTopologyProperties pipeProps = new PipelineTopologyProperties()
        .setParameters(Arrays.asList(userName, password, url, hubOutput))

    return new PipelineTopology(TOPOLOGY_NAME)

Creating a live pipeline

To create a live pipeline, you need to have an existing pipeline topology.

private static LivePipeline buildLivePipeline() {
    ParameterDefinition hubParam = new ParameterDefinition("hubSinkOutputName")
    ParameterDefinition userParam = new ParameterDefinition("rtspUserName")
    ParameterDefinition urlParam = new ParameterDefinition("rtspUrl")
    ParameterDefinition passParam = new ParameterDefinition("rtspPassword")

    LivePipelineProperties livePipelineProps = new LivePipelineProperties()
        .setParameters(Arrays.asList(urlParam, userParam, passParam, hubParam))

    return new LivePipeline(LIVE_PIPELINE_NAME)

Invoking a direct method

private static MethodResult invokeDirectMethodHelper(DeviceMethod client, String methodName, String payload) throws IOException, IotHubException {
    MethodResult result = null;
    try {
        result = client.invoke(iothubDeviceid, iothubModuleid, methodName, null, null, payload);
    } catch (IotHubException e) {
        System.out.println("An error has occurred.");

    return result;
PipelineTopologySetRequest setPipelineTopologyRequest = new PipelineTopologySetRequest(pipelineTopology);
MethodResult setPipelineResult = invokeDirectMethodHelper(dClient, setPipelineTopologyRequest.getMethodName(), setPipelineTopologyRequest.getPayloadAsJson());


When sending a method request using the IoT Hub's invoke remember to not type in the method request name directly. Instead use MethodRequestName.getMethodName()

Next steps


This project welcomes contributions and suggestions. 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

If you encounter any issues, please open an issue on our Github.

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 with any additional questions or comments.