Skip to content

Commit 3b9e166

Browse files
authored
Merge pull request #266459 from sloanster/patch-46
Patch 46
2 parents 36c75f1 + 09a954d commit 3b9e166

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

articles/communication-services/concepts/voice-video-calling/video-constraints.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,26 @@ ms.author: micahvivion
77
manager: nmurav
88

99
services: azure-communication-services
10-
ms.date: 2/20/2023
10+
ms.date: 2/15/2024
1111
ms.topic: conceptual
1212
ms.service: azure-communication-services
1313
ms.subservice: calling
1414
---
1515

1616
# Video constraints
1717

18-
[!INCLUDE [Public Preview Disclaimer](../../includes/public-preview-include.md)]
18+
The Video constraints API is a powerful tool that enables developers to control the video quality from within their video calls. With this API, developers can set maximum video resolutions, frame rate, and bitrate used so that the call is optimized for the user's device and network conditions. The ACS video engine is optimized to allow the video quality to change dynamically based on devices ability and network quality. But there might be certain scenarios where you would want to have tighter control of the video quality that end users experience. For instance, there may be situations where the highest video quality isn't a priority, or you may want to limit the video bandwidth usage in the application. To support those use cases, you can use the Video Constraints API to have tighter control over video quality.
1919

20-
The Video Constraints API is a powerful tool that enables developers to control the video quality from within their video calls. With this API, developers can set maximum video resolutions, frame rate, and bitrate used so that the call is optimized for the user's device and network conditions. The Azure Communication Services video engine is optimized to allow the video quality to change dynamically based on devices ability and network quality. But there might be certain scenarios where you would want to have tighter control of the video quality that end users experience. For instance, there may be situations where the highest video quality is not a priority, or you may want to limit the video bandwidth usage in the application. To support those use cases, you can use the Video Constraints API to have tighter control over video quality.
21-
22-
Another benefit of the Video Constraints API is that it enables developers to optimize the video call for different devices. For example, if a user is using an older device with limited processing power, developers can set constraints on the video resolution to ensure that the video call runs smoothly on that device
23-
24-
Azure Communication Services Web Calling SDK supports setting the maximum video resolution, framerate, or bitrate that a client sends. The sender video constraints are supported on Desktop browsers (Chrome, Edge, Firefox) and when using iOS Safari mobile browser or Android Chrome mobile browser.
25-
26-
The native Calling SDK (Android, iOS, Windows) supports setting the maximum values of video resolution and framerate for outgoing video streams and setting the maximum resolution for incoming video streams. These constraints can be set at the start of the call and during the call.
20+
Another benefit of the Video Constraints API is that it enables developers to optimize the video call for different devices. For example, if a user is using an older device with limited processing power, developers can set constraints on the video resolution to ensure that the video call runs smoothly on that device.
2721

2822
## Supported constraints
2923

3024
| Platform | Supported Constraints |
3125
| ----------- | ----------- |
32-
| Web | Outgoing video: resolution, framerate, bitrate |
33-
| Android | Incoming video: resolution<br />Outgoing video: resolution, framerate |
34-
| iOS | Incoming video: resolution<br />Outgoing video: resolution, framerate |
35-
| Windows | Incoming video: resolution<br />Outgoing video: resolution, framerate |
26+
| **Web** | **Incoming video**: resolution<br />**Outgoing video**: resolution, framerate, bitrate |
27+
| **Android** | **Incoming video**: resolution<br />**Outgoing video**: resolution, framerate |
28+
| **iOS** | **Incoming video**: resolution<br />**Outgoing video**: resolution, framerate |
29+
| **Windows** | **Incoming video**: resolution<br />**Outgoing** video: resolution, framerate |
3630

3731
## Next steps
3832
For more information, see the following articles:

articles/communication-services/quickstarts/voice-video-calling/includes/video-constraints/video-constraints-javascript.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
ms.author: enricohuang
33
title: Quickstart - Set video constraints in your web calling app
44
titleSuffix: An Azure Communication Services document
5-
description: In this quickstart, you'll learn how to set video constraints in your existing web calling app using Azure Communication Services.
5+
description: In this quickstart, you learn how to set video constraints in your existing web calling app using Azure Communication Services.
66
author: sloanster
77
services: azure-communication-services
8-
ms.date: 07/13/2023
8+
ms.date: 02/15/2024
99
ms.topic: include
1010
ms.service: azure-communication-services
1111
ms.subservice: calling
1212
---
1313

