Create Encoding Filter
Create a new file transcoding filter.
curl -X POST "https://api.5centscdn.com/v2/transcoding/filters/new" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"name": "flutter",
"filter": "overlay",
"args[overlay][url]": "https://cdn.example.com/logo.png",
"args[overlay][scale]": "10",
"args[overlay][position]": "top_right",
"args[drawtext][text]": "© 2024 My Brand",
"args[drawtext][fontsize]": 24,
"args[drawtext][fontcolor]": "#FFFFFF",
"args[drawtext][position]": "top_left",
"_METHOD": "PUT"
}'
import requests
import json
url = "https://api.5centscdn.com/v2/transcoding/filters/new"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"name": "flutter",
"filter": "overlay",
"args[overlay][url]": "https://cdn.example.com/logo.png",
"args[overlay][scale]": "10",
"args[overlay][position]": "top_right",
"args[drawtext][text]": "© 2024 My Brand",
"args[drawtext][fontsize]": 24,
"args[drawtext][fontcolor]": "#FFFFFF",
"args[drawtext][position]": "top_left",
"_METHOD": "PUT"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/transcoding/filters/new", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"name": "flutter",
"filter": "overlay",
"args[overlay][url]": "https://cdn.example.com/logo.png",
"args[overlay][scale]": "10",
"args[overlay][position]": "top_right",
"args[drawtext][text]": "© 2024 My Brand",
"args[drawtext][fontsize]": 24,
"args[drawtext][fontcolor]": "#FFFFFF",
"args[drawtext][position]": "top_left",
"_METHOD": "PUT"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"name": "flutter",
"filter": "overlay",
"args[overlay][url]": "https://cdn.example.com/logo.png",
"args[overlay][scale]": "10",
"args[overlay][position]": "top_right",
"args[drawtext][text]": "© 2024 My Brand",
"args[drawtext][fontsize]": 24,
"args[drawtext][fontcolor]": "#FFFFFF",
"args[drawtext][position]": "top_left",
"_METHOD": "PUT"
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/transcoding/filters/new", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.5centscdn.com/v2/transcoding/filters/new')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"name": "flutter",
"filter": "overlay",
"args[overlay][url]": "https://cdn.example.com/logo.png",
"args[overlay][scale]": "10",
"args[overlay][position]": "top_right",
"args[drawtext][text]": "© 2024 My Brand",
"args[drawtext][fontsize]": 24,
"args[drawtext][fontcolor]": "#FFFFFF",
"args[drawtext][position]": "top_left",
"_METHOD": "PUT"
}'
response = http.request(request)
puts response.body
{
"result": "success",
"message": "Transcoding Settings, New Filter Created",
"filterid": 429
}
/transcoding/filters/new
Target server for requests. Edit to use your own host.
API key (sent in header)
The media type of the request body
Filter name.
Filter category. overlay = apply image/logo watermark. drawtext = render text overlay on video.
Public HTTP/HTTPS URL of the watermark image. PNG recommended for transparency. Required when filter=overlay.
Watermark image size as a percentage of the output video frame width. Required when filter=overlay.
Position of the watermark on the video frame. Required when filter=overlay.
Text string to render as overlay on video. Required when filter=drawtext.
Font size of text overlay in pixels. Required when filter=drawtext.
Color of text overlay. Accepts CSS hex (#RRGGBB) or FFmpeg named colors (white, black, etc.). Required when filter=drawtext.
Position of the text overlay on the video frame. Required when filter=drawtext.
To cast request method POST to PUT.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Body
Filter category. overlay = apply image/logo watermark. drawtext = render text overlay on video.
overlaydrawtextPublic HTTP/HTTPS URL of the watermark image. PNG recommended for transparency. Required when filter=overlay.
https://cdn.example.com/logo.pngWatermark image size as a percentage of the output video frame width. Required when filter=overlay.
10Position of the watermark on the video frame. Required when filter=overlay.
top_lefttop_rightbottom_leftbottom_rightcenterText string to render as overlay on video. Required when filter=drawtext.
© 2024 My BrandFont size of text overlay in pixels. Required when filter=drawtext.
24Color of text overlay. Accepts CSS hex (#RRGGBB) or FFmpeg named colors (white, black, etc.). Required when filter=drawtext.
#FFFFFFPosition of the text overlay on the video frame. Required when filter=drawtext.
top_lefttop_rightbottom_leftbottom_rightcenterResponses
API response status.
Human-readable result or error message.
Unique identifier of the newly created filter.