tencent cloud

Last updated: 2025-04-01 17:14:10
iOS
Last updated: 2025-04-01 17:14:10

TXUGCRecord

Instantiation API

API
Description
Gets an instance.

Camera and mic APIs

API
Description
Starts the camera preview.
Starts the camera preview.
Changes the shooting resolution. For this API to work, it must be called after startCamera.
Sets the rendering mode. For this API to work, it must be called after startCamera.
Changes the shooting bitrate.
Sets the camera factor. For this API to work, it must be called after startCamera.
Switches between the front and rear cameras. For this API to work, it must be called after startCamera.
Turns on/off the flashlight. For this API to work, it must be called after startCamera.
Stops the camera preview.
setVideoRenderMirrorType:(TXVideoRenderMirrorType)mirrorType
(Added in version 11.0) Sets the rendering image type.

Shooting APIs

API
Description
Sets the orientation for shooting.
Sets the rotation for rendering.
Sets the aspect ratio.
Sets the shooting speed (not supported in UGSV Lite).
Sets whether to mute audio.
Starts shooting. The SDK will automatically generate the video path.
Starts shooting.
Starts shooting.
Pauses shooting.
Pauses shooting.
Resumes shooting.
Stops shooting.
Pauses the audio session. If you use a different player for preview, make sure you call this API before the preview.
Restarts the audio session of the SDK.
setVideoEncoderMirror:(BOOL)isMirror
(Added in version 11.0) Set video encoding mirror

Shooting effect APIs

API
Description
Sets a global watermark (not supported in UGSV Lite).
Gets the beauty filter management object.
Sets the beautification and brightening strength(Deprecated) – Use TXBeautyManager APIs instead.
Sets the color filter(Deprecated) – Use TXBeautyManager APIs instead.
Sets two filters (not supported in UGSV Lite).(Deprecated) – Use TXBeautyManager APIs instead.
Sets the filter strength.(Deprecated) – Use TXBeautyManager APIs instead.
Sets the strength of the big eyes effect. (Deprecated)
Sets the strength of the slim face effect. (Deprecated)
Sets the V shape effect. (Deprecated)
Sets the chin length. (Deprecated)
Sets the face length. (Deprecated)
Sets the nose size. (Deprecated)
Sets the green screen. (Deprecated)
Sets the animated effect. (Deprecated)
Sets whether to mute an animated effect. (Deprecated)

Background music APIs

API
Description
Sets the background music (not supported in UGSV Lite).
Sets the background music (not supported in UGSV Lite).
Sets whether to loop the background music (not supported in UGSV Lite).
Plays the background music (not supported in UGSV Lite).
Stops the background music (not supported in UGSV Lite).
Pauses the background music (not supported in UGSV Lite).
Resumes the background music (not supported in UGSV Lite).
Sets the mic volume.
Sets the volume of the background music.
Sets the reverb effect. (not supported in UGSV Lite).
Sets the voice changing effect (not supported in UGSV Lite).
Takes a screenshot/photo (not supported in UGSV Lite). For this API to work, it must be called after startCamera.

TXUGCRecordListener

Shooting callbacks

API
Description
The shooting progress.
The shooting ended.
A shooting event (not in use yet).

TXUGCRecordTypeDef

Definitions of key types

API
Description
Shooting parameters.
Shooting parameter.
The shooting result.

Enumerated types

API
Description
Video quality options.
Resolution.
Rendering modes.
Aspect ratios.
Shooting speeds.
Orientation modes.
Codecs.
Reverb effects.
Voice changing effects.
Beauty styles.
Audio sample rates.
Error codes for the shooting result.

Error Codes

Shooting result

Message
Code
Description
UGC_RECORD_RESULT_OK
0
The shooting was successful (ended by the user), and a video will be generated.
UGC_RECORD_RESULT_OK_INTERRUPT
1
The shooting was successful (interrupted by an alarm, a call, or switching of the app to the background), and a video will be generated.
UGC_RECORD_RESULT_OK_UNREACH_MINDURATION
2
The shooting was successful (the duration was shorter than the minimum duration allowed), and a video will be generated.
UGC_RECORD_RESULT_OK_BEYOND_MAXDURATION
3
The shooting was successful (the duration was longer than the maximum duration allowed), and a video will be generated.
UGC_RECORD_RESULT_FAILED
1001
The shooting failed. No video will be generated.

Return error code for starting recording

Code
Description
-1
Short video recording in progress
-2
videoRecorder initialization failed
-3
Camera not opened
-4
Microphone not opened
-5
Licence verification failed.
-6
videoPath is nil
-7
coverPath is nil


Recording Event Codes

Code
Description
1
Pause recording
2
Resume recording
3
Camera failed to open
4
Microphone failed to open
5
Video segment generated
6
Recording started
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback