Since v4.5, we have moved
TXUGCPublish classes from the SDK to the demo. To use the classes, just drag the
VideoUpload directory to your project.
Main Thread Checker: UI API called on a background thread
This issue has been fixed in v4.9.
The SDK uses certain class methods. To load them, you need to add
-ObjC to Build Settings > Linking > Other Linker Flags in the project.
Many APIs need to be called in a certain sequence in order to work. Such requirements are often specified in code comments.
setAspectRatio:must all be called before
startRecordin order to work.
Currently, loop playback is not supported.
endTime is smaller than the total music file duration, in SDK 4.6 or earlier, the completion callback will be triggered only after the playback of the background music is completed. In SDK 4.7 or later, the completion callback will be triggered at the time specified by
iPhone’s camera tends to take a long time to start (cold start). This is also the case if you start the camera using a system API.
It’s not practical to start the camera in a child thread. Tests show that it will take even longer to start the camera in a child thread. If the camera is started and closed frequently in the main thread, the response delay of the child thread will also increase.
When shooting is interrupted, do not call
stopCameraPreview (if you do, the shooting will stop, and you can only start a new shooting). Instead, call
TXUGCPartsManager.getVideoPathList to get the video segment already shot, and call
TXVideoJoiner.joinVideo to merge it into the final video. This method works in versions earlier than 4.5. In 4.5 and later versions, just call
TXUGCPartsManager.joinAllParts to splice the final video, which is quicker.
stopRecordis called. Only after
stopRecordis called can the completion callback be returned.
AudioSession on iOS is shared by all audio/video applications. When you switch to another player during shooting, the
AudioSession will be occupied by the player. If it is not released in a timely manner, after you switch back,
AudioSession may not work for the shooting module. The SDK provides two APIs:
-(void) pauseAudioSession and
-(void) resumeAudioSession. You can call
pauseAudioSession before you switch to another player and then call
resumeAudioSession before you switch back to resume shooting.
Videos may be blurry if the bitrate and resolution do not match. You can try increasing the bitrate moderately or enable B-frame encoding.
Hardware encoding (featuring higher encoding efficiency and image quality) is used by default for video generation. However, the hardware encoder will stop running if the application is switched to the background, resulting in video generation failure. The SDK provides two APIs:
resumeGenerate. When the application is switched to the background, you can call
pauseGenerate to pause video generation. When the application returns to the foreground, you can call
resumeGenerate to resume video generation.
resumeGenerateis called, the SDK will try to restart the hardware encoder. This may not always succeed, or the hardware encoder may fail to encode the first few frames after restart. In such cases, the SDK will throw the
TXVideoGenerateListenererror event internally, and the video will need to be generated again.
The UGSV SDK supports photo capturing. You can simply call the
snapshot API of the
TXUGCRecord class to get an image after the preview starts.
The error indicates that the compiler failed to find the
TXVideoInfo class. Please check whether the SDK (frameworks) is imported correctly. For details, see SDK Integration (Xcode).