Use the scale filter with a fixed height and -2 for the width: -vf scale=-2:720. The -2 keeps the aspect ratio and rounds the width to an even number, which H.264 requires.
The ffmpeg command
What you would run locally, for reference.
ffmpeg -i input.mp4 \ -vf scale=-2:720 \ -c:v libx264 -crf 23 -c:a 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"
}
],
"outputs": [
{
"filename": "output.mp4",
"options": [
"-vf",
"scale=-2:720",
"-c:v",
"libx264",
"-crf",
"23",
"-c:a",
"copy"
]
}
]
}
Worth knowing
- Use
-2and not-1:-1can land on an odd width, which libx264 rejects outright. -c:a copypasses the audio through untouched — faster, cheaper, and no generation loss, since resizing has nothing to do with the audio track.
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.