Skip to content

Commit 1f5a32c

Browse files
committed
fix errors, add augmented reality
1 parent d6a17f2 commit 1f5a32c

File tree

4 files changed

+39
-33
lines changed

4 files changed

+39
-33
lines changed

articles/communication-services/quickstarts/voice-video-calling/includes/raw-media/raw-media-access-android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,6 @@ This feature gives you access the video frames inside the `IncomingVideoStream`
520520
}
521521
```
522522
523-
## Next steps
523+
## Sample code
524524
525525
- Use the sample app on GitHub at [Raw Video](https://github.com/Azure-Samples/communication-services-android-quickstarts/tree/main/RawVideo).

articles/communication-services/quickstarts/voice-video-calling/includes/raw-media/raw-media-access-ios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,6 @@ This feature gives you access the video frames inside `IncomingVideoStream` to m
682682
}
683683
```
684684

685-
## Next steps
685+
## Sample code
686686

687687
- Use the sample app on GitHub at [Raw Video](https://github.com/Azure-Samples/communication-services-ios-quickstarts/tree/main/raw-video).

articles/communication-services/quickstarts/voice-video-calling/includes/raw-media/raw-media-access-windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,6 @@ This feature gives you access the video frames inside the `IncomingVideoStream`
610610
}
611611
```
612612

613-
## Next steps
613+
## Sample code
614614

615615
- Use the sample app on GitHub at [Raw Video](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/RawVideo).
Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
---
2-
title: Tutorial - Add Augmented Reality filter to your app
3-
titleSuffix: An Azure Communication Services tutorial
4-
description: In this tutorial, you learn how to add Augmented Reality filter to your app using Azure Communication Services and other effects SDKs.
2+
title: Add augmented reality filters to video calls
3+
titleSuffix: An Azure Communication Services article
4+
description: This article describes how to add an augmented reality filter to your app using Azure Communication Services and other effects SDKs.
55
author: sloanster
66
services: azure-communication-services
77

88
ms.author: micahvivion
9-
ms.date: 01/15/2024
9+
ms.date: 06/24/2025
1010
ms.topic: tutorial
1111
ms.service: azure-communication-services
1212
ms.subservice: calling
1313
ms.custom: mode-other
1414
---
1515

16-
# Tutorial: How to add Augmented Reality filters to your video calls
16+
# Add augmented reality filters to video calls
1717

1818
> [!NOTE]
19-
> DeepAR SDK is third-party software which is licensed under its own terms. Microsoft does not make any representations or warranties concerning the use of third-party software.
19+
> DeepAR SDK is third-party software, which is licensed under its own terms. Microsoft doesn't make any representations or warranties concerning the use of third-party software.
2020
21-
In some usage scenarios, you may want to apply some video processing to the original camera video, such as background blur or background replacement.
22-
This can provide a better user experience.
23-
The Azure Communication Calling video effects package provides several video processing functions. However, this isn't the only choice.
24-
You can also integrate other video effects library with ACS raw media access API.
21+
In some usage scenarios, you might want to apply some video processing to the original camera video, such as background blur or background replacement. This change can provide a better user experience.
2522

26-
We'll use DeepAR SDK(https://www.deepar.ai/) as an example to show how to integrate other effects libraries with ACS Calling SDK.
23+
The Azure Communication Calling video effects package provides several video processing functions. However, this isn't the only choice. You can also integrate other video effects library with Azure Communication Services raw media access API.
24+
25+
We use DeepAR SDK(https://www.deepar.ai/) as an example to show how to integrate other effects libraries with Azure Communication Services Calling SDK.
2726
Let's try DeepAR to enrich your video with Augmented Reality!
2827

2928
## Prerequisites
@@ -33,20 +32,20 @@ Let's try DeepAR to enrich your video with Augmented Reality!
3332
- An Azure Communication Services voice and video calling enabled client. [Add video calling to your app](../quickstarts/voice-video-calling/get-started-with-video-calling.md?pivots=platform-web).
3433
- DeepAR license key. [Getting started | DeepAR](https://docs.deepar.ai/deepar-sdk/platforms/web/getting-started).
3534

36-
## How video input and output work between ACS Web SDK and DeepAR
37-
Both ACS Web SDK and DeepAR can read the camera device list and get the video stream directly from the device.
38-
We want to provide consistency in the app, and DeepAR SDK provides a way for us to directly input a video stream acquired from ACS Web SDK.
39-
Similarly, ACS Web SDK needs the processed video stream output from DeepAR SDK and sends this video stream to the remote endpoint.
40-
DeepAR offers the option to use a canvas as an output. ACS Web SDK can consume the raw video stream captured from the canvas.
35+
## How video input and output work between Azure Communication Services Web SDK and DeepAR
4136

42-
Here's the data flow:
37+
Both Azure Communication Services Web SDK and DeepAR can read the camera device list and get the video stream directly from the device. We want to provide consistency in the app, and DeepAR SDK provides a way for us to directly input a video stream acquired from Azure Communication Services Web SDK.
4338

44-
:::image type="content" source="./media/ar/videoflow.png" alt-text="The diagram of data flow between ACS SDK and DeepAR SDK.":::
39+
Similarly, Azure Communication Services Web SDK needs the processed video stream output from DeepAR SDK and sends the video stream to the remote endpoint. DeepAR offers the option to use a canvas as an output. Azure Communication Services Web SDK can consume the raw video stream captured from the canvas.
40+
41+
Here's the data flow:
4542

43+
:::image type="content" source="./media/ar/videoflow.png" alt-text="The diagram of data flow between Azure Communication Services SDK and DeepAR SDK.":::
4644

4745
## Initialize DeepAR SDK
4846

49-
To enable DeepAR filters, you need to initialize DeepAR SDK, this can be done by invoking `deepar.initialize` API.
47+
To enable DeepAR filters, you need to initialize DeepAR SDK. Use the following code to invoke `deepar.initialize` API.
48+
5049
```javascript
5150
const canvas = document.createElement('canvas');
5251
const deepAR = await deepar.initialize({
@@ -59,21 +58,26 @@ const deepAR = await deepar.initialize({
5958
}
6059
});
6160
```
62-
Here we disable the default camera because we want ACS Web SDK to provide the source video stream.
63-
The canvas is required as this provides a way for ACS Web SDK to consume the video output from DeepAR SDK.
61+
62+
Here we disable the default camera because we want Azure Communication Services Web SDK to provide the source video stream.
63+
64+
The canvas is required for Azure Communication Services Web SDK to consume the video output from DeepAR SDK.
6465

6566
## Connect the input and output
6667

6768
To start a video call, you need to create a `LocalVideoStream` object as the video input in SDK.
69+
6870
```javascript
6971
const deviceManager = await callClient.getDeviceManager();
7072
const cameras = await deviceManager.getCameras();
7173
const camera = cameras[0]
7274
const localVideoStream = new LocalVideoStream(camera);
7375
await call.startVideo(localVideoStream);
7476
```
75-
By doing this, ACS SDK directly sends out the video from camera without processed by DeepAR.
76-
We need to create a path to forward the video acquired from ACS SDK to DeepAR SDK.
77+
78+
When you start the video call, Azure Communication Services SDK directly sends out the video from camera without processed by DeepAR.
79+
80+
We need to create a path to forward the video acquired from Azure Communication Services SDK to DeepAR SDK.
7781

7882
```javascript
7983
const deviceManager = await callClient.getDeviceManager();
@@ -91,7 +95,8 @@ video.autoplay = true;
9195
video.srcObject = inputMediaStream;
9296
deepAR.setVideoElement(video, true);
9397
```
94-
Now we have finished configuring the input video. To configure the output video, we need another `LocalVideoStream`.
98+
99+
Now we finished configuring the input video. To configure the output video, we need another `LocalVideoStream`.
95100

96101
```javascript
97102
const outputMediaStream = canvas.captureStream(30);
@@ -102,27 +107,29 @@ await call.startVideo(outputVideoStream);
102107
## Start the effect
103108

104109
In DeepAR, effects and background processing are independent, which means you can apply the filter while enabling the background blur or background replacement.
110+
105111
```javascript
106112
// apply the effect
107113
await deepAR.switchEffect('https://cdn.jsdelivr.net/npm/deepar/effects/lion');
108114
// enable the background blur
109115
await deepAR.backgroundBlur(true, 8);
110-
111116
```
112-
:::image type="content" source="./media/ar/screenshot.png" alt-text="Screenshot of the video effect.":::
117+
118+
:::image type="content" source="./media/ar/screenshot.png" alt-text="Screen capture of the DeepAR background replacement video effect.":::
113119

114120
## Stop the effect
115121

116122
If you want to stop the effect, you can invoke `deepar.clearEffect` API
117123
```javascript
118124
await deepAR.clearEffect();
119125
```
126+
120127
To disable the background blur, you can pass `false` to `deepar.backgroundBlur` API.
121128

122129
## Disable DeepAR during the video call
123130

124-
In case you want to disable DeepAR during the video call.
125-
You need to call `deepar.stopVideo`.
131+
In case you want to disable DeepAR during the video call, you need to call `deepar.stopVideo`.
132+
126133
Invoking `deepar.stopVideo` also ends the current media stream captured from the canvas.
127134

128135
```javascript
@@ -131,8 +138,7 @@ await deepAR.stopVideo();
131138
```
132139

133140
## Next steps
134-
For more information, see the following articles:
135141

136142
- Learn about [Video effects](../quickstarts/voice-video-calling/get-started-video-effects.md?pivots=platform-web).
137143
- Learn more about [Manage video during calls](../how-tos/calling-sdk/manage-video.md?pivots=platform-web).
138-
- DeepAR documentation. [Getting started | DeepAR](https://docs.deepar.ai/deepar-sdk/platforms/web/getting-started).
144+
- Learn about DeepAR at [Getting started | DeepAR](https://docs.deepar.ai/deepar-sdk/platforms/web/getting-started).

0 commit comments

Comments
 (0)