The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.
What to Do If Integration Encounters an Exception?
You can use the armeabi and armeabi-v7a architectures.
As shown above, specify abiFilters as "armeabi" in the app's build.gradle.
Function Module Upgraded, Can'T Use the Features of User Generated Short Video SDK?
1. If you are using Android Studio, after replacing with a new aar, please modify the aar reference in the build.gradle of app in /libs directory of your project to check if it is consistent with the file name of the aar. Then clean and rebuild your project.
2. Confirm the functional module type. The short video SDK functional modules are divided into two authorization types: basic version and simplified edition. The included features are different. The difference lies in the presence or absence of special effects.
Currently, Can the Resolution Generated By User Generated Short Video SDK Recording Be Customized? What Are the Customizable Outputs?
Customizable parameters for short video SDK recording include FPS (frames per second), GOP (key I-frame interval in seconds), video bitrate (amount of audio and video data generated per second by the encoder), maximum/minimum recording duration, and recording resolution. Four resolution options are provided as constants for you to choose from: 360×640, 540×960, 720×1280, 1080×1920.
The reason why recording is provided in constant sizes instead of user-customized sizes is as follows:
The above four are the mainstream recording resolutions.
Compatibility issue of Android mobile phones. Some non-mainstream resolutions are not supported, which may cause some screen glitches, green screens, and mosaics.
By calling the startCameraCustomPreview interface of the TXUGCRecord class and passing in the custom recording parameters, the code is as follows:
Why Is There No onRecordComplete Callback Received After Android Short Video Recording Ends?
Before starting to record a short video, please first set the recording callback listener by calling the setVideoRecordListener() API of the TXUGCRecord class. When it ends, you need to call the stopRecord() API of the TXUGCRecord class to end the recording.
Exiting Short Video Recording and Starting the Second Recording, How to Continue Recording From the Previous Content?
After the onRecordComplete callback in the Demo, mTXCameraRecord.getPartsManager().deleteAllParts() is called to delete all shard files, because stopRecord has already completed the synthesis of shard files.
If the recording exits and continues from the last time, there is no need to delete the fragments. Do not call mTXCameraRecord.getPartsManager().deleteAllParts().
mDuration = mTXCameraRecord.getPartsManager().getDuration();// Total recording duration
if(mTXCameraRecord !=null){
mTXCameraRecord.getPartsManager().deleteAllParts();// Delete the recorded shard files multiple times
}
startPreview();// Enter the preview interface
}
Why Does the Background Audio Setting in Short Video Recording Not Take Effect?
The background music must be set before starting the recording (the startRecord API of TXUGCRecord) to take effect. Refer to the following example for the code call sequence:.
// 2. Then set the path of the background music and play it
mBGMDuration = mTXCameraRecord.setBGM(mBGMPath);
mTXCameraRecord.playBGMFromTime(0, mBGMDuration);
// 3. Start recording (customVideoPath: video path after recording, customPartFolder: folder for recorded videos, customCoverPath: cover path of the recorded video)
int result = mTXCameraRecord.startRecord(customVideoPath, customPartFolder, customCoverPath);
Does Recording Have a Photo-Taking Feature?
The short video SDK includes a photo - capturing function. Call the snapshot API of the TXUGCRecord class, and the photo taken will be returned asynchronously through the TXRecordCommon.ITXSnapshotListener callback. The code example is as follows:
What Are the Format Requirements For Importing Videos? Does It Support Importing Videos With a Resolution Higher Than 720P (For Example, 2K, 4K)? Are There Specific Size Limits For Imported Files?
Currently, on the Android side, only MP4 is supported for video import. There is no limitation on resolution, and there is no file size limit for imported files.
There is no limit on the resolution of imported videos. No matter how large the original video is, it will be up to 720P after pre-processing.
To quickly import videos, preprocessing (some features are restricted, such as reverse playback, single-frame preview, etc.) can be skipped after SDK 4.7. For videos with a resolution greater than 720P, it is recommended to add preprocessing because preview involves decoding each frame. Some mobile phones have poor performance, resulting in too long a time to decode a frame and render it on the interface, causing lag.
Which Format of Background Music Does the Current Short Video UGSV SDK Editing Support?
Currently, only MP3 and M4A types are supported.
What Are the Customizable Outputs of the Current Short Video UGSV SDK Editing?
The short video UGSV SDK for editing allows you to customize video bitrate (available in SDK 4.5 and later), audio bitrate (available in SDK 4.7 and later), and resolution. Several resolutions are provided as constants for you to choose from: 360×640, 480×640, 540×960, 720×1280, 1080×1920.
Can the Audio Be Removed From the Video Recorded By the Recording Feature of the Short Video UGSV SDK?
Currently, the short video UGSV SDK does not support simultaneous recording of BGM and voice. Therefore, after entering the editing mode, you can reset the BGM and set the original video sound volume to 0 to achieve the purpose of replacing the BGM. The code is as follows:
// Set the volume of the original video sound (set to 0 to remove the recorded BGM)
mTXVideoEditer.setVideoVolume(0.0f);
// Set the local path of the background music
String bgmPath =getBGMPath();
mTXVideoEditer.setBGM(bgmPath);
// Set the volume of the background music, ranging from 0.0f to 1.0f
mTXVideoEditer.setBGMVolume(1.0f);
How to Switch the Video Preview in the Same Activity Window and Full-Screen Mode?
Dynamically modify the size of the parent layout of the video preview View passed into the SDK. The SDK will dynamically adjust the size of the video according to the size of the parent layout and the video width and height. The calling sequence of the SDK API:
1. Perform stopPlay.
2. Modify the width and height of the FrameLayout passed to the SDK.
3. Call initWithPreview(parm) and pass in the layout of the new FrameLayout that hosts the playback component.
4. Start play again.
// Stop playback
mTXVideoEditer.stopPlay();
if(isFullScreen){
// If it is in full-screen mode, switch to window mode below
How to Separate the "Edit" and "Filter" Features Into Two Pages When Editing With the Short Video UGSV SDK?
The short video Demo of Tencent Cloud RT-Cube combines features such as "edit" and "filter" on one page. To separate the "edit" and "filter" features into two pages, you can first perform cropping (setCutTimeFrom) + pre-processing (processVideo) simultaneously. As a result, a cropped and pre-processed video is generated. Then, perform various editing operations, set the cropping to the entire duration (setCutTimeFrom), and finally call generateVideo to generate a video to prevent the video quality from being reduced due to double compression.
Note
After cropping in pre-processing, when generating the preprocessed video, before the final generation, be sure to set the cropping duration to the entire video duration, otherwise cropping will be performed again.