Drop the video stream with -vn and encode what's left. -c:a libmp3lame -q:a 2 gives a ~190 kbps VBR MP3, which is the usual choice when the file has to play everywhere.
The ffmpeg command
What you would run locally, for reference.
ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3
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.mp3",
"options": [
"-vn",
"-c:a",
"libmp3lame",
"-q:a",
"2"
]
}
]
}
Worth knowing
- To avoid re-encoding entirely, use
-vn -c:a copyand name the output for whatever codec is already inside — usually.m4afor AAC. It is faster, cheaper and lossless, but you don't get to pick the format. -q:aruns backwards from CRF: 0 is the best quality, 9 the worst.
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.