You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
19
19
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.
27
21
28
22
## Supported constraints
29
23
30
24
| Platform | Supported Constraints |
31
25
| ----------- | ----------- |
32
-
| Web | Outgoing video: resolution, framerate, bitrate |
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/voice-video-calling/includes/video-constraints/video-constraints-javascript.md
+16-11Lines changed: 16 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,23 @@
2
2
ms.author: enricohuang
3
3
title: Quickstart - Set video constraints in your web calling app
4
4
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.
6
6
author: sloanster
7
7
services: azure-communication-services
8
-
ms.date: 07/13/2023
8
+
ms.date: 02/15/2024
9
9
ms.topic: include
10
10
ms.service: azure-communication-services
11
11
ms.subservice: calling
12
12
---
13
13
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.
15
15
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.
18
18
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.
22
22
23
23
```javascript
24
24
constcallOptions= {
@@ -84,7 +84,7 @@ export declare type MediaConstraintRange = {
84
84
};
85
85
```
86
86
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.
88
88
89
89
> [!NOTE]
90
90
> 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
94
94
95
95
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.
96
96
97
-
## Setting video constraints during the call
97
+
###Setting video constraints during the call - outgoing (send) video
98
98
You can set video constraints during the call by using the `setConstraints` method on the `Call` object.
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
145
150
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.
0 commit comments