Last update:2025-05-29 13:48:29
The trimming operation lets you specify a start point and duration to extract only the relevant portion of your media file.
| Parameter | Required | Description |
|---|---|---|
op |
Yes | Operation type. Use avthumb for all media processing operations. |
format |
Yes | Target output format (mp3, mp4, m3u8, etc.). |
ss |
No | Starting point for trimming, in seconds. For example, 120 starts trimming from the 120-second mark. |
t |
No | Duration of the trimmed output, in seconds. When used with ss, defines the segment to extract. Example: ss=120, t=180 extracts a 180-second clip starting from the 120-second mark. |
saveas |
No | Specifies the output location and filename as a URL-safe Base64-encoded string using 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-wcs-test001test.mp4output.movcurl -v -X POST
-d "bucket=Urlsafe_Base64_Encode(vod-wcs-test001)&key=Urlsafe_Base64_Encode(test.mp4)&fops=Urlsafe_Base64_Encode(avthumb/m4a/ss/125/t/100)|saveas/Urlsafe_Base64_Encode(vod-wcs-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"