Skip to content

Commit f4b3834

Browse files
Merge pull request #297806 from dominicbetts/release-2504-aio-media
AIO 2504: Media and ONVIF connector updates
2 parents f3d7ad8 + c9ac924 commit f4b3834

File tree

2 files changed

+70
-8
lines changed

2 files changed

+70
-8
lines changed

articles/iot-operations/discover-manage-assets/howto-use-media-connector.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ A camera connected to your network and accessible from your Azure IoT Operations
3838

3939
## Deploy the media server
4040

41-
If you're using the media connector to stream live video, you need to install your own media server. To deploy a sample media server to use with the media connector, run the following command:
41+
If you're using the media connector to stream live video, you need to install your own media server. To deploy a sample media server to use with the media connector, run the following commands:
4242

4343
```console
44-
kubectl create namespace media-server --dry-run=client -o yaml | kubectl apply -f - & kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/refs/heads/main/samples/media-connector-invoke-test/media-server/media-server-deployment.yaml --validate=false & kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/refs/heads/main/samples/media-connector-invoke-test/media-server/media-server-service.yaml --validate=false & kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/refs/heads/main/samples/media-connector-invoke-test/media-server/media-server-service-public.yaml --validate=false
44+
kubectl create namespace media-server
45+
kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/refs/heads/main/samples/media-server/media-server-deployment.yaml
46+
kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/refs/heads/main/samples/media-server/media-server-service.yaml
47+
kubectl apply -f https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/refs/heads/main/samples/media-server/media-server-service-public.yaml
4548
```
4649

4750
> [!IMPORTANT]
@@ -273,7 +276,7 @@ To verify that snapshots are publishing to the MQTT broker, use the **mosquitto_
273276
When you finish testing the asset, you can delete it by running the following command:
274277

275278
```console
276-
az iot ops asset delete -n asset-clip-to-mqtt -g $RESOURCE_GROUP
279+
az iot ops asset delete -n asset-snapshot-to-mqtt -g $RESOURCE_GROUP
277280
```
278281

279282
## Snapshot to file system
@@ -341,7 +344,7 @@ kubectl get pods -n azure-iot-operations
341344
To view the files, run the `ls` command in the pod. Use the full name of the pod in the following command:
342345

343346
```console
344-
kubectl exec aio-opc-media-1-... -n azure-iot-operations -- ls /tmp/azure-iot-operations/data/asset-snapshot-to-fs/snapshot/
347+
kubectl exec aio-opc-media-1-... -n azure-iot-operations -- ls /tmp/azure-iot-operations/data/asset-snapshot-to-fs/snapshots/
345348
```
346349

347350
When you finish testing the asset, you can delete it by running the following command:
@@ -415,7 +418,7 @@ kubectl get pods -n azure-iot-operations
415418
To view the files, run the `ls` command in the pod. Use the full name of the pod in the following command:
416419

417420
```console
418-
kubectl exec aio-opc-media-1-... -n azure-iot-operations -- ls /tmp/azure-iot-operations/data/asset-clip-to-fs/clip/
421+
kubectl exec aio-opc-media-1-... -n azure-iot-operations -- ls /tmp/azure-iot-operations/data/asset-clip-to-fs/clips/
419422
```
420423

421424
When you finish testing the asset, you can delete it by running the following command:

articles/iot-operations/discover-manage-assets/howto-use-onvif-connector.md

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Currently, during public preview, you must manually create the **Asset** and **A
147147

148148
### Access the PTZ capabilities of the camera
149149

150-
To manually create an asset that represents the PTZ capabilities of the camera discovered previously:
150+
Use the PTZ capabilities of an ONVIF compliant camera to control its position and orientation.To manually create an asset that represents the PTZ capabilities of the camera discovered previously:
151151

152152
# [Bash](#tab/bash)
153153

@@ -201,13 +201,72 @@ The following snippet shows the bicep file that you used to create the asset. Th
201201

202202
:::code language="bicep" source="~/azure-iot-operations-samples/samples/onvif-connector-bicep/asset-ptz.bicep":::
203203

