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
License ガイド
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.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック