TXUGCPublish.h
?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.
Error message:
Solution: Run pod install
.
Error message: Main Thread Checker: UI API called on a background thread
Note:This issue has been fixed in v4.9.
Run pod install
.
The SDK uses certain class methods. To load them, you need to add -ObjC
to Build Settings > Linking > Other Linker Flags in the project.
startCameraSimple:preview:
> setBGM:
> startRecord
.Note:Many APIs need to be called in a certain sequence in order to work. Such requirements are often specified in code comments.
For example,setVideoResolution:
,setVideoBitrate:
, andsetAspectRatio:
must all be called beforestartRecord
in order to work.
Currently, loop playback is not supported.
endTime
). Why?If the 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 endTime
.
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 stopRecord
or stopCameraPreview
(if you do, the shooting will stop, and you can only start a new shooting). Instead, call pauseRecord
, use 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.
stopRecord
is called. Only after stopRecord
is called can the completion callback be returned.The 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: pauseGenerate
and 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.
Note:After
resumeGenerate
is 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 theTXVideoGenerateListener
error event internally, and the video will need to be generated again.
Status code:
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).
Was this page helpful?