Create an FFmpeg job
curl --request POST \
--url https://ffmpeg-api.cloud/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"binary": "ffmpeg",
"inputs": {
"input": {
"type": "url",
"url": "https://example.com/source.mp4"
}
},
"outputs": {
"output": {
"fileName": "clip.gif",
"contentType": "image/gif"
}
},
"ffmpegArgs": [
"-i",
"{{input}}",
"-vf",
"fps=10,scale=480:-1:flags=lanczos",
"{{output}}"
]
}
'import requests
url = "https://ffmpeg-api.cloud/v1/jobs"
payload = {
"binary": "ffmpeg",
"inputs": { "input": {
"type": "url",
"url": "https://example.com/source.mp4"
} },
"outputs": { "output": {
"fileName": "clip.gif",
"contentType": "image/gif"
} },
"ffmpegArgs": ["-i", "{{input}}", "-vf", "fps=10,scale=480:-1:flags=lanczos", "{{output}}"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
binary: 'ffmpeg',
inputs: {input: {type: 'url', url: 'https://example.com/source.mp4'}},
outputs: {output: {fileName: 'clip.gif', contentType: 'image/gif'}},
ffmpegArgs: ['-i', '{{input}}', '-vf', 'fps=10,scale=480:-1:flags=lanczos', '{{output}}']
})
};
fetch('https://ffmpeg-api.cloud/v1/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ffmpeg-api.cloud/v1/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'binary' => 'ffmpeg',
'inputs' => [
'input' => [
'type' => 'url',
'url' => 'https://example.com/source.mp4'
]
],
'outputs' => [
'output' => [
'fileName' => 'clip.gif',
'contentType' => 'image/gif'
]
],
'ffmpegArgs' => [
'-i',
'{{input}}',
'-vf',
'fps=10,scale=480:-1:flags=lanczos',
'{{output}}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ffmpeg-api.cloud/v1/jobs"
payload := strings.NewReader("{\n \"binary\": \"ffmpeg\",\n \"inputs\": {\n \"input\": {\n \"type\": \"url\",\n \"url\": \"https://example.com/source.mp4\"\n }\n },\n \"outputs\": {\n \"output\": {\n \"fileName\": \"clip.gif\",\n \"contentType\": \"image/gif\"\n }\n },\n \"ffmpegArgs\": [\n \"-i\",\n \"{{input}}\",\n \"-vf\",\n \"fps=10,scale=480:-1:flags=lanczos\",\n \"{{output}}\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ffmpeg-api.cloud/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"binary\": \"ffmpeg\",\n \"inputs\": {\n \"input\": {\n \"type\": \"url\",\n \"url\": \"https://example.com/source.mp4\"\n }\n },\n \"outputs\": {\n \"output\": {\n \"fileName\": \"clip.gif\",\n \"contentType\": \"image/gif\"\n }\n },\n \"ffmpegArgs\": [\n \"-i\",\n \"{{input}}\",\n \"-vf\",\n \"fps=10,scale=480:-1:flags=lanczos\",\n \"{{output}}\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ffmpeg-api.cloud/v1/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"binary\": \"ffmpeg\",\n \"inputs\": {\n \"input\": {\n \"type\": \"url\",\n \"url\": \"https://example.com/source.mp4\"\n }\n },\n \"outputs\": {\n \"output\": {\n \"fileName\": \"clip.gif\",\n \"contentType\": \"image/gif\"\n }\n },\n \"ffmpegArgs\": [\n \"-i\",\n \"{{input}}\",\n \"-vf\",\n \"fps=10,scale=480:-1:flags=lanczos\",\n \"{{output}}\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3f0e9cfd-4e56-4c0b-8df0-2bfa88c40f50",
"binary": "ffmpeg",
"status": "queued",
"mode": "preset"
}{
"error": "Job payload is invalid.",
"code": "INVALID_REQUEST",
"details": [
{
"path": [
"ffmpegArgs"
],
"message": "ffmpegArgs are required.",
"code": "custom"
}
]
}UnauthorizedJobs
Create an FFmpeg job
Queue an asynchronous FFmpeg or FFprobe job. The API returns immediately and the job continues in the background.
POST
/
v1
/
jobs
Create an FFmpeg job
curl --request POST \
--url https://ffmpeg-api.cloud/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"binary": "ffmpeg",
"inputs": {
"input": {
"type": "url",
"url": "https://example.com/source.mp4"
}
},
"outputs": {
"output": {
"fileName": "clip.gif",
"contentType": "image/gif"
}
},
"ffmpegArgs": [
"-i",
"{{input}}",
"-vf",
"fps=10,scale=480:-1:flags=lanczos",
"{{output}}"
]
}
'import requests
url = "https://ffmpeg-api.cloud/v1/jobs"
payload = {
"binary": "ffmpeg",
"inputs": { "input": {
"type": "url",
"url": "https://example.com/source.mp4"
} },
"outputs": { "output": {
"fileName": "clip.gif",
"contentType": "image/gif"
} },
"ffmpegArgs": ["-i", "{{input}}", "-vf", "fps=10,scale=480:-1:flags=lanczos", "{{output}}"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
binary: 'ffmpeg',
inputs: {input: {type: 'url', url: 'https://example.com/source.mp4'}},
outputs: {output: {fileName: 'clip.gif', contentType: 'image/gif'}},
ffmpegArgs: ['-i', '{{input}}', '-vf', 'fps=10,scale=480:-1:flags=lanczos', '{{output}}']
})
};
fetch('https://ffmpeg-api.cloud/v1/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ffmpeg-api.cloud/v1/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'binary' => 'ffmpeg',
'inputs' => [
'input' => [
'type' => 'url',
'url' => 'https://example.com/source.mp4'
]
],
'outputs' => [
'output' => [
'fileName' => 'clip.gif',
'contentType' => 'image/gif'
]
],
'ffmpegArgs' => [
'-i',
'{{input}}',
'-vf',
'fps=10,scale=480:-1:flags=lanczos',
'{{output}}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ffmpeg-api.cloud/v1/jobs"
payload := strings.NewReader("{\n \"binary\": \"ffmpeg\",\n \"inputs\": {\n \"input\": {\n \"type\": \"url\",\n \"url\": \"https://example.com/source.mp4\"\n }\n },\n \"outputs\": {\n \"output\": {\n \"fileName\": \"clip.gif\",\n \"contentType\": \"image/gif\"\n }\n },\n \"ffmpegArgs\": [\n \"-i\",\n \"{{input}}\",\n \"-vf\",\n \"fps=10,scale=480:-1:flags=lanczos\",\n \"{{output}}\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ffmpeg-api.cloud/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"binary\": \"ffmpeg\",\n \"inputs\": {\n \"input\": {\n \"type\": \"url\",\n \"url\": \"https://example.com/source.mp4\"\n }\n },\n \"outputs\": {\n \"output\": {\n \"fileName\": \"clip.gif\",\n \"contentType\": \"image/gif\"\n }\n },\n \"ffmpegArgs\": [\n \"-i\",\n \"{{input}}\",\n \"-vf\",\n \"fps=10,scale=480:-1:flags=lanczos\",\n \"{{output}}\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ffmpeg-api.cloud/v1/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"binary\": \"ffmpeg\",\n \"inputs\": {\n \"input\": {\n \"type\": \"url\",\n \"url\": \"https://example.com/source.mp4\"\n }\n },\n \"outputs\": {\n \"output\": {\n \"fileName\": \"clip.gif\",\n \"contentType\": \"image/gif\"\n }\n },\n \"ffmpegArgs\": [\n \"-i\",\n \"{{input}}\",\n \"-vf\",\n \"fps=10,scale=480:-1:flags=lanczos\",\n \"{{output}}\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3f0e9cfd-4e56-4c0b-8df0-2bfa88c40f50",
"binary": "ffmpeg",
"status": "queued",
"mode": "preset"
}{
"error": "Job payload is invalid.",
"code": "INVALID_REQUEST",
"details": [
{
"path": [
"ffmpegArgs"
],
"message": "ffmpegArgs are required.",
"code": "custom"
}
]
}UnauthorizedAuthorizations
Send your FFmpeg API Cloud API key as a bearer token.
Body
application/json
Create an asynchronous FFmpeg or FFprobe job. Use either input or inputs, and provide raw arguments in ffmpegArgs.
The execution binary used for the job.
Available options:
ffmpeg, ffprobe Minimum array length:
1Reference an uploaded asset by ID.
- AssetInput
- UrlInput
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Job accepted for processing.
The accepted response returned after a job is queued.
A UUID value.
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Example:
"3f0e9cfd-4e56-4c0b-8df0-2bfa88c40f50"
The execution binary used for the job.
Available options:
ffmpeg, ffprobe The current lifecycle state of the job.
Available options:
queued, running, completed, failed, canceled, rejected The job execution mode.
Available options:
preset, raw 
