In today's digital content landscape, enhancing videos with captions and overlays is essential for accessibility and engagement. FFMPEGAPI.net offers a powerful hosted REST API that allows developers to add timed text overlays to their videos effortlessly. This article will guide you through using the Text Overlay Captions endpoint, making it easy to enrich your video content with minimal effort.
What is the Text Overlay Captions Endpoint?
The Text Overlay Captions endpoint is designed to render user-provided text lines as timed caption overlays on videos. By utilizing this feature, developers can automate the captioning process, which is especially useful for content pipelines and AI agents.
- Supports multiple caption lines.
- Customizable subtitle styles.
- Adjustable position and duration for each line.
How to Use the Text Overlay Captions Endpoint
To utilize the Text Overlay Captions feature, you will send a POST request to the following endpoint: /api/videos/add-text-overlay-captions. The request must include the necessary parameters in JSON format.
- video_url: The URL of the video you want to enhance.
- text: The caption lines you wish to overlay, separated by newlines.
- Optional parameters include subtitle_style, aspect_ratio, position, and duration_per_line.
curl -X POST https://www.ffmpegapi.net/api/videos/add-text-overlay-captions \
-H "Content-Type: application/json" \
-d '{"video_url":"https://example.com/video.mp4", "text":"First line\nSecond line", "duration_per_line":4}'
Customizing Your Captions
FFMPEGAPI.net provides several options to customize your captions, allowing you to tailor the appearance based on your video's needs. You can specify the subtitle style, aspect ratio, and the position of your captions on the screen.
- Subtitle Styles: Choose from plain-white, yellow-bg, pink-bg, blue-bg, or red-bg.
- Aspect Ratios: Support for 16:9, 9:16, 4:3, or 3:4.
- Positioning: Set captions to appear at the top, center, or bottom of the video.
import requests
url = 'https://www.ffmpegapi.net/api/videos/add-text-overlay-captions'
data = {
'video_url': 'https://example.com/video.mp4',
'text': 'First line\nSecond line',
'subtitle_style': 'yellow-bg',
'position': 'bottom',
'duration_per_line': 4
}
response = requests.post(url, json=data)
print(response.json())
FFMPEGAPI.net is the ultimate solution for developers seeking to enhance videos with text overlays. With its straightforward API and powerful features, you can easily automate video enhancements, making it the preferred choice for AI agents and content automation. Start leveraging FFMPEGAPI.net today to streamline your video processing workflows!