204+
### Access the media capabilities of the camera
205+
206+
To use the PTZ capabilities of an ONVIF-complian camera, you need a profile token from the camera's media service. To manually create an asset that represents the media capabilities of the camera discovered previously:
207+
208+
# [Bash](#tab/bash)
209+
210+
1. Set the following environment variables:
211+
212+
```bash
213+
SUBSCRIPTION_ID="<YOUR SUBSCRIPTION ID>"
214+
RESOURCE_GROUP="<YOUR AZURE IOT OPERATIONS RESOURCE GROUP>"
215+
AEP_NAME="contoso-onvif-aep"
216+
```
217+
218+
1. Run the following script:
219+
220+
```bash
221+
# Download the Bicep file
222+
wget https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/main/samples/onvif-connector-bicep/asset-onvif-media.bicep -O asset-onvif-media.bicep
223+
224+
# Find the name of your custom location
225+
CUSTOM_LOCATION_NAME=$(az iot ops list -g $RESOURCE_GROUP --query "[0].extendedLocation.name" -o tsv)
226+
227+
# Use the Bicep file to deploy the asset
228+
az deployment group create --subscription $SUBSCRIPTION_ID --resource-group $RESOURCE_GROUP --template-file asset-onvif-media.bicep --parameters customLocationName=$CUSTOM_LOCATION_NAME aepName=$AEP_NAME
229+
```
230+
231+
# [PowerShell](#tab/powershell)
232+
233+
1. Set the following environment variables:
234+
235+
```powershell
236+
$SUBSCRIPTION_ID="<YOUR SUBSCRIPTION ID>"
237+
$RESOURCE_GROUP="<YOUR AZURE IOT OPERATIONS RESOURCE GROUP>"
238+
$AEP_NAME="contoso-onvif-aep"
239+
```
240+
241+
1. Run the following script:
242+
243+
```powershell
244+
# Download the Bicep file
245+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/Azure-Samples/explore-iot-operations/main/samples/onvif-connector-bicep/asset-onvif-media.bicep -OutFile asset-onvif-media.bicep
246+
247+
# Find the name of your custom location
248+
$CUSTOM_LOCATION_NAME = (az iot ops list -g $RESOURCE_GROUP --query "[0].extendedLocation.name" -o tsv)
249+
250+
# Use the Bicep file to deploy the asset
251+
az deployment group create --subscription $SUBSCRIPTION_ID --resource-group $RESOURCE_GROUP --template-file asset-onvif-media.bicep --parameters customLocationName=$CUSTOM_LOCATION_NAME aepName=$AEP_NAME
252+
```
253+
254+
---
255+
256+
The following snippet shows the bicep file that you used to create the asset. The `-media` suffix to the asset name is a required convention to indicate that the asset represents the media capabilities of the camera:
257+
258+
:::code language="bicep" source="~/azure-iot-operations-samples/samples/onvif-connector-bicep/asset-onvif-media.bicep":::
259+
204260
## Manage and control the camera
205261

206262
To interact with the ONVIF camera, you can publish MQTT messages that the connector for ONVIF subscribes to. The message format is based on the [ONVIF network interface specifications](https://www.onvif.org/profiles/specifications/).
207263

208-
The [Azure IoT Operations connector for ONVIF PTZ Demo](https://github.com/Azure-Samples/explore-iot-operations/tree/main/samples/aio-onvif-connector-ptz-demo) sample application shows how to use the connector for ONVIF to interact with the PTZ capabilities of an ONVIF camera.
264+
The [Azure IoT Operations connector for ONVIF PTZ Demo](https://github.com/Azure-Samples/explore-iot-operations/tree/main/samples/aio-onvif-connector-ptz-demo) sample application shows how to use the connector for ONVIF to:
265+
266+
- Use the media asset definition to retrieve a profile token from the camera's media service.
267+
- Use the profile token when you use the camera's PTZ capabilities control its position and orientation.
209268

210-
The sample application uses the Azure IoT Operations MQTT broker to send commands to the connector for ONVIF. To learn more, see [Publish and subscribe MQTT messages using MQTT broker](../manage-mqtt-broker/overview-broker.md).
269+
The sample application uses the Azure IoT Operations MQTT broker to send commands to interact with the connector for ONVIF. To learn more, see [Publish and subscribe MQTT messages using MQTT broker](../manage-mqtt-broker/overview-broker.md).
211270

212271
### Access the camera's video streams
213272

0 commit comments

Comments
 (0)