tencent cloud

User Generated Short Video SDK

Release Notes and Announcements
Release Notes
The “startPlay” API of the UGSV SDK Renamed
Product Introduction
Overview
Features
Use Cases
Concepts
Purchase Guide
Pricing Overview
Refund Policy
Free Trial License
License User Guide
Adding and Renewing a License
Configuring and Viewing a License
Demo
SDK Download
SDK Download
Release Notes (App)
Integration (UI Included)
UGSV Demo App
Source Code Description (iOS)
Source Code Description (Android)
Integration (No UI)
SDK Integration
Capturing and Shoot
Preview, Clipping, and Splicing
Upload and Playback
Tencent Effect SDK
Advanced Features and Special Effects
API Documentation
Editing
Shooting
Technical Support
Error Codes
Feature FAQs
FAQs
Upload
Android Compilation
Android
iOS
License
UGSV Policy
Privacy Policy
Data Processing And Security Agreement

iOS

PDF
Focus Mode
Font Size
Last updated: 2025-04-01 17:14:09

Special Effect Filter

You can add multiple special effect filters for your videos. Currently, 11 filters are supported, all of which allow you to set the start and end time for display in the video. If multiple filters are set at the same point in time, the SDK will display the last set one.
You can set a special effect as follows:
- (void) startEffect:(TXEffectType)type startTime:(float)startTime;
- (void) stopEffect:(TXEffectType)type endTime:(float)endTime;

// The special effect type (`type` parameter) is defined in the `TXEffectType` constant:
typedef NS_ENUM(NSInteger,TXEffectType)
{
TXEffectType_ROCK_LIGHT, // Dynamic light-wave
TXEffectType_DARK_DRAEM, // Dark dream
TXEffectType_SOUL_OUT, // Soul out
TXEffectType_SCREEN_SPLIT,// Screen split
TXEffectType_WIN_SHADOW, // Window blinds
TXEffectType_GHOST_SHADOW,// Ghost shadow
TXEffectType_PHANTOM, // Phantom
TXEffectType_GHOST, // Ghost
TXEffectType_LIGHTNING, // Lightening
TXEffectType_MIRROR, // Mirror
TXEffectType_ILLUSION, // Illusion
};

- (void) deleteLastEffect;
- (void) deleteAllEffect;
You can call deleteLastEffect() to delete the last set special effect filter.You can call deleteAllEffect() to delete all set special effect filters:
Demo: Use the first special effect filter between the first and second seconds, use the second special effect filter between the third and fourth seconds, and delete the special effect filter set between the third and fourth seconds:
// Use the first special effect filter between the first and second seconds
[_ugcEdit startEffect:TXEffectType_SOUL_OUT startTime:1.0];
[_ugcEdit stopEffect:TXEffectType_SOUL_OUT startTime:2.0)];
// Use the second special effect filter between the third and fourth seconds
[_ugcEdit startEffect:TXEffectType_SPLIT_SCREEN startTime:3.0];
[_ugcEdit stopEffect:TXEffectType_SPLIT_SCREEN startTime:4.0];
// Delete the special effect filter set between the third and fourth seconds
[_ugcEdit deleteLastEffect];

Slow/Fast Motions

You can change the playback speed of multiple video segments by setting slow/fast playback as follows:
- (void) setSpeedList:(NSArray *)speedList;

// The `TXSpeed` parameters are as follows:
@interface TXSpeed: NSObject
@property (nonatomic, assign) CGFloat startTime; // Speed change start time in s
@property (nonatomic, assign) CGFloat endTime; // Speed change end time in s
@property (nonatomic, assign) TXSpeedLevel speedLevel; // Speed change level
@end

Currently, multiple speed change levels are supported, which are defined in the `TXSpeedLevel` constant:
typedef NS_ENUM(NSInteger, TXSpeedLevel) {
SPEED_LEVEL_SLOWEST, // Ultra-slow 0.25x of the source video's speed
SPEED_LEVEL_SLOW, // Slow 0.5x of the source video's speed
SPEED_LEVEL_NOMAL, // Normal 1x of the source video's speed
SPEED_LEVEL_FAST, // Fast 1.5x of the source video's speed
SPEED_LEVEL_FASTEST, // Ultra-fast 2x of the source video's speed
};
Demo:
// The SDK supports speed change of multiple video segments. This demo only shows slow playback of one video segment.
TXSpeed *speed =[[TXSpeed alloc] init];
speed.startTime = 1.0;
speed.endTime = 3.0;
speed.speedLevel = SPEED_LEVEL_SLOW;
[_ugcEdit setSpeedList:@[speed]];

Reverse Playback

You can reverse a video as follows:
- (void) setReverse:(BOOL)isReverse;
Demo:
[_ugcEdit setReverse:YES];

Video Segment Loop

You can loop a video segment, but the audio will not be looped.Set the video segment for loop as follows:
- (void) setRepeatPlay:(NSArray *)repeatList;

// The `TXRepeat` parameters are as follows:
@interface TXRepeat: NSObject
@property (nonatomic, assign) CGFloat startTime; // Loop start time in s
@property (nonatomic, assign) CGFloat endTime; // Loop end time in s
@property (nonatomic, assign) int repeatTimes; // Number of repeats
@end
Demo:
TXRepeat *repeat = [[TXRepeat alloc] init];
repeat.startTime = 1.0;
repeat.endTime = 3.0;
repeat.repeatTimes = 3; // Number of repeats
[_ugcEdit setRepeatPlay:@[repeat]];

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback