iOS short video SDK FAQ

更新时间:
复制 MD 格式

Find answers to common questions about integrating, recording, cropping, editing, and uploading with the short video SDK for iOS.

SDK integration

"Category method not found" error during import

In your project's target settings, navigate to Build Settings > Other Linker Flags and add -ObjC.

Debug vs. Release packages

The Debug package includes both simulator and device versions, making it suitable for local debugging. The Release package includes only the device version. Use the Release package when you submit your app to the App Store, because Apple requires that submitted dynamic libraries do not contain simulator versions.

"Image not found" crash after import

The short video SDK uses a dynamic library. To resolve this error, add the corresponding framework to the Embedded Binaries section of your project. For detailed instructions, see Integrate the SDK.

Does the short video SDK support bitcode?

The short video SDK does not support bitcode. Set Enable Bitcode to NO in your project settings. If you receive a "failed to verify bitcode" error during packaging, deselect the rebuild for bitcode option.

Cause of the "unrecognized selector" error

This error occurs when the upload SDK is not imported. The short video SDK depends on AliyunOSSiOS.framework from the upload SDK. For more information, see Integrate the SDK.

Video recording

Retrieving a video after recording

You can retrieve the video only within the - (void)recorderDidFinishRecording; callback, which runs after recording finishes.

Recording in landscape mode

During recording, set the angle value for the cameraRotate property. The orientation of the entire video is determined by the angle of the first recorded segment.

Changing background music during recording

You cannot change music during a recording session.

How do I implement full-screen recording?

To record in a 9:16 aspect ratio, choose one of the following approaches:

  • Approach 1: Retain the black bars at the top and bottom of the screen, as shown in the short video SDK demo. This is a common approach for devices like the iPhone X.

  • Approach 2: Adjust the view layout to stretch vertically and fill the entire screen. This will crop some content from the left and right sides.

Video cropping

Fixing crop error 1008

Disable the shouldOptimize option.

/**
 Specifies whether to enable optimization.

 If enabled, the video is cropped by time only, without re-encoding.
 This is not required when cropping music.
 Default: disabled.
 */
@property(nonatomic, assign) BOOL shouldOptimize;

Fixing crop error 700004

This error indicates that no output path was specified. Set the output path by using the outputPath parameter of AliyunCrop.

Cropping without black bars

Scale the video based on its original resolution. Ensure that the scaled output resolution uses even numbers for both width and height.

Cropping music

When cropping music, you do not need to set the videoSize and ouptutSize parameters. All other parameters are the same as those for video cropping.

Video editing

Resolving the "[null length]" crash during composition

Ensure that the watermark path, specified by the source parameter of AEPGlobalWatermarkTrack, is set correctly.

Audio distortion after using the volume API

The default volume value is 100, which represents the original audio level. Values greater than 100 may cause distortion. Set the volume to a value between 0 and 100.

Resolving "resource not found" errors

To maintain the correct directory structure, copy resources into your project as a folder reference. In Xcode, folder references are displayed in blue.

Fixing the "operation not permit" error

If you are importing a video from the device's photo album, call the system API to request album access permission. Also, ensure that the corresponding AVAsset instance has not been deallocated.

Unable to adjust volume or sound effects

Ensure that the file you added is an audio file in a supported format, such as PCM or MP3. These operations cannot be performed on the audio track of a video file.

Video upload

Handling upload authorization errors

Symptom: A video upload fails with an authorization error.

Possible cause: If you are uploading by using Security Token Service (STS), the temporary credentials may have expired.

Solution: Obtain a new STS token and retry the upload.

  1. Use your Alibaba Cloud account to create a RAM user and grant the AliyunSTSAssumeRoleAccess permission to the RAM user.

  2. Use the RAM user to create a role and grant the VODFULL policy to the role.

  3. Call the STS SDK to obtain a temporary token. For more information, see Obtain an STS token.

    Note

    The AccessKey pair used to call the STS SDK must belong to the RAM user. For more information about accounts, RAM users, and authorization, see Accounts and authorization.

  4. Modify the policy to grant the VODFULL policy for ApsaraVideo VOD.

{
    "Version": "1", 
    "Statement": [
        {
            "Action": [
                "vod:*"
            ], 
            "Resource": [
                "*" 
            ], 
            "Effect": "Allow"
        }
    ]
}

No failure callback on network disconnection

If the network disconnects during an upload, the SDK automatically retries the operation. To prevent retries, manually call the API to cancel the upload.

Video downloaded in M3U8 format

If you select the HLS option in your transcoding settings, the service converts the video to the M3U8 format.

Submit to the App Store

Handling App Store submission errors

Symptom: An error message is displayed, indicating an "Invalid CFBundleSupportedPlatforms value".

Possible cause: This issue can occur with QuCore-ThirdParty version 4.3.1 or 3.15.0. In these versions, the value of CFBundleSupportedPlatforms in the info.plist file is set to iPhoneSimulator.

Solution:

  • Method 1: In the info.plist file, change the value of CFBundleSupportedPlatforms to iPhoneOS.

  • Method 2: Use a different version of QuCore-ThirdParty.

    QuCore-ThirdParty version

    short video SDK version

    ≥ 4.3.2 (Recommended)

    ≥ v3.26.0

    4.3.1 (Not recommended)

    v3.26.0 ~ v3.29.0

    4.3.0

    v3.24.0 ~ v3.25.1

    3.15.0

    < v3.24.0