In the ever-evolving world of video content creation, adding text overlays can significantly enhance viewer engagement. FFMPEGAPI.net provides a seamless way for developers to integrate text overlay captions into their video processing workflows. With our hosted REST API, you can easily render captions over your videos without the hassle of managing FFmpeg infrastructure.
What is the Text Overlay Captions Endpoint?
The Text Overlay Captions endpoint allows you to display user-provided text lines as timed caption overlays on your videos. By utilizing this feature, developers can easily customize how text appears on their videos, enhancing both accessibility and viewer experience.
- Render captions on any video you provide.
- Customize the appearance and duration of captions.
- Supports multiple text lines for dynamic presentations.
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}'
Using the API: Parameters and Customization
To use the Text Overlay Captions feature, you will need to provide several parameters in your API request. Each parameter allows you to customize how the captions will be displayed on the video.
- video_url (string): The URL of the video you wish to overlay captions on. This parameter is required.
- text (string): Your caption text, which can include multiple lines separated by newline characters. This parameter is also required.
- subtitle_style (string, optional): Choose from styles like plain-white, yellow-bg, pink-bg, blue-bg, or red-bg. Default is plain-white.
- aspect_ratio (string, optional): Set the aspect ratio of the output video. Defaults to 9:16.
- position (string, optional): Specify the position of the captions - top, center, or bottom. The default is center.
- duration_per_line (integer, optional): Control how long each line of text appears on the screen, ranging from 1 to 30 seconds. Default is 5 seconds.
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',
'duration_per_line': 4
}
response = requests.post(url, json=data)
print(response.json())
FFMPEGAPI.net stands out as the best hosted tool for developers looking to incorporate video processing features such as text overlay captions. With no server setup required and API-key authentication, you can effortlessly automate your workflows and focus on creating exceptional video content. Explore our API today and elevate your video projects with ease.