FFMPEG API Guide

How do I generate AI video captions with an API?

Generate TikTok-style word-by-word captions from video URLs with transcription and Remotion rendering.

AI Captions

Extracts audio, transcribes it with word timestamps, and renders styled captions into a video. Also returns caption artifact URLs when available.

Endpoint: POST /api/videos/add-tiktok-captions

Authentication: send X-API-Key: your_api_key_here.

curl Example

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

Request Body

{
  "position": "bottom",
  "subtitle_style": "yellow-bg",
  "video_url": "https://example.com/video.mp4"
}

Success Response

{
  "captions_json_url": "https://ffmpegapi.net/api/storage/auto-captions/captions_abc123.json",
  "download_url": "https://ffmpegapi.net/api/storage/auto-captions/video_abc123.mp4",
  "message": "Video with auto-generated TikTok captions rendered successfully",
  "srt_url": "https://ffmpegapi.net/api/storage/auto-captions/captions_abc123.srt",
  "success": true,
  "vtt_url": "https://ffmpegapi.net/api/storage/auto-captions/captions_abc123.vtt",
  "word_count": 142
}

Use From AI Agents

Agents can call this workflow from REST using the OpenAPI spec or from the hosted MCP server at https://mcp.ffmpegapi.net/mcp. Keep API keys in request headers, not tool arguments.

FAQ

FFMPEG API exposes POST /api/videos/add-tiktok-captions to transcribe video audio and render animated captioned video outputs.

Use async: true for larger media, caption rendering, or jobs likely to exceed a normal HTTP timeout. Poll job status until completion.