1
1
---
2
- title : Azure Video Analyzer Edge client library for Java
2
+ title :
3
3
keywords : Azure, java, SDK, API, azure-media-videoanalyzer-edge, videoanalyzer
4
- author : ramya-rao-a
5
- ms.author : ramyar
6
- ms.date : 10/27/2021
4
+ author : joshfree
5
+ ms.author : jfree
6
+ ms.date : 04/30/2022
7
7
ms.topic : reference
8
- ms.prod : azure
9
- ms.technology : azure
10
8
ms.devlang : java
11
9
ms.service : videoanalyzer
12
10
---
11
+ # Deprecated. Azure Video Analyzer Edge client library for Java
13
12
14
- # Azure Video Analyzer Edge client library for Java - Version 1.0.0-beta.5
15
-
13
+ 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.
16
14
17
15
Azure Video Analyzer is an [ Azure Applied AI Service] [ 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] [ machine-learning ] .
18
16
@@ -76,40 +74,39 @@ A _pipeline topology_ is a blueprint or template for creating live pipelines. It
76
74
77
75
To create a pipeline topology you need to define sources and sinks.
78
76
79
- <!-- embedme C:\azure-sdk-for-java\sdk\videoanalyzer\azure-media-videoanalyzer-edge\src\samples\java\com\azure\media\videoanalyzer\edge\LvaInvokeModuleSample.java#L30-L79 -->
80
- ``` java
77
+ ``` java readme-sample-buildPipelineTopology
81
78
private static PipelineTopology buildPipeLineTopology() {
82
79
IotHubMessageSource msgSource = new IotHubMessageSource (" iotMsgSource" )
83
- .setHubInputName(" ${hubSourceInput}" );
80
+ .setHubInputName(" ${hubSourceInput}" );
84
81
85
82
UsernamePasswordCredentials creds = new UsernamePasswordCredentials (" ${rtspUsername}" , " ${rtspPassword}" );
86
83
87
84
UnsecuredEndpoint endpoint = new UnsecuredEndpoint (" ${rtspUrl}" )
88
- .setCredentials(creds);
85
+ .setCredentials(creds);
89
86
90
87
RtspSource rtspSource = new RtspSource (" rtspSource" , endpoint);
91
88
92
89
NodeInput rtspInput = new NodeInput (" rtspSource" );
93
90
94
91
OutputSelector rtspOutputSelector = new OutputSelector ()
95
- .setProperty(OutputSelectorProperty . MEDIA_TYPE )
96
- .setOperator(OutputSelectorOperator . IS )
97
- .setValue(" video" );
92
+ .setProperty(OutputSelectorProperty . MEDIA_TYPE )
93
+ .setOperator(OutputSelectorOperator . IS )
94
+ .setValue(" video" );
98
95
ImageScale imageScale = new ImageScale ()
99
- .setMode(ImageScaleMode . PRESERVE_ASPECT_RATIO )
100
- .setHeight(" 416" )
101
- .setWidth(" 416" );
96
+ .setMode(ImageScaleMode . PRESERVE_ASPECT_RATIO )
97
+ .setHeight(" 416" )
98
+ .setWidth(" 416" );
102
99
ImageFormatBmp imageFormat = new ImageFormatBmp ();
103
100
ImageProperties image = new ImageProperties ()
104
- .setScale(imageScale)
105
- .setFormat(imageFormat);
101
+ .setScale(imageScale)
102
+ .setFormat(imageFormat);
106
103
ExtensionProcessorBase httpExtension = new HttpExtension (" inferenceClient" , Arrays . asList(rtspInput), endpoint, image);
107
104
108
105
NodeInput nodeInput = new NodeInput (" inferenceClient" );
109
106
110
107
IotHubMessageSink msgSink = new IotHubMessageSink (" msgSink" ,
111
- Arrays . asList(nodeInput),
112
- " ${hubSinkOutputName}" );
108
+ Arrays . asList(nodeInput),
109
+ " ${hubSinkOutputName}" );
113
110
114
111
ParameterDeclaration userName = new ParameterDeclaration (" rtspUserName" , ParameterType . STRING );
115
112
@@ -118,53 +115,47 @@ private static PipelineTopology buildPipeLineTopology() {
118
115
ParameterDeclaration hubOutput = new ParameterDeclaration (" hubSinkOutputName" , ParameterType . STRING );
119
116
120
117
PipelineTopologyProperties pipeProps = new PipelineTopologyProperties ()
121
- .setParameters(Arrays . asList(userName, password, url, hubOutput))
122
- .setSources(Arrays . asList(rtspSource))
123
- .setSinks(Arrays . asList(msgSink))
124
- .setProcessors(Arrays . asList(httpExtension));
125
-
126
- PipelineTopology pipelineTopology = new PipelineTopology (TOPOLOGY_NAME )
127
- .setProperties(pipeProps);
118
+ .setParameters(Arrays . asList(userName, password, url, hubOutput))
119
+ .setSources(Arrays . asList(rtspSource))
120
+ .setSinks(Arrays . asList(msgSink))
121
+ .setProcessors(Arrays . asList(httpExtension));
128
122
129
- return pipelineTopology;
123
+ return new PipelineTopology (TOPOLOGY_NAME )
124
+ .setProperties(pipeProps);
130
125
}
131
126
```
132
127
133
128
### Creating a live pipeline
134
129
135
130
To create a live pipeline, you need to have an existing pipeline topology.
136
131
137
- <!-- embedme C:\azure-sdk-for-java\sdk\videoanalyzer\azure-media-videoanalyzer-edge\src\samples\java\com\azure\media\videoanalyzer\edge\LvaInvokeModuleSample.java#L85-L103 -->
138
- ``` java
132
+ ``` java readme-sample-buildLivePipeline
139
133
private static LivePipeline buildLivePipeline() {
140
134
ParameterDefinition hubParam = new ParameterDefinition (" hubSinkOutputName" )
141
- .setValue(" testHubOutput" );
135
+ .setValue(" testHubOutput" );
142
136
ParameterDefinition userParam = new ParameterDefinition (" rtspUserName" )
143
- .setValue(" testuser" );
137
+ .setValue(" testuser" );
144
138
ParameterDefinition urlParam = new ParameterDefinition (" rtspUrl" )
145
- .setValue(" rtsp://sample-url-from-camera" );
139
+ .setValue(" rtsp://sample-url-from-camera" );
146
140
ParameterDefinition passParam = new ParameterDefinition (" rtspPassword" )
147
- .setValue(" testpass" );
141
+ .setValue(" testpass" );
148
142
149
143
LivePipelineProperties livePipelineProps = new LivePipelineProperties ()
150
- .setParameters(Arrays . asList(urlParam, userParam, passParam, hubParam))
151
- .setTopologyName(TOPOLOGY_NAME );
152
-
153
- LivePipeline livePipeline = new LivePipeline (LIVE_PIPELINE_NAME )
154
- .setProperties(livePipelineProps);
144
+ .setParameters(Arrays . asList(urlParam, userParam, passParam, hubParam))
145
+ .setTopologyName(TOPOLOGY_NAME );
155
146
156
- return livePipeline;
147
+ return new LivePipeline (LIVE_PIPELINE_NAME )
148
+ .setProperties(livePipelineProps);
157
149
}
158
150
```
159
151
160
152
### Invoking a direct method
161
153
162
- <!-- embedme C:\azure-sdk-for-java\sdk\videoanalyzer\azure-media-videoanalyzer-edge\src\samples\java\com\azure\media\videoanalyzer\edge\LvaInvokeModuleSample.java#L132-L142 -->
163
- ``` java
154
+ ``` java readme-sample-invokeDirectMethodHelper
164
155
private static MethodResult invokeDirectMethodHelper(DeviceMethod client, String methodName, String payload) throws IOException , IotHubException {
165
156
MethodResult result = null ;
166
157
try {
167
- result = client. invoke(DEVICE_ID , MODULE_ID , methodName, null , null , payload);
158
+ result = client. invoke(iothubDeviceid, iothubModuleid , methodName, null , null , payload);
168
159
} catch (IotHubException e) {
169
160
System . out. println(" An error has occurred." );
170
161
System . out. println(e. toString());
@@ -174,10 +165,10 @@ private static MethodResult invokeDirectMethodHelper(DeviceMethod client, String
174
165
}
175
166
```
176
167
177
- <!-- embedme C:\azure-sdk-for-java\sdk\videoanalyzer\azure-media-videoanalyzer-edge\src\samples\java\com\azure\media\videoanalyzer\edge\LvaInvokeModuleSample.java#L160-L161 -->
178
- ``` java
168
+ ``` java readme-sample-setPipelineTopologyRequest
179
169
PipelineTopologySetRequest setPipelineTopologyRequest = new PipelineTopologySetRequest (pipelineTopology);
180
170
MethodResult setPipelineResult = invokeDirectMethodHelper(dClient, setPipelineTopologyRequest. getMethodName(), setPipelineTopologyRequest. getPayloadAsJson());
171
+ System . out. println(setPipelineResult. getPayload());
181
172
```
182
173
183
174
## Troubleshooting
@@ -212,15 +203,15 @@ additional questions or comments.
212
203
213
204
<!-- LINKS -->
214
205
215
- [ azure_cli ] : https://docs.microsoft.com /cli/azure
206
+ [ azure_cli ] : /cli/azure
216
207
[ azure_sub ] : https://azure.microsoft.com/free/
217
208
[ cla ] : https://cla.microsoft.com
218
209
[ code_of_conduct ] : https://opensource.microsoft.com/codeofconduct/
219
210
[ coc_faq ] : https://opensource.microsoft.com/codeofconduct/faq/
220
211
[ coc_contact ] :
mailto:[email protected]
221
212
[ package ] : https://aka.ms/ava/sdk/client/java
222
213
[ samples ] : https://aka.ms/video-analyzer-sample
223
- [ source ] : https://github.com/Azure/azure-sdk-for-java/tree/azure-media-videoanalyzer-edge_1.0.0-beta.5 /sdk/videoanalyzer
214
+ [ source ] : https://github.com/Azure/azure-sdk-for-java/tree/azure-media-videoanalyzer-edge_1.0.0-beta.6 /sdk/videoanalyzer
224
215
[ doc_direct_methods ] : https://go.microsoft.com/fwlink/?linkid=2162396
225
216
[ doc_pipelines ] : https://go.microsoft.com/fwlink/?linkid=2162396
226
217
[ doc_product ] : https://go.microsoft.com/fwlink/?linkid=2162396
0 commit comments