Gửi một việc xử lý video
curl --request POST \
--url https://api.madiad.com/v1/ffmpeg/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"full_command": "<string>",
"file_url": "<string>",
"file_urls": [
"<string>"
],
"output_extension": "<string>"
}
'import requests
url = "https://api.madiad.com/v1/ffmpeg/jobs"
payload = {
"full_command": "<string>",
"file_url": "<string>",
"file_urls": ["<string>"],
"output_extension": "<string>"
}
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({
full_command: '<string>',
file_url: '<string>',
file_urls: ['<string>'],
output_extension: '<string>'
})
};
fetch('https://api.madiad.com/v1/ffmpeg/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://api.madiad.com/v1/ffmpeg/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([
'full_command' => '<string>',
'file_url' => '<string>',
'file_urls' => [
'<string>'
],
'output_extension' => '<string>'
]),
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://api.madiad.com/v1/ffmpeg/jobs"
payload := strings.NewReader("{\n \"full_command\": \"<string>\",\n \"file_url\": \"<string>\",\n \"file_urls\": [\n \"<string>\"\n ],\n \"output_extension\": \"<string>\"\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://api.madiad.com/v1/ffmpeg/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"full_command\": \"<string>\",\n \"file_url\": \"<string>\",\n \"file_urls\": [\n \"<string>\"\n ],\n \"output_extension\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.madiad.com/v1/ffmpeg/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 \"full_command\": \"<string>\",\n \"file_url\": \"<string>\",\n \"file_urls\": [\n \"<string>\"\n ],\n \"output_extension\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}ffmpeg
Gửi một việc xử lý video
Gửi file_url hoặc file_urls, chỉ nhận https://. Lệnh được kiểm tra với danh sách cho phép trước khi tiêu tốn hạn mức.
POST
/
v1
/
ffmpeg
/
jobs
Gửi một việc xử lý video
curl --request POST \
--url https://api.madiad.com/v1/ffmpeg/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"full_command": "<string>",
"file_url": "<string>",
"file_urls": [
"<string>"
],
"output_extension": "<string>"
}
'import requests
url = "https://api.madiad.com/v1/ffmpeg/jobs"
payload = {
"full_command": "<string>",
"file_url": "<string>",
"file_urls": ["<string>"],
"output_extension": "<string>"
}
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({
full_command: '<string>',
file_url: '<string>',
file_urls: ['<string>'],
output_extension: '<string>'
})
};
fetch('https://api.madiad.com/v1/ffmpeg/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://api.madiad.com/v1/ffmpeg/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([
'full_command' => '<string>',
'file_url' => '<string>',
'file_urls' => [
'<string>'
],
'output_extension' => '<string>'
]),
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://api.madiad.com/v1/ffmpeg/jobs"
payload := strings.NewReader("{\n \"full_command\": \"<string>\",\n \"file_url\": \"<string>\",\n \"file_urls\": [\n \"<string>\"\n ],\n \"output_extension\": \"<string>\"\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://api.madiad.com/v1/ffmpeg/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"full_command\": \"<string>\",\n \"file_url\": \"<string>\",\n \"file_urls\": [\n \"<string>\"\n ],\n \"output_extension\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.madiad.com/v1/ffmpeg/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 \"full_command\": \"<string>\",\n \"file_url\": \"<string>\",\n \"file_urls\": [\n \"<string>\"\n ],\n \"output_extension\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "<string>"
}
}Ủy quyền
API key của bạn, gửi ở header Authorization: Bearer <key>. Một key quản lý mọi hồ sơ trong tài khoản.
Nội dung
application/json
Lệnh FFmpeg cần chạy. Được đối chiếu với danh sách cho phép trước khi nhận.
Địa chỉ https:// của tệp đầu vào.
Địa chỉ https:// của các tệp đầu vào, cho lệnh cần đọc nhiều tệp.
Phần mở rộng của tệp kết quả, ví dụ mp4.
Phản hồi
Thành công.
Lớp vỏ phản hồi thì ổn định — một profile_id kèm phần nội dung — nhưng các trường bên trong chưa được ghim chặt trong tài liệu này.

