Last update:2026-07-15 18:34:40
The trimming operation allows you to specify a start point and duration to extract only the relevant portion of a media file.
| Parameter | Required | Description |
|---|---|---|
op |
Yes | Operation type. Use avthumb for trimming operations. |
format |
Yes | Target output format, such as mp3, mp4, m3u8, or mov. |
ss |
No | Start point for trimming, in seconds. For example, 120 starts trimming at the 120-second mark. |
t |
No | Duration of the trimmed output, in seconds. When used with ss, this defines the segment to extract. For example, ss=120 and t=180 extract a 180-second clip starting at the 120-second mark. |
saveas |
Yes | Specifies the output location and file name as a URL-safe Base64-encoded string in the format Urlsafe_Base64_Encode(bucket:savedfilename). |
Structure your fops parameter in the request body as follows:
<op>/<format>
/ss/<value>
/t/<value>
|saveas/<Urlsafe_Base64_Encode(bucket:filekey)>
This example demonstrates trimming a 100-second segment from a video, starting at the 125-second mark.
Source details:
vod-test001test.mp4output.movcurl -v -X POST \
-d "bucket=Urlsafe_Base64_Encode(vod-test001)&key=Urlsafe_Base64_Encode(test.mp4)&fops=Urlsafe_Base64_Encode(avthumb/mov/ss/125/t/100|saveas/Urlsafe_Base64_Encode(vod-test001:output.mov))&force=1&separate=1" \
-H "Authorization: AccessKey:EncodeSign" \
--url "http://mgrDomain/fops"
curl -v -X POST \
-d "bucket=dm9kLXdjcy10ZXN0MDAx&key=dGVzdC5tcDQ=&fops=YXZ0aHVtYi9tb3Yvc3MvMTI1L3QvMTAwfHNhdmVhcy9kbTlrTFhkamN5MTBaWE4wTURBeE9tOTFkSEIxZEM1dGIzWT0=&force=1&separate=1" \
-H "Authorization: AccessKey:EncodeSign" \
--url "http://mgrDomain/fops"