tencent cloud

User Generated Short Video SDK

뉴스 및 공지사항
Release Notes
The “startPlay” API of the UGSV SDK Renamed
제품소개
Overview
Features
Use Cases
Concepts
구매 가이드
Pricing Overview
Refund Policy
라이선스 가이드
Adding and Renewing a License
Configuring and Viewing a License
SDK 다운로드
SDK Download
Release Notes (App)
UI 통합 솔루션 포함
UGSV Demo App
Source Code Description (iOS)
Source Code Description (Android)
UI 통합 솔루션 없음
SDK Integration
Capturing and Shoot
Preview, Clipping, and Splicing
Upload and Playback
Tencent Effect SDK
Advanced Features and Special Effects
API 문서
Editing
Shooting
기술적 지원
Error Codes
Feature FAQs
일반적인 문제
Upload
Android Compilation
Android
iOS
License
UGSV 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약

iOS

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-04-01 17:14:08
The TXVideoJoiner can merge multiple videos either by sequentially concatenating them or by combining their frames in a split-screen layout.

1. Basic Video Concatenation

To simply concatenate multiple video files sequentially, refer to the following code:
// Create TXVideoJoiner (nil for preview param indicates no preview needed)
TXVideoJoiner* _videoJoin = [[TXVideoJoiner alloc] initWithPreview:nil];

// Set video files to concatenate (_composeArray)
[_videoJoin setVideoPathList:_composeArray];

// Set delegate for progress/completion callbacks
_videoJoin.joinerDelegate = self;

// Start merging (540p compressed output)
[_videoJoin joinVideo:VIDEO_COMPRESSED_540P videoOutputPath:_outFilePath];

2. Preview Before Concatenation

To preview the concatenated videos before merging, use the following code:
// Configure preview view
TXPreviewParam *param = [[TXPreviewParam alloc] init];
param.videoView = _videoPreview.renderView;
param.renderMode = PREVIEW_RENDER_MODE_FILL_EDGE;

// Create TXVideoJoiner with preview
TXVideoJoiner* _videoJoin = [[TXVideoJoiner alloc] initWithPreview:param];
_videoJoin.previewDelegate = _videoPreview;

// Set video files
[_videoJoin setVideoPathList:_composeArray];

// Start preview playback
[_videoJoin startPlay];

Control playback with:

startPlay: Start preview
pausePlay: Pause preview
resumePlay: Resume preview

3. Split-Screen Video Merging

TXVideoJoiner also supports merging multiple videos into a split-screen layout. Example code:
TXVideoJoiner* _videoJoin = [[TXVideoJoiner alloc] initWithPreview:nil];
[_videoJoin setVideoPathList:_composeArray];
_videoJoin.joinerDelegate = self;

// Configure split-screen layout
TXSplitScreenParams* splitScreenParams = [[TXSplitScreenParams alloc] init];
splitScreenParams.canvasWidth = 720 * 2; // Total output width
splitScreenParams.canvasHeight = 1280; // Total output height

// Define positions for each video
splitScreenParams.rects = @[
[NSValue valueWithCGRect:CGRectMake(0, 0, splitScreenParams.canvasWidth/2, splitScreenParams.canvasHeight)],
[NSValue valueWithCGRect:CGRectMake(splitScreenParams.canvasWidth/2, 0, splitScreenParams.canvasWidth/2, splitScreenParams.canvasHeight)]
];

splitScreenParams.durationMode = ALIGNS_TO_LONGEST; // Duration matches longest input
[_videoJoiner setSplitScreenList:splitScreenParams];

// Set audio mix ratios (0: muted, 1: full volume)
[_videoJoiner setVideoVolumes:@[@0, @1]];

// Start merging
[_videoJoin joinVideo:VIDEO_COMPRESSED_540P videoOutputPath:_outFilePath];
When configuring split-screen layout parameters via setSplitScreenList and audio mixing ratios via setVideoVolumes, these settings apply to ​both the final video output (generated by splitJoinVideo) ​andthe live preview during editing.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백