App size optimization
A smaller app size means quicker download and installation times, which can lead to a better user experience. This page shows you how to manually install the Video SDK and reduce the app size of the SDK integrated app.
Manual installation
To manually install Video SDK:
-
Using CocoaPods:
-
In Terminal, navigate to the project path, and run the
pod init
command to create aPodfile
in the project folder. -
Open
Podfile
, and add the Video SDK pod. -
Replace
version
with the version of Video SDK that you want to integrate and setplatform
tomacos, '10.11'
. -
Return to Terminal, and run the
pod install
command to install Video SDK. Once you successfully install Video SDK:, it showsPod installation complete!
in Terminal, and you can see anxcworkspace
file in the project folder. -
Open the generated
xcworkspace
file.
-
Download Video SDK:
-
Extract the files from the macOS download to a local folder,
<unzipped_package>
. -
From the libs folder of the downloaded SDK package, copy the files or subfolders you need to the root of your project folder.
-
In Xcode, link your target to the frameworks or libraries you have copied. Be sure to choose Embed & Sign from the pop-up menu in the Embed column.
Apple does not allow an app extension to contain any dynamic library. If you are integrating the Agora SDK to an app extension, choose Do Not Embed in the Embed column.
The Agora SDK uses libc++ (LLVM) by default. Contact support@agora.io if you want to use libstdc++ (GNU). Video SDK: provides FAT image libraries with multi-architecture support for both 32/64-bit audio emulators and 32/64-bit audio/video real devices.
-
Reduce the app size
To reduce the app size, implement the following strategies:
Use the audio SDK
Video SDK supports both audio and video functions, and the package size is large. If you only need to use the audio features, best practice is to integrate the Voice SDK.
Remove unneeded plugins
The SDK provides optional plugin dynamic libraries. The name of the plugin is suffixed with extension
. See the plugin list for details on the function and size of the plugins. Refer to the following ways to exclude these plugins to reduce the size of the app.
Manual integration
When integrating through the official SDK download link, delete the plugin files you don't need.
Remove plugins when CocoaPods is integrated
When integrating the iOS/macOS SDK through CocoaPods, you can use the subspecs
field to specify the dynamic library you need to integrate, so as to exclude the plugins you don't need to use. See the subspecs field for details about the correspondence between the dynamic library and the subspecs
field .
Example 1: When integrating the iOS Video SDK version 4.0.1 and using all plugins, the Podfile is as follows:
Example 2: When integrating the iOS Video SDK version 4.0.1 and not using all plugins, the Podfile is as follows:
Example 3: When integrating the 4.0.1 version of the iOS Video SDK and only need to use the AI noise reduction plug-in and the Bel Canto plug-in in the plug-in list, the Podfile is as follows:
When filling in the above pod command, please make sure that the SDK version you specified has the plugin you specified, and the subspecs
field is correct, otherwise pod installation error will be reported when . For example, pod 'AgoraRtcEngine_iOS', '4.0.0', :subspecs => ['RtcBasic', 'AgoraRtcAINS']
when pod install
an error will be reported.
Reference
This section contains content that completes the information in this page, or points you to documentation that explains other aspects to this product.
Plugin list
This section provides information on including plugins provided with Video SDK.
The following table shows the plugin library name, and the increase in app size after integration for each architecture:
Plugin | Architecture | Library name | Increase in app size after integration (KB) |
---|---|---|---|
AI noise reduction | arm64 | AgoraAiNoiseSuppressionExtension.xcframework | 2976 |
armv7 | AgoraAiNoiseSuppressionExtension.xcframework | 2992 | |
Bel canto | arm64 | AgoraAudioBeautyExtension.xcframework | 1296 |
armv7 | AgoraAudioBeautyExtension.xcframework | 1328 | |
Video enhancement | arm64 | AgoraClearVisionExtension.xcframework | 976 |
armv7 | AgoraClearVisionExtension.xcframework | 1008 | |
Video screenshot upload | arm64 | AgoraContentInspectExtension.xcframework | 1328 |
armv7 | AgoraContentInspectExtension.xcframework | 1312 | |
PVC insert | arm64 | AgoraPvcExtension.xcframework | 643 |
armv7 | AgoraPvcExtension.xcframework | 530 | |
Spatial audio | arm64 | AgoraSpatialAudioExtension.xcframework | 4944 |
armv7 | AgoraSpatialAudioExtension.xcframework | 4960 | |
Virtual background | arm64 | AgoraVideoSegmentationExtension.xcframework | 3840 |
armv7 | AgoraVideoSegmentationExtension.xcframework | 4528 | |
Face recognition | armv7 | AgoraFaceDetectionExtension.xcframework | 832 |
arm64 | AgoraFaceDetectionExtension.xcframework | 848 | |
Video quality assessment | arm64 | AgoraVideoQualityAnalyzerExtension.xcframework | 868 |
armv7 | AgoraVideoQualityAnalyzerExtension.xcframework | 1277 | |
AI echo cancellation | arm64 | AgoraAiEchoCancellationExtension.xcframework | 3872 |
armv7 | AgoraAiEchoCancellationExtension.xcframework | 3840 |
AI noise reduction plugin
The 4.x
SDK supports the new version of AI noise reduction. The new version of AI noise reduction has better human voice fidelity, cleaner noise suppression, and adds the de-reverberation ability.
Bel canto plugin
The Bel Canto plugin provides a series of preset vocal effects, and also supports custom vocal effects through settings such as pitch, sound balance, and reverb. After integrating the bel canto plugin, you can call the following method to enable the bel canto effect you want:
setVoiceBeautifierPreset
: Talking bel canto, singing bel canto, timbre change.setAudioEffectPreset
: Changing sound effects, genre sound effects, space shaping, electronic sound effects.setVoiceConversionPreset
: Basic voice changer.setLocalVoicePitch
,setLocalVoiceEqualization
,setLocalVoiceReverb
: Adjust the pitch, equalization and reverb effects to get the desired vocal effect.
Video enhancement plugin
The video enhancement plugin provides basic beauty, video noise reduction, dark light enhancement, color enhancement and other capabilities. After integrating the video enhancement plugin, you can call the following methods to enable the video enhancement function you want:
setBeautyEffectOptions
: Set the basic beauty function.setVideoDenoiserOptions
: Set the video noise reduction function.setLowlightEnhanceOptions
: Set the low light enhancement function.setColorEnhanceOptions
: Set the color enhancement function.
Video screenshot upload plugin
The video screenshot upload plugin provides the ability to screenshot and upload videos sent by local users to meet the needs of video content supervision. After integrating the video screenshot upload plugin, you can call enableContentInspect
to enable video screenshot upload.
PVC insert
PVC (Perceptual Video Coding) is a video coding method that reduces bandwidth consumption while ensuring the same image quality. Use it to improve video fluency in scenarios with limited bandwidth, and reduce traffic consumption in mobile network scenarios. If you need to use this function, please contact technical support.
Since v4.1.0, the SDK statically compiles the PVC library by default, and no longer provides plugins. If you have integrated the PVC plugin, you need to remove the PVC plugin from the project dependencies and recompile the project after upgrading.
Spatial audio plugin
The spatial audio plugin shapes the sense of direction of the remote user's voice. It simulates the propagation process of sound in the real world to realize the spatial sound effect when the local user listens to a remote user.
Virtual background plugin
After integrating the virtual background plugin, you can call enableVirtualBackground
to enable the virtual background. Use a custom background image, a green screen to replace the original background image of the local user, or blur the background.
Face recognition plugin
Agora provides a face recognition plugin since v4.1.1, that recognizes faces or portraits through face or virtual background segmentation algorithms. It uses higher-quality encoding for the ROI (Region of Interest) area during the encoding process to achieve sharper face or portrait effect. If you need to use this function, please contact technical support.
Screen sharing plugin
The screen sharing plugin supports sharing your own screen content with the audience or other users to improve communication efficiency. See screen sharing for details .
Video quality assessment plugin
Since v4.1.0, the SDK provides a Video Quality Assessment (VQA) plugin, which simulates the subjective feelings of real people to score video quality. If you need to use this function, please contact technical support.
AI echo cancellation plugin
The AI echo cancellation plugin preserves complete, clear, and smooth near-end human voice, even under poor echo-to-signal ratio, and significantly improves the system's echo cancellation. The dual-speak performance gives users a more comfortable call and live broadcast experience. It is widely used in conferences, voice chats, karaoke and other scenarios. If you need to use this function, please contact technical support.
subspecs
field
When integrating the iOS/macOS SDK through CocoaPods, you can use the subspecs
field to specify the dynamic library you need to integrate, so as to exclude the plugins you don't need to use. The corresponding relationship between the dynamic library and the subspecs
field is shown in the table below:
macOS Audio Video SDK
This table provides an overview of the macOS Video SDK, including the dynamic libraries and their respective subspecs
fields.
Dynamic library | Category | subspecs field |
---|---|---|
| required | RtcBasic |
AgoraAIDenoiseExtension.xcframework | optional | AINS |
AgoraAudioBeautyExtension.xcframework | optional | AudioBeauty |
AgoraClearVisionExtension.xcframework | optional | ClearVision |
AgoraContentInspectExtension.xcframework | optional | ContentInspect |
AgoraPvcExtension.xcframework | optional | PVC (< v4.1.0) |
AgoraSpatialAudioExtension.xcframework | optional | SpatialAudio |
AgoraVideoSegmentationExtension.xcframework | optional | VirtualBackground |
AgoraAiEchoCancellationExtension.xcframework | optional | AIAEC (≥ v4.1.0) |
AgoraDrmLoaderExtension.xcframework | optional | DRM (≥ v4.1.0) |
AgoraFDExtension.xcframework | optional | ROIEnc (≥ v4.1.1) |
AgoraVideoQualityAnalyzerExtension.xcframework | optional | VQA (≥ v4.1.0) |
AgoraReplayKitExtension.xcframework | optional | ReplayKit |
AgoraSuperResolutionExtension.xcframework | optional | SuperResolution (< v4.1.1) |