Overlay text or an image on a video with per-frame rendering. Supports: Text overlay using drawtext (with font, colour, position control) Image overlay using the overlay filter (PNG recommended) Time-range control (start_sec / end_sec) Opacity control Example (text): {"url": "https://cdn.example.com/video.mp4", "text": "LIVE", "position": "top_right", "font_color": "red"} Example (image): {"url": "https://cdn.example.com/video.mp4", "overlay_url": "https://cdn.example.com/badge.png", "position": "bottom_left"}
Overlay text or an image on a video with per-frame rendering.
Supports:
Text overlay using drawtext (with font, colour, position control) Image overlay using the overlay filter (PNG recommended) Time-range control (start_sec / end_sec) Opacity control Example (text): {"url": "https://cdn.example.com/video.mp4", "text": "LIVE", "position": "top_right", "font_color": "red"}
Example (image): {"url": "https://cdn.example.com/video.mp4", "overlay_url": "https://cdn.example.com/badge.png", "position": "bottom_left"}
{
"url": "https://cdn.example.com/video.mp4",
"type": "text",
"margin": 15,
"content": "LIVE",
"end_sec": 10,
"position": "top_right",
"font_size": 32,
"start_sec": 0,
"font_color": "#ff0000"
}
{
"url": "https://cdn.example.com/video.mp4",
"type": "image",
"scale": 0.1,
"margin": 20,
"content": "https://cdn.example.com/watermark.png",
"opacity": 0.5,
"position": "bottom_right"
}
{
"x": 50,
"y": 50,
"url": "https://cdn.example.com/video.mp4",
"type": "image",
"scale": 0.15,
"content": "https://cdn.example.com/badge.png",
"end_sec": 8,
"opacity": 0.8,
"start_sec": 2
}
{
"url": "https://cdn.example.com/video.mp4",
"overlays": [
{
"x": 20,
"y": 20,
"type": "image",
"scale": 0.12,
"content": "https://cdn.example.com/logo.png",
"opacity": 0.9
},
{
"type": "text",
"margin": 20,
"content": "Breaking News",
"end_sec": 12,
"position": "bottom_left",
"font_size": 40,
"start_sec": 3,
"font_color": "#ffffff"
}
]
}
{
"url": "https://cdn.example.com/video.mp4",
"overlays": [
{
"x": 30,
"y": 30,
"type": "image",
"scale": 0.15,
"content": "https://cdn.example.com/sponsor-a.png",
"end_sec": 10,
"opacity": 1,
"start_sec": 0
},
{
"x": 30,
"y": 30,
"type": "image",
"scale": 0.15,
"content": "https://cdn.example.com/sponsor-b.png",
"end_sec": 20,
"opacity": 1,
"start_sec": 10
}
]
}
{
"job_id": "f595b9ad-1e15-4452-b7c2-8f8ff09c0a34",
"status": "pending",
"message": "Job created. Poll status_url for progress.",
"job_type": "caption",
"result_url": "https://eranol.com/api/v1/ffmpeg/result/f595b9ad-1e15-4452-b7c2-8f8ff09c0a34",
"status_url": "https://eranol.com/api/v1/ffmpeg/status/f595b9ad-1e15-4452-b7c2-8f8ff09c0a34"
}
Send your requests to the following URL using the specified HTTP method.
POST https://eranol.com/api/v1/ffmpeg/video/overlayInclude the following headers with every request. Your API key is required for authentication.
Send the following JSON payload in the request body. Adjust the values to match your use case.
{
"url": "https://cdn.example.com/video.mp4",
"type": "text",
"margin": 15,
"content": "LIVE",
"end_sec": 10,
"position": "top_right",
"font_size": 32,
"start_sec": 0,
"font_color": "#ff0000"
}All available options for this endpoint. Required parameters are marked accordingly.
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | string | required | Video file URL |
| overlays | array | required | Array of overlay objects to apply |
| overlays[].type | string | required | Overlay type: text or image |
| overlays[].content | string | required | Text string or image URL |
| overlays[].x | int | 0 | X position in pixels from left |
| overlays[].y | int | 0 | Y position in pixels from top |
| overlays[].start_sec | float | 0 | Start time in seconds |
| overlays[].end_sec | float | null | End time in seconds (null = until end) |
| overlays[].font_size | int | 24 | Font size (text overlays only) |
| overlays[].font_color | string | white | Font color (text overlays only) |
| overlays[].scale | float | 0.2 | Scale relative to video width (image overlays only) |
| overlays[].opacity | float | 1.0 | Overlay opacity (0.0–1.0) |
Use the following cURL command to make a request to this API endpoint. Replace YOUR_API_KEY with your actual API key from the dashboard.
curl -X POST "https://eranol.com/api/v1/ffmpeg/video/overlay" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://cdn.example.com/video.mp4","type":"text","margin":15,"content":"LIVE","end_sec":10,"position":"top_right","font_size":32,"start_sec":0,"font_color":"#ff0000"}'Below is an example of a successful JSON response from this endpoint.
{
"job_id": "f595b9ad-1e15-4452-b7c2-8f8ff09c0a34",
"status": "pending",
"message": "Job created. Poll status_url for progress.",
"job_type": "caption",
"result_url": "https://eranol.com/api/v1/ffmpeg/result/f595b9ad-1e15-4452-b7c2-8f8ff09c0a34",
"status_url": "https://eranol.com/api/v1/ffmpeg/status/f595b9ad-1e15-4452-b7c2-8f8ff09c0a34"
}A successful request will return one of the following HTTP status codes.