Overview
Basic Concepts
Quick Start
Domain Management
Origin Settings
Media Processing
Before You Start
How to Use
Transcoding
Transmuxing
Video Encryption
Intelligent Transcoding
Editing
Video/Audio Splicing
Video/Audio Trimming
Video Cropping
Screenshot
Add Subtitles
Add Watermarks
Appendix
Cache Settings
Cache Purge and Prefetch
HTTP/HTTPS Settings
Access Control
Advanced Settings
Logs and Reports
Tutorials
Content Protection

Video/Audio Splicing

Last update:2025-03-21 15:25:12

Splicing allows you to merge various video and audio files into one unified content piece. This versatile operation can be performed in conjunction with other media processing functions to create custom media outputs.

How to Use

Structure your fops command as shown below:

<op>/<Format>
    /mode/<value>
    /concatorder/<value>
    /moovToFront/<value>
    /<encodeUrl1>/<encodeUrl2>...
    |saveas/<Urlsafe_Base64_Encode(bucket:filekey)>

Parameters

Parameter Required Description
op Yes Operation type. Use avconcat for splicing operations.
format Yes Target output format (mp3, mp4, m3u8, etc.)
mode No Splicing method:
1 - For files with identical codecs (required for audio splicing)
2 - For files with different codecs
concatorder No Sequence order for file concatenation, separated by hyphens
Example: 2-1-4-3 would concat file 2, then 1, then 4, then 3
moovToFront No MP4 metadata placement:
0 (default) - Keep metadata at the end of file
1 - Move metadata to beginning for faster streaming startup
<encodeUrl1>/<encodeUrl2>... Yes Files to be spliced, each encoded with URL-safe Base64
Example: Urlsafe_Base64_Encode(test_1.mp4)/Urlsafe_Base64_Encode(test_2.mp4)

Important Notes:
1. All files must be from the same Object Storage bucket
2. Maximum of 5 files can be spliced at once
saveas No Output location as URL-safe Base64-encoded string: Urlsafe_Base64_Encode(bucket:savedfilename)

Example

This example merges two videos, test_1.mp4 and test_2.mp4, from the vod-wcs-test001 bucket into a single output file named test_merge.mp4:

Pseudocode:

curl -v -X POST 
–d "bucket=Urlsafe_Base64_Encode(vod-wcs-test001)&key=Urlsafe_Base64_Encode(test_1.mp4)&fops=Urlsafe_Base64_Encode(avconcat/mp4/mode/1/Urlsafe_Base64_Encode(test_1.mp4)/Urlsafe_Base64_Encode(test_2.mp4)|saveas/Urlsafe_Base64_Encode(vod-wcs-test001:test_merge.mp4))&force=1&separate=1" 
–H "Authorization:AccessKey:EncodeSign" 
--url "http://mgrDomain/fops"

Actual Request:

curl -v -X POST 
-d "bucket=dm9kLXdjcy10ZXN0MDAx&key=dGVzdF8xLm1wNA==&fops=YXZjb25jYXQvbXA0L21vZGUvMS9kR1Z6ZEY4eUxtMXdOQT09fHNhdmVhcy9kbTlrTFhkamN5MTBaWE4wTURBeE9uUmxjM1JmYldWeVoyVXViWEEw&force=1&separate=1" 
-H "Authorization:AccessKey:EncodeSign" 
--url "http://mgrDomain/fops"
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!