Video/Audio Splicing

Last update:2026-07-15 18:46:01

Splicing allows you to merge multiple video or audio files into a single output file. This flexible operation can also be combined with other media processing functions to create customized 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, such as mp3, mp4, or m3u8.
mode No Splicing mode:
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 concatenates file 2, then file 1, then file 4, and then file 3.
moovToFront No MP4 metadata placement:
0 (default) - Keep metadata at the end of the file
1 - Move metadata to the beginning of the file for faster playback 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 in the same Object Storage bucket.
2. A maximum of 5 files can be spliced in a single operation.
saveas Yes Output location as a URL-safe Base64-encoded string, in the format Urlsafe_Base64_Encode(bucket:savedfilename).

Example

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

Pseudocode:

curl -v -X POST \
  -d "bucket=Urlsafe_Base64_Encode(vod-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-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"