This topic describes how to use the CreateMediaConvertTask operation of Intelligent Media Management (IMM) to merge videos.
Feature introduction
Video merging is the capability to combine multiple video clips into a complete video and convert it to the required format.

Scenarios
Film production: In the production process of movies, TV series, and short films, video merging is one of the core steps that helps editors integrate different shots and scenes to build a complete narrative structure.
Content creation: On short video social media platforms, content creators often use video merging technologies to produce vlogs, tutorials, or themed videos, enhancing the attractiveness and visibility of their content.
Education and training: Teachers and trainers can create instructional videos by merging different video clips to combine theory and practice, thereby promoting student understanding and learning.
Sporting event playback: In sports broadcasts, video merging technologies are used to produce highlight reels to help the audience review exciting moments in the event.
Supported audio and video formats
Category | Format |
Audio | Mainstream audio formats, such as AAC, MP3, WAV, FLAC, WMA, AC3, and Opus. |
Video | Mainstream video formats, such as MP4, MPEG-TS, MKV, MOV, AVI, FLV, M3U8, WebM, WMV, RM, and VOB. |
Use video merging
Prerequisites
An AccessKey pair is created and obtained. For more information, see Create an AccessKey pair.
Object Storage Service (OSS) is activated and a bucket is created. For more information, see Create a bucket.
IMM is activated. For more information, see Activate IMM.
A project is created in the IMM console. For more information, see Create a project.
NoteYou can call the CreateProject operation to create a project. For more information, see CreateProject.
You can call the ListProjects operation to list information of all projects in a region.
Step 1: Upload files
Use the OSS console to upload media files to a bucket in the region where the IMM project is located.

Step 2: Use IMM video merging
You can call the CreateMediaConvertTask operation to create a video merging task.
Parameter examples
The following examples use the IMM project test-project for video merging processing.
For more information about media processing features, see Media transcoding.
You can use the CreateMediaConvertTask operation to process video files in OpenAPI Explorer. For more information, see the SDK sample code.
Merge opening and ending clips to a video
Paths to input video files:
oss://test-bucket/video-demo/head.mov,oss://test-bucket/video-demo/Winemaking.mov, andoss://test-bucket/video-demo/tail.movMain media file index: 1
Video configurations: h264 encoding, CRF set to 24, frame rate 25
Audio configurations: AAC format, bitrate 96 Kbit/s, dual channel, sample rate 44.1 kHz
Output video format: mp4
Path to the output file:
oss://test-bucket/video-demo/concat.mp4Merge completion notification: Send a Simple Message Queue (SMQ) message to the SMQ topic "test-mns-topic".
For the SDK sample code, visit OpenAPI Explorer. The parameters in the sample code are automatically configured for reference. Modify the parameters based on your business requirements before you perform debugging.
Request parameters
{
"ProjectName": "test-project",
"AlignmentIndex": 1,
"Notification": {
"MNS": {
"TopicName": "test-mns-topic"
}
},
"Sources": [
{
"URI": "oss://test-bucket/video-demo/head.mov"
},
{
"URI": "oss://test-bucket/video-demo/Winemaking.mov"
},
{
"URI": "oss://test-bucket/video-demo/tail.mov"
}
],
"Targets": [
{
"Audio": {
"TranscodeAudio": {
"Bitrate": 96000,
"Channel": 2,
"Codec": "aac",
"SampleRate": 44100
}
},
"Container": "mp4",
"URI": "oss://test-bucket/video-demo/concat.{autoext}",
"Video": {
"TranscodeVideo": {
"CRF": 24,
"Codec": "h264",
"FrameRate": 25,
"PixelFormat": "yuv420p"
}
}
}
]
}Merge two videos into one 720p video
Paths to input videos:
oss://test-bucket/video-demo/Winemaking.mov,oss://test-bucket/video-demo/ShushanDistrictCommercialBuilding.movMain media file index: 0
Video configurations: h264 encoding, CRF set to 25, frame rate 25, resolution 1280×720, resize the video and keep the black border. For more information about resize methods, see Resize methods
Audio configurations: AAC format, bitrate 96 Kbit/s, dual channel, sample rate 44.1 kHz
Output video format: mp4
Path to the output file:
oss://test-bucket/video-demo/concat.mp4Merge completion notification: Send an SMQ message to the SMQ topic "test-mns-topic".
For the SDK sample code, visit OpenAPI Explorer. The parameters in the sample code are automatically configured for reference. Modify the parameters based on your business requirements before you perform debugging.
Request parameters
{
"ProjectName": "test-project",
"AlignmentIndex": 0,
"Notification": {
"MNS": {
"TopicName": "test-mns-topic"
}
},
"Sources": [
{
"URI": "oss://test-bucket/video-demo/Winemaking.mov"
},
{
"URI": "oss://test-bucket/video-demo/ShushanDistrictCommercialBuilding.mov"
}
],
"Targets": [
{
"Audio": {
"TranscodeAudio": {
"Bitrate": 96000,
"Channel": 2,
"Codec": "aac",
"SampleRate": 44100
}
},
"Container": "mp4",
"URI": "oss://test-bucket/video-demo/concat.{autoext}",
"Video": {
"TranscodeVideo": {
"AdaptiveResolutionDirection": true,
"CRF": 25,
"Codec": "h264",
"FrameRate": 25,
"PixelFormat": "yuv420p",
"Resolution": "x720",
"ScaleType": "fill"
}
}
}
]
}