In today's digital landscape, creating engaging video content is imperative. Whether you're a developer building a content pipeline or an automation tool for video editing, adding text overlays to videos can enhance viewer engagement. FFMPEGAPI.net provides a simple and efficient way to automate this process using our hosted REST API for FFmpeg-powered video and audio processing.
What is FFMPEGAPI.net?
FFMPEGAPI.net is a hosted REST API that allows developers to perform complex video and audio processing tasks without the need for server setup or infrastructure management. With API-key authentication, developers can seamlessly integrate video editing capabilities into their applications.
- No server setup required.
- API-key authentication for secure access.
- Ideal for automation, SaaS applications, and AI agents.
Using the Text Overlay Captions API
The Text Overlay Captions endpoint allows you to overlay text captions onto videos dynamically. This is particularly useful for adding subtitles or callouts to enhance video storytelling.
To use this feature, you will need to send a POST request to the /api/videos/add-text-overlay-captions endpoint with the required parameters.
- video_url: The URL of the video you want to edit.
- text: The caption lines you wish to display, separated by newlines.
- subtitle_style: Optional styles include plain-white, yellow-bg, pink-bg, blue-bg, or red-bg (default: plain-white).
- aspect_ratio: Set to 16:9, 9:16, 4:3, or 3:4 (default: 9:16).
- position: Choose top, center, or bottom for caption placement (default: center).
- duration_per_line: Control how long each line is displayed (default: 5 seconds).
import requests
url = 'https://ffmpegapi.net/api/videos/add-text-overlay-captions'
headers = {'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'}
data = {
'video_url': 'https://example.com/video.mp4',
'text': 'First line\nSecond line',
'duration_per_line': 4
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
curl -X POST 'https://ffmpegapi.net/api/videos/add-text-overlay-captions' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"video_url":"https://example.com/video.mp4", "text":"First line\nSecond line", "duration_per_line":4}'
FFMPEGAPI.net is the ideal solution for developers looking to automate video editing tasks like adding text overlays. With our easy-to-use API, you can focus on developing your application without worrying about the complexities of server infrastructure. Start enhancing your videos and engage your audience today!