v4.0.0 was released on September 29, 2022.
Integration change
This release has changed the SDK package name from electron-agora-rtc-ng
to agora-electron-sdk
, and optimized the implementation of some features, resulting in incompatibility with v3.7.0. The following are the main features with compatibility changes:
After upgrading the SDK, you need to update the code in your app according to your business scenarios. For details, see Migrate from v3.x to v4.0.0 RC.
1. Multiple media tracks
This release supports one IRtcEngine
instance to collect multiple audio and video sources at the same time and publish them to the remote users by setting RtcEngineEx
and ChannelMediaOptions.
joinChannel
to join the first channel, call joinChannelEx
multiple times to join multiple channels, and publish the specified stream to different channels through different user ID (localUid
) and ChannelMediaOptions
settings.publishSecondaryCameraTrack
and publishSecondaryScreenTrack
in ChannelMediaOptions
. This release adds createCustomVideoTrack
method to implement video custom capture. You can refer to the following steps to publish multiple custom captured video in the channel:
ChannelMediaOptions
, set the customVideoTrackId
parameter to the ID of the video track you want to publish, and set publishCustomVideoTrack
to true
.pushVideoFrame
, and specify videoTrackId
as the ID of the custom video track in step 2 in order to publish the corresponding custom video source in multiple channels.You can also experience the following features with the multi-channel capability:
uid
).uid
).uid
).2. Ultra HD resolution (Beta)
In order to improve the interactive video experience, the SDK optimizes the whole process of video capture, encoding, decoding and rendering, and now supports 4K resolution. The improved FEC (Forward Error Correction) algorithm enables adaptive switches according to the frame rate and number of video frame packets, which further reduces the video stuttering rate in 4K scenes.
Additionally, you can set the encoding resolution to 4K (3840 × 2160) and the frame rate to 60 fps when calling SetVideoEncoderConfiguration
. The SDK supports automatic fallback to the appropriate resolution and frame rate if your device does not support 4K.
3. Agora media player
To make it easier for users to integrate the Agora SDK and reduce the SDK's package size, this release introduces the Agora media player. After calling the createMediaPlayer
method to create a media player object, you can then call the methods in the IMediaPlayer
class to experience a series of functions, such as playing local and online media files, preloading a media file, changing the CDN route for playing according to your network conditions, or sharing the audio and video streams being played with remote users.
4.Brand-new AI noise reduction
The SDK supports a new version of AI noise reduction (in comparison to the basic AI noise reduction in v3.7.0). The new AI noise reduction has better vocal fidelity, cleaner noise suppression, and adds a dereverberation option.
5. Ultra-high audio quality
To make the audio clearer and restore more details, this release adds the UltraHighQualityVoice
enumeration. In scenarios that mainly feature the human voice, such as chat or singing, you can call setVoiceBeautifierPreset
and use this enumeration to experience ultra-high audio quality.
6. Real-time chorus
This release gives real-time chorus the following abilities:
This release adds the AudioScenarioChorus
enumeration in AudioScenarioType
. With this enumeration, users can experience ultra-low latency in real-time chorus when the network conditions are good.
7. Enhanced channel management
To meet the channel management requirements of various business scenarios, this release adds the following functions to the ChannelMediaOptions
structure:
Set ChannelMediaOptions
when calling joinChannel
or joinChannelEx
to specify the publishing and subscription behavior of a media stream, for example, whether to publish video streams captured by cameras or screen sharing, and whether to subscribe to the audio and video streams of remote users. After joining the channel, call updateChannelMediaOptions
to update the settings in ChannelMediaOptions
at any time, for example, to switch the published audio and video sources.
8. Screen sharing
This release optimizes the screen sharing function. You can enable this function in the following ways.
StartScreenCaptureByDisplayId
method before joining a channel, and then call JoinChannel
[2/2] to join a channel and set publishScreenTrack
or publishSecondaryScreenTrack
as true.StartScreenCaptureByDisplayId
method after joining a channel, and then call UpdateChannelMediaOptions
to set publishScreenTrack
or publishSecondaryScreenTrack
as true.9. Subscription allowlists and blocklists
This release introduces subscription allowlists and blocklists for remote audio and video streams. You can add a user ID that you want to subscribe to in your allowlist, or add a user ID for the streams you do not wish to see to your blocklists. You can experience this feature through the following APIs, and in scenarios that involve multiple channels, you can call the following methods in the IRtcEngineEx
interface:
SetSubscribeAudioBlocklist
:Set the audio subscription blocklist.SetSubscribeAudioAllowlist
:Set the audio subscription allowlist.SetSubscribeVideoBlocklist
:Set the video subscription blocklist.SetSubscribeVideoAllowlist
:Set the video subscription allowlist.If a user is added in a blocklist and a allowlist at the same time, only the blocklist takes effect.
10. Set audio scenarios
To make it easier to change audio scenarios, this release adds the SetAudioScenario
method. For example, if you want to change the audio scenario from AudioScenarioDefault
to AudioScenarioGameStreaming
when you are in a channel, you can call this method.
11. Replace video feeds with images
This release supports replacing video feeds with images when publishing video streams. You can call the enableVideoImageSource
method to enable this function and choose your own images through the options
parameter. If you disable this function, the remote users see the video feeds that you publish.
12. Local video mixing
This release adds a series of APIs supporting local video mixing functions. You can mix multiple video streams into one video stream locally. Common scenarios are as follows:
You can call the startLocalVideoTranscoder
method to start local video mixing and call the stopLocalVideoTranscoder
method to stop local video mixing. After the local video mixing starts, you can call updateLocalTranscoderConfiguration
to update the local video mixing configuration.
13. Video device management
Video capture devices can support multiple video formats, each supporting a different combination of video frame width, video frame height, and frame rate.
This release adds the numberOfCapabilities
and getCapability
methods for getting the number of video formats supported by the video capture device and the details of the video frames in the specified video format. When calling the startPrimaryCameraCapture
or startSecondaryCameraCapture
method to capture video using the camera, you can use the specified video format.
VideoEncoderConfiguration
, so normally you should not need to use these new methods.1. Fast channel switching
This release can achieve the same switching speed as SwitchChannel
in v3.7.0 through the LeaveChannel
and JoinChannel
methods so that you don't need to take the time to call the SwitchChannel
method.
2. Push external video frames
This releases supports pushing video frames in I422 format. You can call the pushVideoFrame
[1/2] method to push such video frames to the SDK.
3. Voice pitch of the local user
This release adds voicePitch
in AudioVolumeInfo
of onAudioVolumeIndication
. You can use voicePitch
to get the local user's voice pitch and perform business functions such as rating for singing.
4. Video preview
This release improves the implementation logic of startPreview
. You can call the startPreview
method to enable video preview at any time.
5. Video types of subscription
You can call the setRemoteDefaultVideoStreamType
method to choose the video stream type when subscribing to streams.