Skip to main content

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:

    1. Ensure that you have installed CocoaPods.

    2. In Terminal, navigate to the project path, and run the pod init command to create a Podfile in the project folder.

    3. Open Podfile, and add the Video SDK pod.

      // For version, fill in a specific SDK version number. For example, 4.0.0-beta.2
      pod 'AgoraRtcEngine_macOS_Beta', 'version'
      Copy
    4. Replace version with the version of Video SDK that you want to integrate and set platform to macos, '10.11'.

    5. Return to Terminal, and run the pod install command to install Video SDK. Once you successfully install Video SDK:, it shows Pod installation complete! in Terminal, and you can see an xcworkspace file in the project folder.

    6. Open the generated xcworkspace file.

  • Download Video SDK:

    1. Extract the files from the macOS download to a local folder, <unzipped_package>.

    2. From the libs folder of the downloaded SDK package, copy the files or subfolders you need to the root of your project folder.

    3. 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:

# platform :ios, '9.0'
target 'Your App' do
pod 'AgoraRtcEngine_iOS', '4.0.1'
end
Copy

Example 2: When integrating the iOS Video SDK version 4.0.1 and not using all plugins, the Podfile is as follows:

# platform :ios, '9.0'
target 'Your App' do
pod 'AgoraRtcEngine_iOS', '4.0.1', :subspecs => ['RtcBasic']
end
Copy

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:

# platform :ios, '9.0'
target 'Your App' do
pod 'AgoraRtcEngine_iOS', '4.0.1', :subspecs => ['RtcBasic', 'AINS', 'AudioBeauty']
end
Copy

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:

PluginArchitectureLibrary nameIncrease in app size after integration (KB)
AI noise reductionarm64AgoraAiNoiseSuppressionExtension.xcframework2976
armv7AgoraAiNoiseSuppressionExtension.xcframework2992
Bel cantoarm64AgoraAudioBeautyExtension.xcframework1296
armv7AgoraAudioBeautyExtension.xcframework1328
Video enhancementarm64AgoraClearVisionExtension.xcframework976
armv7AgoraClearVisionExtension.xcframework1008
Video screenshot uploadarm64AgoraContentInspectExtension.xcframework1328
armv7AgoraContentInspectExtension.xcframework1312
PVC insertarm64AgoraPvcExtension.xcframework643
armv7AgoraPvcExtension.xcframework530
Spatial audioarm64AgoraSpatialAudioExtension.xcframework4944
armv7AgoraSpatialAudioExtension.xcframework4960
Virtual backgroundarm64AgoraVideoSegmentationExtension.xcframework3840
armv7AgoraVideoSegmentationExtension.xcframework4528
Face recognitionarmv7AgoraFaceDetectionExtension.xcframework832
arm64AgoraFaceDetectionExtension.xcframework848
Video quality assessmentarm64AgoraVideoQualityAnalyzerExtension.xcframework868
armv7AgoraVideoQualityAnalyzerExtension.xcframework1277
AI echo cancellationarm64AgoraAiEchoCancellationExtension.xcframework3872
armv7AgoraAiEchoCancellationExtension.xcframework3840

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 libraryCategorysubspecs field
  • AgoraRtcKit.xcframework
  • AgoraDav1dExtension.cframework
  • Agorafdkaac.xcframework
  • AgoraSoundTouch.xcframework
  • Agoraffmpeg.xcframework
  • av1.xcframework
requiredRtcBasic
AgoraAIDenoiseExtension.xcframeworkoptionalAINS
AgoraAudioBeautyExtension.xcframeworkoptionalAudioBeauty
AgoraClearVisionExtension.xcframeworkoptionalClearVision
AgoraContentInspectExtension.xcframeworkoptionalContentInspect
AgoraPvcExtension.xcframeworkoptionalPVC (< v4.1.0)
AgoraSpatialAudioExtension.xcframeworkoptionalSpatialAudio
AgoraVideoSegmentationExtension.xcframeworkoptionalVirtualBackground
AgoraAiEchoCancellationExtension.xcframeworkoptionalAIAEC (≥ v4.1.0)
AgoraDrmLoaderExtension.xcframeworkoptionalDRM (≥ v4.1.0)
AgoraFDExtension.xcframeworkoptionalROIEnc (≥ v4.1.1)
AgoraVideoQualityAnalyzerExtension.xcframeworkoptionalVQA (≥ v4.1.0)
AgoraReplayKitExtension.xcframeworkoptionalReplayKit
AgoraSuperResolutionExtension.xcframeworkoptionalSuperResolution (< v4.1.1)
vundefined