Back to Blog

The Best Way to Merge Videos Programmatically Using FFMPEGAPI.net

June 2026 FFMPEG API Team

Merging videos programmatically is a common requirement for developers working on applications that involve media processing. With FFMPEGAPI.net, you can seamlessly integrate video merging and captioning features into your applications without worrying about backend infrastructure. In this article, we will explore how to use FFMPEGAPI.net's AI Captions endpoint to enhance your videos with styled captions.

Understanding the AI Captions Endpoint

The AI Captions endpoint allows you to transcribe and render TikTok-style captions onto your videos. This feature is particularly useful for content creators looking to enhance engagement and accessibility. With just a POST request, you can process a video URL and receive a new video with captions embedded, complete with word timestamps and style options.

  • Transcribes audio from the video.
  • Renders styled captions into the video.
  • Returns URLs for the generated caption artifacts.

Making a Request to the AI Captions Endpoint

To utilize the AI Captions feature, you need to make a POST request to the following endpoint: `/api/videos/add-tiktok-captions`. You'll need to provide a video URL along with optional parameters for customization like `subtitle_style`, `language`, `aspect_ratio`, and more.

  • Endpoint: POST /api/videos/add-tiktok-captions
  • Content Type: application/json
  • Required parameter: video_url
import requests

url = 'https://ffmpegapi.net/api/videos/add-tiktok-captions'
data = {
    'video_url': 'https://example.com/video.mp4',
    'subtitle_style': 'yellow-bg',
    'position': 'bottom'
}
headers = {'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json'}

response = requests.post(url, json=data, headers=headers)
print(response.json())

Customizing Your Captions

You can customize the appearance and behavior of captions by adjusting the optional parameters. These include `subtitle_style`, `language`, `aspect_ratio`, `max_chars_per_line`, and `max_lines`. This flexibility allows you to tailor the captions to fit your application's needs.

  • Subtitle styles: plain-white, yellow-bg, pink-bg, blue-bg, red-bg.
  • Language options: specify language code or use 'auto'.
  • Aspect ratios: choose between 16:9, 9:16, 4:3, or 3:4.

FFMPEGAPI.net provides developers with a robust hosted solution for programmatically merging videos and adding captions. By leveraging the AI Captions endpoint, you can enhance video content effortlessly, allowing you to focus on building engaging applications without the hassle of managing complex FFmpeg infrastructure. Start using FFMPEGAPI.net today to streamline your video processing workflows!

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free