Skip to content

Commit 27ee0a7

Browse files
authored
Merge pull request #297850 from sloanster/patch-35
Update video-effects-javascript.md
2 parents fc2d2c8 + 4778d28 commit 27ee0a7

File tree

2 files changed

+87
-17
lines changed

2 files changed

+87
-17
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@ description: Learn how to add video effects in your video calls using Azure Comm
55
author: sloanster
66

77
ms.author: micahvivion
8-
ms.date: 02/14/2025
8+
ms.date: 04/08/2025
99
ms.topic: quickstart
1010
ms.service: azure-communication-services
1111
ms.subservice: calling
1212
ms.custom: mode-other
1313
---
1414

15-
The Video effects feature allows users to incorporate visual effects into their video calls, providing developers with the ability to integrate background visual effects and background video replacement into their calling experience. Background blur offers users a way to eliminate distractions behind them, facilitating communication without disruptive activities or confidential information appearing in the background. This is helpful in telehealth contexts, where providers or patients may wish to obscure their surroundings to protect sensitive or personally identifiable information. Background blur can be applied across various virtual appointment scenarios, such as telebanking and virtual hearings, to enhance user privacy or to hide a messy office. In addition to improving confidentiality, background blur enables greater creative expression by allowing users to upload custom backgrounds for a more engaging and personalized calling experience.lows for more creativity of expression, allowing users to upload custom backgrounds to host a more fun, personalized calling experience.
15+
The Video effects feature lets users add visual effects to video calls, including background blur and video replacement. This helps eliminate distractions and protect sensitive information, especially in contexts like telehealth, telebanking, and virtual hearings. Background blur enhances privacy and allows for custom backgrounds, making calls more engaging and personalized.
1616

