This topic describes the exceptions and special scenarios that you may encounter when you use the audio and video terminal SDK. This topic also describes how to handle such exceptions and special scenarios.
FAQ about SDK integration
What do I do if a conflict of the libc++shared.so library occurs during compiling?
android {
packagingOptions {
pickFirst 'lib/*/libc++_shared.so'
}
}FAQ about stream ingest
How do I handle AlivcLivePushErrorListener callbacks?
- If an onSystemError callback is returned, a system error occurred. In this case, you must exit the live stream.
- If an onSDKError callback is returned, use one of the following methods to fix the error:
- Destroy the stream and create a new one.
- Call restartPush or restartPushAsync to restart AlivcLivePusher.
- If a callback related to microphone and camera permission issues is returned, check the error code to troubleshoot the error. The ALIVC_PUSHER_ERROR_SDK_CAPTURE_CAMERA_OPEN_FAILED error code indicates that the app is not authorized to use the microphone. The ALIVC_PUSHER_ERROR_SDK_CAPTURE_MIC_OPEN_FAILED error code indicates that the app is not authorized to use the camera.
How do I handle AlivcLivePushNetworkListener callbacks?
- If an onNetworkPoor callback is returned, the network speed is slow. The network conditions are poor, but the stream ingest is ongoing and not interrupted. When the network conditions return to normal, an onNetworkRecovery callback is returned. Then, you can configure custom business logic. For example, you can notify users of network recovery on the app UI.
- If an onConnectFail, onReconnectError, or onSendDataTimeout callback is returned, a specific network error occurs. In this case, destroy the current AlivcLivePusher object and then create a new one. Alternatively, you can call reconnectAsync to reconnect to the network. We recommend that you test the network connectivity and the ingest URL before you reconnect to the network.
- The SDK fires the onReconnectStart callback to reconnect to the network when the SDK receives a reconnection request or when the user calls reconnectStart. To reconnect to the network, the app reinitiates a connection to the Real-Time Messaging Protocol (RTMP) server.
After the RTMP connection is established, an onReconnectSuccess callback is returned. However, stream ingest may not be resumed. If network issues persist, stream ingest may fail to be resumed. In this case, the SDK keeps trying to reconnect to the RTMP server.
- If an onPushURLAuthenticationOverdue callback is returned, the ingest URL is about to expire. An onPushURLAuthenticationOverdue callback can be returned only after you enable URL signing. An ingest URL contains the auth_key field. The callback is fired 1 minute before the ingest URL expires. After the callback is returned, you must specify a new ingest URL to ensure that stream ingest is not interrupted when the original URL expires. Sample code:
String onPushURLAuthenticationOverdue(AlivcLivePusher pusher) { return "New ingest URL rtmp://"; }
How do I handle AlivcLivePusherBGMListener callbacks?
- If an onOpenFailed callback is returned, the background music (BGM) fails to be played. In this case, check whether the audio file and the file path specified in startBGMAsync are valid. Then, call startBGMAsync to replay the BGM.
- If an onDownloadTimeout callback is returned, the BGM playback times out. This issue usually occurs when you use a URL to play the BGM. This callback instructs the streamer to check the status of the network. You can call startBGMAsync to replay the BGM.
How do I handle network disconnections?
- Short-period network disconnection and network switchover: The SDK attempts to reconnect to the network when a network disconnection or a network switchover occurs. You can use the AlivcLivePushConfig class to set the reconnection timeout period and the maximum number of reconnection attempts allowed. After the SDK reconnects to the network, stream ingest is resumed. If you use ApsaraVideo Player, we recommend that you reconnect to the network 5 seconds after you receive a timeout notification.
- Long-period network disconnection: The SDK fails to reconnect to the network if a reconnection request times out or the number of reconnection attempts exceeds the upper limit. In this case, the onReconnectError callback is fired. After the network connection is recovered, call reconnectAsyn to reconnect to the network. You must also reconnect the SDK to ApsaraVideo Player.
- We recommend that you externally monitor the network connection.
- Use the server to handle communication failures between the streamer and player. For example, when the streamer is disconnected from the server, the server receives a callback of stream ingest interruption from Alibaba Cloud CDN. The server pushes the callback message to the player. Then, the player handles the stream ingest interruption. The server uses the same procedure to resume stream ingest.
- Stop the playback and then restart ApsaraVideo Player to reconnect the player to the server. Call stop to stop the player and then call prepareAndPlay to restart the player.
mPlayer.stop(); mPlayer.prepareAndPlay(mUrl);
What do I do when the app is switched to the background or the screen is locked?
- When the app is switched to the background or the screen is locked, you can call the
pause()orresume()method of the AlivcLivePusher class to pause or resume stream ingest. - For non-system audio and video calls, the SDK continues recording and ingesting the audio stream. You can call the mAlivcLivePusher.setMute() method to specify whether to enable audio recording when the app is switched to the background or your screen is locked. You can set setMute to true or false.
How do I set bitrates for ingested streams?
- Video quality: A higher bitrate of the ingested stream indicates higher video quality. We recommend that you set a higher bitrate to ensure higher video quality.
- Video smoothness: A higher bitrate of the ingested stream indicates that more network bandwidth is required. A higher bitrate in poor network conditions may affect the smoothness of video playback.
FAQ about the short video SDK
How do I request a free trial license of the short video SDK?
- The name of the company.
- The name of the application.
- The SDK edition of which you request a trial.
- The name of the contact.
- The phone number of the contact.
- The bundle ID of the application.
- The package name and MD5 signature:
- The MD5 signature is a string of lowercase letters. Do not include colons (:) in the string.
- You can use the signature tool to obtain the package name and signature. After you install the tool, follow the instructions of the tool.
- The Alibaba Cloud account or the UID.
If you do not have an Alibaba Cloud account, create one first. For more information, see Create an Alibaba Cloud account.
- The free trial license is valid for one month.
- Make sure that the request information is complete and in the valid format. If you need to change the package name, signature, or bundle ID, submit a request again.
- The free trial of the short video SDK Professional Edition supports features such as advanced retouching, auto chroma key, and gesture recognition. These features are provided by Queen SDK or a third-party SDK. If you want to use these features in the free trial, state relevant information in your request. The authorization certificate of Queen SDK or the third-party SDK will be sent to you by email.
What are the differences between face stickers, face AR, and animated stickers?
Face stickers are a feature in video recording, which allows you to add stickers to recognized faces. Only the short video SDK Professional Edition supports this feature. Face AR is a feature in Queen SDK that requires additional authorization. Animated stickers are a feature in video editing. Only the short video SDK Professional Edition supports this feature.
FAQ about Queen SDK
What is Queen SDK?
Queen SDK is developed by Alibaba Cloud. This SDK supports various real-time effects including face retouching, face shaping, filters, stickers, makeup, gesture recognition, and chroma key in different video scenarios, satisfying your various photography requirements.
Can I use Queen SDK together with third-party SDKs?
Queen SDK is an independent SDK that can be used together with common SDKs such as ApsaraVideo Live SDKs, Tencent Cloud SDKs, Qiniu Cloud Live Video Cloud SDK, Agora SDKs, and Librestreaming SDKs.
Integration is a simple process. Third-party SDKs that can return a texture or image data buffer to an application for processing can be used together with Queen SDK. You can also use Queen SDK together with Alibaba Cloud SDKs such as the short video SDK, Push SDK, interactive streaming SDK, and RTC SDK. This way, you can connect to other services in a more efficient manner. For more information, visit the Queen_SDK_Android page.
How do I select a Queen SDK edition?
- Pro Edition
- Ultimate Edition
- Full Edition
| Feature | Effect | Pro Edition | Ultimate Edition | Full Edition |
|---|---|---|---|---|
| Face retouching | Auto face retouching | ✓ | ✓ | ✓ |
| Skin whitening | ✓ | ✓ | ✓ | |
| Skin smoothing | ✓ | ✓ | ✓ | |
| Image sharpening | ✓ | ✓ | ✓ | |
| Blemish concealing | ✓ | ✓ | ✓ | |
| Eye bags removal | ✓ | ✓ | ✓ | |
| Nasolabial folds removal | ✓ | ✓ | ✓ | |
| Teeth whitening | ✓ | ✓ | ✓ | |
| Eye brightening | ✓ | ✓ | ✓ | |
| Rosy cheeks | ✓ | ✓ | ✓ | |
| Face shaping | Auto face shaping | ✓ | ✓ | ✓ |
| Face slimming | ✓ | ✓ | ✓ | |
| Face trimming | ✓ | ✓ | ✓ | |
| Lower jaw slimming | ✓ | ✓ | ✓ | |
| Cheekbone narrowing | ✓ | ✓ | ✓ | |
| Eye enlarging | ✓ | ✓ | ✓ | |
| Eye height adjustment | ✓ | ✓ | ✓ | |
| Smiling | ✓ | ✓ | ✓ | |
| Face length adjustment | ✓ | ✓ | ✓ | |
| Chin width adjustment | ✓ | ✓ | ✓ | |
| Chin length adjustment | ✓ | ✓ | ✓ | |
| Lip shaping | ✓ | ✓ | ✓ | |
| Lip thickness adjustment | ✓ | ✓ | ✓ | |
| Nose wing adjustment | ✓ | ✓ | ✓ | |
| Nose slimming | ✓ | ✓ | ✓ | |
| Canthus shaping | ✓ | ✓ | ✓ | |
| Eye distance adjustment | ✓ | ✓ | ✓ | |
| Philtrum adjustment | ✓ | ✓ | ✓ | |
| Hairline adjustment | ✓ | ✓ | ✓ | |
| Makeup | Auto makeup | × | ✓ | ✓ |
| Lipstick | × | ✓ | ✓ | |
| Eyeshadow | × | ✓ | ✓ | |
| Blush | × | ✓ | ✓ | |
| Eye makeup | × | ✓ | ✓ | |
| Highlight | × | ✓ | ✓ | |
| Aegyo sal | × | ✓ | ✓ | |
| Eyebrow | × | ✓ | ✓ | |
| Filters | Different styles of filters | ✓ 5 | ✓ All | ✓ |
| Stickers | Static and animated stickers | ✓ 10 | ✓ All | ✓ |
| Body shaping | Body slimming | × | ✓ | ✓ |
| Head narrowing | × | ✓ | ✓ | |
| Leg slimming | × | ✓ | ✓ | |
| Leg lengthening | × | ✓ | ✓ | |
| Breast enlarging | × | ✓ | ✓ | |
| Neck adjustment | × | ✓ | ✓ | |
| Arm adjustment | × | ✓ | ✓ | |
| Waist slimming | × | ✓ | ✓ | |
| Hairdressing | Hairdressing | × | ✓ | ✓ |
| Green- and blue-screen chroma key | Green- and blue-screen chroma key | × | × | ✓ |
| Background replacement | Background replacement | × | × | ✓ |
| Gesture recognition | Gesture recognition | × | × | ✓ |
| AR writing | AR writing | × | × | ✓ |
How do I request different editions of Queen SDK?
You can select an edition based on your business requirements. Then, submit the required information on the specific page. After your request is received, Alibaba Cloud handles the request within two business days. For more information, see Usage notes on licenses.