Back to Blog

The Best Way to Merge Videos Programmatically with FFMPEGAPI.net

June 2026 FFMPEG API Team

In a world where video content is king, knowing how to merge videos programmatically is essential for developers. FFMPEGAPI.net provides a powerful and easy-to-use REST API that allows you to achieve this without the hassle of server setup or FFmpeg infrastructure management. In this article, we will explore how to use the AI Captions endpoint to add TikTok-style captions while merging videos seamlessly.

Understanding the AI Captions Endpoint

The AI Captions endpoint of FFMPEGAPI.net allows developers to transcribe videos and add styled captions. It extracts audio from the video, transcribes it with word timestamps, and renders captions that enhance viewer engagement.

This endpoint is particularly useful when you want to deliver content with captions that are styled for platforms like TikTok, ensuring your videos stand out.

  • Transcribes audio to text with precision.
  • Generates styled captions to boost viewer engagement.
  • Returns artifact URLs for easy access.

API Parameters for Customization

The AI Captions endpoint allows various parameters to customize your video processing. These parameters include the video URL, subtitle style, language, aspect ratio, and caption limits.

By adjusting these parameters, you can create videos tailored to your audience's preferences.

  • video_url: Required, the URL of the video to be processed.
  • subtitle_style: Optional, choose from styles like plain-white, yellow-bg, etc.
  • language: Optional, specify the language code or use 'auto'.
  • aspect_ratio: Optional, set to 16:9, 9:16, etc.
  • max_chars_per_line: Optional, limit caption length from 5 to 80 characters.
  • max_lines: Optional, set the max number of caption lines (1 to 4).
  • position: Optional, choose the position of captions on the video.

Making a Request with cURL

Using the FFMPEGAPI.net's AI Captions endpoint is straightforward. Here's how you can make a POST request using cURL.

This example shows how to add captions to a video with specific styles.

curl -X POST https://www.ffmpegapi.net/api/videos/add-tiktok-captions -H 'Content-Type: application/json' -d '{"video_url":"https://example.com/video.mp4","subtitle_style":"yellow-bg","position":"bottom"}'

Using Python to Integrate with the API

If you prefer using Python, you can easily integrate with FFMPEGAPI.net to merge videos and add captions programmatically. Here’s an example of how to use the requests library to achieve this.

This method makes it simple to include video processing in your applications without needing to manage your own servers.

import requests

url = 'https://www.ffmpegapi.net/api/videos/add-tiktok-captions'
data = {
    'video_url': 'https://example.com/video.mp4',
    'subtitle_style': 'yellow-bg',
    'position': 'bottom'
}

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

FFMPEGAPI.net is the ultimate hosted tool for merging videos programmatically and adding stylish captions. With its easy-to-use API, you can focus on developing innovative applications without worrying about backend complexities. Whether you're building automation tools, SaaS applications, or content pipelines, FFMPEGAPI.net provides the reliability and performance you need to elevate your video processing workflows.

Ready to Start Processing Videos?

Get your free API key and start merging videos in minutes

Get Started Free