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.
Starting from version 4.5, the classes related to TXUGCPublish have been moved from the SDK to the Demo layer. Developers who need to use them can simply drag the entire VideoUpload directory into their own projects.
Error When Directly Running Demo in Xcode?
You need to select the corresponding Target, as shown below:
Connecting Xcode For Debugging, Error in Short Video Recording?
Connect to Xcode for debugging. An error occurred during short video recording. Error message: Main Thread Checker: UI API called on a background thread
The reason is that some APIs (generally UI-related) need to be called on the main thread. If they are called on a non-main thread and Main Thread Checker is enabled, an error will occur.
Troubleshooting: ProductSchemeEdit SchemeRunDiagnostics, uncheck Main Thread Checker.
Note:
This issue has been fixed in version 4.9.
Cannot Find the Header File When Using the Short Video SDK Functional Module?
Add the header file search path in Build Settings>Search Paths>Header Search Paths.
Use the "TXLiteAVSDK_UGC/XXX.h" method to reference the SDK's header file.
Use the @import TXLiteAVSDK_UGC; method to reference the SDK (version 5.0 and later).
Choose one of the above methods.
Issue With Missing Category Methods or crash When Running the Project?
The short video UGSV SDK uses some class methods. To load class methods, add -ObjC in project configuration: Build Settings>Linking>Other Linker Flags.
What Should I Do If the Background Music Set For Short Video Recording Is Unavailable?
1. Determine whether there is a file under the transmitted BGM path and whether it can be played normally.
2. Determine the call sequence of the API: startCameraSimple:preview:>setBGM:>startRecord.
Note:
Many API calls have time sequence requirements; otherwise, they will be invalid. Usually, there will be notes in the comments.
For example, for short video recording, APIs such as setVideoResolution:, setVideoBitrate:, setAspectRatio:, etc., need to be set before startRecord to be effective.
Recording Settings: BGM Cannot Loop Playback?
Currently, the logic does not support loop playback.
Recording Settings: BGM, Callback Not Completed At endTime?
If the set endTime is less than the total duration of the music file, a complete callback will be triggered at endTime.
Why Is It Slow to Open the Camera For the First Time When Recording?
When the camera of an iPhone is opened for the first time (cold startup), the duration is relatively long. The same is true when opening the camera through the system API.
Since opening the camera is not suitable for the child thread, tests have shown that the duration of opening the camera in the child thread is longer. Moreover, when the camera is continuously opened/closed in the main thread, the response delay of the child thread will be higher, resulting in a poor experience.
How to Implement Returning to Continue Recording?
When the first recording is completed, do not call stopRecord and stopCameraPreview (after calling, you cannot continue recording, but can only start a new recording). You can call pauseRecord, and then obtain the recorded video clips through TXUGCPartsManager.getVideoPathList. Synthesize the final video through TXVideoJoiner.joinVideo (for versions before 4.5). You can also directly call TXUGCPartsManager.joinAllParts to synthesize the final video. This method has a faster synthesis speed (supported in versions after 4.5). In this way, when you return to continue recording, all recording states are retained, and you can continue recording.
Why Can'T the Complete Callback Be Received When the Short Video Recording Is Completed?
Determine whether stopRecord has been called. Only after calling stopRecord will the complete callback be received.
Determine whether all function calls are on the main thread.
Can'T Record Sound When Returning to Continue Recording While Playing Video With Another Player During Recording?
The AudioSession in iOS is shared by all audio and video applications. When other players are playing, the AudioSession will be occupied. If the AudioSession is not released or not released in time after playback ends, the AudioSession of the recording module will become invalid. The SDK provides two APIs: -(void) pauseAudioSession and -(void) resumeAudioSession. Call pauseAudioSession before going to other player previews, and call resumeAudioSession before returning to continue recording.
Why Is the Recorded Video Unclear?
If the bitrate and resolution do not match, the recorded video will be unclear. You can improve the video quality by appropriately increasing the bitrate and enabling B-frames.
Video Generation Failure When Switching to Background and Then Back to Frontend During Video Editing?
By default, video generation uses hardcoding (high coding efficiency and good image quality). The hard encoder will stop working when the program enters the background, resulting in video generation failure. The UGSV SDK provides two APIs: pauseGenerate and resumeGenerate. When the App enters the background, you can call pauseGenerate to suspend video generation. When the App returns to the foreground, you can call resumeGenerate to continue video generation.
Note:
Call resumeGenerate. The SDK will restart the hardware encoder. There is a certain probability that the restart will fail, or the encoding of the first few frames of data will fail after the restart. At this time, the SDK will throw an error event in TXVideoGenerateListener. After receiving the error event, it is necessary to regenerate the video.
File Upload Failure?
Status code for file upload:
1. Determine whether the uploaded file is in the local sandbox. If uploading a file to the media library, it needs to be copied to the local sandbox first.
2. Return error code 1002: Signature problem, timestamp expired, vod service problem (not activated or service suspended).
Does the Short Video UGSV SDK Recording Have a Photo - Taking Feature?
The short video SDK supports photo capturing. You can call the snapshot API of the TXUGCRecord class to get an image after starting the preview.
Error "Use of undeclared identifier 'TXVideoInfo'" Keeps Occurring During Integration?
This error occurs because the compiler did not detect the TXVideoInfo class. It is recommended to check whether the SDK (framework) is correct. You can re-import the project according to SDK Integration (XCode).
What to Do If an Error "-1, Failed to enable encoder" Occurs When Calling Video Synthesis?
1. Please confirm whether the issue is reproducible. It is recommended to conduct a test with a different model.
2. You can download the latest version of Demo to reproduce the problem. If the problem occurs consistently, please provide complete log information and submit a ticket for resolution.