1717
> [!NOTE]
18-
> The calling effect library can't be used standalone and can only work when used with the Azure Communication Calling client library for WebJS (https://www.npmjs.com/package/@azure/communication-calling).
18+
> The [calling effect library](https://www.npmjs.com/package/@azure/communication-calling-effects)is designed to work exclusively with the [Azure Communication Calling client library for WebJS](https://www.npmjs.com/package/@azure/communication-calling) and cannot be used independently.
1919
2020
## Using video effects
2121
### Install the package
2222
> [!IMPORTANT]
2323
> Background blur and background replacement for **Web Desktop browsers** is in GA availability. This quickstart uses the Azure Communication Services Calling SDK version of `1.13.1` (or greater) and the Azure Communication Services Calling Effects SDK version greater than or equal to `1.0.1`. Currently desktop browser support for creating video background effects is only supported on Chrome and Edge Desktop Browser (Windows and Mac) and Mac Safari Desktop.
2424
2525

26-
> [!NOTE]
27-
> Background blur and background replacement for **Android Chrome and Android Edge mobile browser** is available in public preview starting in build [1.29.1](https://github.com/Azure/Communication/blob/master/releasenotes/acs-javascript-calling-library-release-notes.md#1291-beta1-2024-08-26) and later beta WebJS SDK versions.
26+
> [!IMPORTANT]
27+
> Background blur and background replacement for **Android Chrome and Android Edge mobile browser** is available in General Availability starting in build [1.34.1](https://www.npmjs.com/package/@azure/communication-calling/v/1.34.1) and later WebJS SDK versions. You must use version [1.1.4](https://www.npmjs.com/package/@azure/communication-calling-effects) or higher of the calling effects package to implement background effects on Android mobile browsers.
2828
2929
Use the `npm install` command to install the Azure Communication Services Effects SDK for JavaScript.
3030

3131
```console
3232
npm install @azure/communication-calling-effects --save
3333
```
34-
For more information, see [here](https://www.npmjs.com/package/@azure/communication-calling-effects) for more details on the calling communication effects npm package page.
34+
See [here](https://www.npmjs.com/package/@azure/communication-calling-effects) for more details on the calling communication effects npm package page.
3535

3636
> [!NOTE]
3737
> Currently there are two available video effects:
@@ -143,5 +143,4 @@ For best results when preparing the frosted PNG image, keep in mind:
143143

144144
* **Resolution**: Use 1920x1080 pixels for a high-quality background
145145
* **Avoid full opacity**: Colored content such as logos looks best with a little transparency. We recommend 75% opacity
146-
* **Defocus the image**: A Gaussian blur of radius 2 works well to simulate a bit of depth of field in the scene.
147-
* **Stencil mid-gray foreground**: For grayscale PNG with transparency, we recommend having the full image in mid-gray (value 128) so that the transparency pattern is visible on both light and dark backgrounds.
146+
* **Stencil mid-gray foreground**: For grayscale PNG with transparency, we recommend having the full image in mid-gray (value 128) so that the transparency pattern is visible on both light and dark backgrounds.

articles/communication-services/quickstarts/voice-video-calling/optimizing-video-placement.md

Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ titleSuffix: An Azure Communication Services quickstart
55
description: This document describes how to place video on a web page based on resolution size to optimize video placement and enhance overall page performance.
66
author: sloanster
77
services: azure-communication-services
8-
ms.date: 03/07/2025
8+
ms.date: 04/08/2025
99
ms.topic: quickstart
1010
ms.service: azure-communication-services
1111
ms.subservice: calling
@@ -55,7 +55,7 @@ When placing multiple videos on a web page, consider the user's network bandwidt
5555

5656
### Use the Web UI Library
5757

58-
The Azure Communication Services [Web UI Library](../../concepts/ui-library/ui-library-overview.md) is a powerful tool for developers looking to create seamless and visually appealing web applications. The Web UI Library offers a comprehensive set of pre-built UI components that are easy to integrate and highly customizable. This solution enables developers to focus on building functionality rather than designing from scratch.
58+
The Azure Communication Services [Web UI Library](../../concepts/ui-library/ui-library-overview.md) is a powerful tool for developers looking to create seamless and visually appealing web applications. The Web UI Library offers a comprehensive set of prebuilt UI components that are easy to integrate and highly customizable. This solution enables developers to focus on building functionality rather than designing from scratch.
5959

6060
The Web UI Library ensures consistent design standards across different projects and platforms, enhancing user experience and reducing development time. Its extensive documentation and active community support make it an excellent choice for both beginners and experienced developers. By applying the Web UI Library, you can streamline your workflow, create professional-quality interfaces, and deliver engaging web applications more efficiently. Also, using the Web UI Library removes the guesswork of determining how many videos you can optimally subscribe to at one time.
6161

@@ -76,28 +76,99 @@ When there's a change in the optimal video count value, if the result indicates
7676

7777
Conversely, if the optimal count decreases and is [less than the current number of videos on the page](../../resources/troubleshooting/voice-video-calling/video-issues/reaching-max-number-of-active-video-subscriptions.md), consider disposing of a video using the dispose method and updating the application layout accordingly.
7878

79-
### Things to consider when adding a 1080P or 720P video to a page.
79+
### Things to consider when adding a 1080p or 720p video to a page.
8080

81-
- You can place one 1080p incoming video with the rest smaller than 720P.
81+
- You can place one 1080p incoming video with the rest smaller than 720p.
8282
- You can place two 720p incoming videos with the rest smaller than 720p.
8383

8484
[!INCLUDE [Public Preview Disclaimer](../../includes/public-preview-include.md)]
8585

86-
In [version 1.33](https://github.com/Azure/Communication/blob/master/releasenotes/acs-javascript-calling-library-release-notes.md#1332-beta1-2025-01-30) and later of the public preview calling SDK support putting 2 720P videos simultaneously on a web page.
86+
In [version 1.33](https://github.com/Azure/Communication/blob/master/releasenotes/acs-javascript-calling-library-release-notes.md#1332-beta1-2025-01-30) and later of the public preview calling SDK supports placing 2 720p videos simultaneously on a web page.
8787

8888
For instance, in a group call where seven participants have their video cameras on, on each client page you can select two participants' videos are displayed at higher resolutions. These two participants set to show their video at 720p by setting their views on the web page to be 720 pixels in height by 1280 pixels in width (or greater). The remaining five participant videos should be set to a lower resolution, such as 360p or lower.
8989

90-
- To ensure that the total number of rendered videos remains below the OVC value threshold, review and adhere to the [Optimal Video Count (OVC)](../../how-tos/calling-sdk/manage-video.md?pivots=platform-web).
91-
- Each client can specify which user's video they want to receive and set individual resolution sizes on their respective machines.
90+
- Please ensure that the total number of rendered videos does not exceed the OVC [Optimal Video Count (OVC)](../../how-tos/calling-sdk/manage-video.md?pivots=platform-web) value.
91+
- Each client can choose the video feed from specific users and adjust the resolution size on their individual devices.
9292
- Each participant's ability to send a specific video resolution can vary. Some computers are equipped with higher quality cameras, enabling them to transmit a 1080p video. Conversely, some mobile browsers have lower video transmission capabilities, such as only 540p. If you embedded the video resolution to be 1080p or 720p in a page, the incoming video might not match that resolution. In this case, the system upscales the video stream to fill the video renderer size.
9393
- Currently, a maximum of two 720p video streams can be rendered on a web page. If more than two 720p streams are enabled, all 720p video renditions are streamed at 540p.
9494
- The maximum number of incoming remote streams that can be subscribed to is 16 video streams plus 1 screen sharing on desktop browsers, and 4 video streams plus 1 screen sharing on web mobile browsers.
9595
- Azure Communication Services video [Simulcast](../../concepts/voice-video-calling/simulcast.md) ability enhances video streaming by enabling a single video delivered by an end client at multiple resolutions and bitrates simultaneously.
9696

9797
This function enables viewers with varying network conditions to select which video rendition to select to receive for the best possible video quality without buffering or interruptions. By optimizing bandwidth usage, simulcast sends higher resolution streams only to users who can support them. This behavior minimizes unnecessary data transmission. Simulcast improves the overall user experience by providing stable and consistent video quality and enables adaptive streaming.
9898

99-
Simulcast isn't supported on all browser devices. Currently, simulcast is unavailable when sending videos on mobile browsers or macOS Safari. If a participant attempts to render 720p video from a user on iOS Safari, Android Chrome, or macOS Safari and another participant on the call tries to render the same video at a smaller resolution, both receive the smaller resolution. This change happens because the devices prioritize smaller resolutions when simulcast send isn't supported.
99+
Simulcast isn't supported on all browsers, specifically mobile browsers and macOS Safari. If a participant using iOS Safari, Android Chrome, or macOS Safari renders a 720p video and another participant tries to render the same video at a lower resolution, both will receive the lower resolution. This happens because these devices prioritize smaller resolutions when simulcast sending is unsupported.
100+
101+
## How to configure to send a 1080p stream
102+
[!INCLUDE [Public Preview Disclaimer](../../includes/public-preview-include.md)]
103+
104+
[Version 1.35.1](https://www.npmjs.com/package/@azure/communication-calling/v/1.35.1-beta.1) and higher of the public preview calling SDK supports sending a 1080p video.
105+
106+
When using the WebJS SDK to send video at a 1080p resolution, you must use the [Video Constraints API](../voice-video-calling/get-started-video-constraints.md?pivots=platform-web) and specify that you want to use 1080p. If the Video Constraints API isn't used and 1080p isn't specified, the default video stream resolution is 720p.
107+
108+
```javascript
109+
const callOptions = {
110+
videoOptions: {
111+
localVideoStreams: [...],
112+
constraints: {
113+
send: {
114+
height: {
115+
max: 1080
116+
}
117+
}
118+
}
119+
},
120+
audioOptions: {
121+
muted: false
122+
}
123+
};
124+
// make a call
125+
this.callAgent.startCall(identitiesToCall, callOptions);
126+
```
127+
128+
### Items to note when sending a 1080p video stream
129+
* The camera in use should be capable of sending a 1080p video. To check what resolutions your camera supports, you can use the following JavaScript example to determine the available resolutions.
130+
131+
```javascript
132+
async function getSupportedResolutions() {
133+
const constraints = {
134+
video: {
135+
width: { ideal: 4096 }, // Try to get the maximum width
136+
height: { ideal: 2160 } // Try to get the maximum height
137+
}
138+
};
139+
140+
try {
141+
const stream = await navigator.mediaDevices.getUserMedia(constraints);
142+
const videoTrack = stream.getVideoTracks()[0];
143+
const settings = videoTrack.getSettings();
144+
145+
console.log(`Supported resolution: ${settings.width}x${settings.height}`);
146+
147+
// Stop the video track to release the camera
148+
videoTrack.stop();
149+
} catch (error) {
150+
console.error('Error accessing media devices.', error);
151+
}
152+
}
153+
154+
getSupportedResolutions();
155+
```
156+
157+
* The machine sending a 1080p must have a powerful enough machine to support sending a 1080p.
158+
* The client that is on the receiver side (people accepting of a 1080p video) must have a video render HTML5 element capable of 1080p to accept 1080p. If any participants on the call don't have a 1080p element enabled to receive the video, the call will adjust and negotiate down to a smaller resolution.
159+
* All the people on the call that are sending and receiving a 1080p video stream must have the bandwidth to support a 1080p stream.
160+
161+
| **Resolution** | **Min framerate** | **Max framerate** | **Max bitrate** |
162+
|--|--|--|--|
163+
| 1080p | 30 | 30 | 4 M |
164+
| 720p | 30 | 30 | 2.5 M |
165+
| 540p | 30 | 30 | 2 M |
166+
| 360p | 30 | 30 | 1 M |
167+
| 240p | 15 | 15 | 650 K |
168+
| 180p | 7.5 | 15 | 250 K(350 K if 15 FPS)|
169+
170+
You can use the media quality statistics API within the WebJS SDK to determine the real time video send and receive resolution. See [here](../../concepts/voice-video-calling/media-quality-sdk.md?pivots=platform-web) for more details.
100171

101172
## Conclusion
102173

103-
To determine how many videos to place on a web page, you need to carefully consider resolution, device type, bandwidth, and user experience. Follow these guidelines and best practices to create web apps that not only look appealing but also function seamlessly, providing an optimal viewing experience for users across various devices and connection speeds.
174+
To determine how many videos to place on a web page, you need to carefully consider resolution, device type, bandwidth, and user experience. Follow these guidelines and best practices to create web apps that not only look appealing but also function seamlessly, providing an optimal viewing experience for users across various devices and connection speeds.

0 commit comments

Comments
 (0)