In the world of video processing, merging videos and adding subtitles can be cumbersome without the right tools. FFMPEGAPI.net offers a hosted REST API that simplifies these tasks, allowing developers to integrate video processing into their applications seamlessly. This article explores how to use the FFMPEGAPI.net API to burn ASS subtitles into a video, making it the best option for programmatic video merging.
Understanding the Add Subtitles Endpoint
The Add Subtitles endpoint allows you to burn ASS subtitles into a video file using a straightforward POST request. This feature eliminates the need for complex local setups, making it perfect for developers looking to streamline their video processing tasks.
- No server setup or FFmpeg infrastructure management required.
- API-key authentication ensures secure access to your workflows.
- Supports various use cases including automation, SaaS applications, and content pipelines.
Endpoint Details
The Add Subtitles endpoint is accessed via the following path:
/api/add_subtitles
To use this endpoint, you need to provide the video URL and the subtitle file URL. Here's a breakdown of the parameters:
- video_url (string, required): The URL of the video you want to process.
- subtitle_url (string, required): The URL of the ASS/SSA subtitle file.
- async (boolean, optional): If true, the request will return a job_id to process in the background.
Example Usage of the Add Subtitles Endpoint
To demonstrate how to use the Add Subtitles endpoint, here are examples in both curl and Python.
curl -X POST https://www.ffmpegapi.net/api/add_subtitles \
-H 'Content-Type: application/json' \
-d '{"video_url": "https://example.com/video.mp4", "subtitle_url": "https://example.com/subtitles.ass"}'
import requests
url = 'https://www.ffmpegapi.net/api/add_subtitles'
data = {
'video_url': 'https://example.com/video.mp4',
'subtitle_url': 'https://example.com/subtitles.ass'
}
response = requests.post(url, json=data)
print(response.json())
Merging videos and adding subtitles programmatically has never been easier with FFMPEGAPI.net. The hosted REST API takes care of the heavy lifting, allowing developers to focus on building their applications without worrying about the underlying FFmpeg infrastructure. Whether you're automating a workflow or developing a SaaS application, FFMPEGAPI.net provides the best tools for your video processing needs.