14-
You can set video constraints in your calls to control the video quality based on resolution or frameRate or bitrate in your video calls. In this quickstart guide, we'll illustrate how to set video constraints at the start of a call and how to use our `setConstraints` method on the call object to set video constraints dynamically during the call.
14+
You can set video constraints in your calls to control the video quality based on resolution or frameRate or bitrate in your video calls. In this quickstart guide, we illustrate how to set video constraints at the start of a call and how to use our `setConstraints` method on the call object to set video constraints dynamically during the call.
1515

16-
> [!NOTE]
17-
> Currently, we only support setting video send constraints. You cannot set video constraints on incoming videos at this point of time.
16+
## Send video constraints
17+
Azure Communication Services Web Calling SDK supports setting the maximum video resolution, framerate, or bitrate that a client sends. The sender video constraints are supported on Desktop browsers (Chrome, Edge, Firefox) and when using iOS Safari mobile browser or Android Chrome mobile browser.
1818

19-
## Setting video constraints at the start of a call
20-
The video constraints setting is implemented on the `Call` interface. To use the Video Constraints, you can specify the constraints from within `CallOptions` when you make a call, accept a call, or join a call. You will also have to specify `localVideoStreams` in `videoOptions`. <br/>
21-
Do note that constraints don't work if you join a call with audio only option and turn on the camera later. In this case, you can set video constraints dynamically using the `setConstraints` method on the `Call` interface (guide below).
19+
### Setting video constraints at the start of a call - outgoing (send) video
20+
The video constraints setting is implemented on the `Call` interface. To use the Video Constraints, you can specify the constraints from within `CallOptions` when you make a call, accept a call, or join a call. You must specify `localVideoStreams` in `videoOptions`. <br/>
21+
Do note that constraints don't work if you join a call with audio only option and turn on the camera later. In this case, you can set video constraints dynamically using the `setConstraints` method on the `Call` interface.
2222

2323
```javascript
2424
const callOptions = {
@@ -84,7 +84,7 @@ export declare type MediaConstraintRange = {
8484
};
8585
```
8686

87-
When setting video constraints, the SDK will choose the nearest value that falls within the constraint set (to prevent the values for resolution, frameRate and bitrate to not exceed the maximum constraint values set). Also, when the resolution constraint value is too small, the SDK will choose the smallest available resolution. In this case, the height of chosen resolution can be larger than the constraint value.
87+
When setting video constraints, the SDK chooses the nearest value that falls within the constraint set to prevent the values for resolution, frameRate, and bitrate to not exceed the maximum constraint values set. Also, when the resolution constraint value is too small, the SDK chooses the smallest available resolution. In this case, the height of chosen resolution can be larger than the constraint value.
8888

8989
> [!NOTE]
9090
> For all `bitrate`, `frameHeight` and `frameRate`, the constraint value is a `max` constraint, which means the actual value in the call can be the specified value or smaller.
@@ -94,7 +94,7 @@ The `frameHeight` in `VideoSendConstraints` has a different meaning when a mobil
9494

9595
If you use MediaStats API to track the sent video resolution, you may find out that the sent resolution can change during the call. It can go up and down, but should be equal or smaller than the constraint value you provide. This resolution change is an expected behavior. The browser also has some degradation rule to adjust sent resolution based on cpu or network conditions.
9696

97-
## Setting video constraints during the call
97+
### Setting video constraints during the call - outgoing (send) video
9898
You can set video constraints during the call by using the `setConstraints` method on the `Call` object.
9999
```javascript
100100
// For eg, when you've started a call,
@@ -141,7 +141,12 @@ await currentCall.setConstraints({
141141
142142
<br/>
143143

144-
### Media stats
144+
## Receive video constraints
145+
To control resolution on the receiver side using Azure Communication Services Web Calling SDK, you can adjust size of the renderer of that video. The calling SDK automatically adjusts received resolution based on the dimensions of the renderer. The SDK won't request an incoming video stream (width and height) that can fit into the renderer video window.
146+
147+
148+
149+
## Using Media statics to understand video constraints impact
145150
To evaluate and compare the video quality after applying the video constraints, you can access [MediaStats API](../../../../concepts/voice-video-calling/media-quality-sdk.md) to get video resolution and bitrate information of the sending stream. The media stats also include other granular stats related to the streams, such as jitter, packet loss, round trip time, etc.
146151

147152
```javascript

0 commit comments

Comments
 (0)