Put -ss (where to start) and -t (how long) in the input's options, and -c copy in the output's. Seeking on the input rather than the output is what makes the cut fast, and -c copy skips re-encoding entirely.
The ffmpeg command
What you would run locally, for reference.
ffmpeg -ss 00:00:05 -t 10 -i input.mp4 -c copy output.mp4
The API request
The same flags, sent as JSON. Authenticate with
Authorization: Token <your-api-token>.
{
"global_options": [
"-y"
],
"inputs": [
{
"input_source": "https://example.com/input.mp4",
"options": [
"-ss",
"00:00:05",
"-t",
"10"
]
}
],
"outputs": [
{
"filename": "output.mp4",
"options": [
"-c",
"copy"
]
}
]
}
Worth knowing
- With
-c copythe cut snaps to the nearest keyframe, so it can land up to a few seconds off. Drop-c copyand add-c:v libx264when the cut has to be frame-exact. -tis a duration,-tois an end timestamp. Mixing them up is the most common way to get a clip of the wrong length.
What it costs
Jobs bill in processing seconds — the CPU time this one actually uses — with a floor of 25 seconds per GB pulled out of storage to run it, so a stream-copy still counts. Uploading the output and downloading it afterwards are free. See the plans.