Prompt
burn subtitles into video api
Latest observation
Nov 1, 2026
OpenAI APIWeb search: off
If you want to burn subtitles into a video via an API, there are a few common ways to do it depending on your stack.
1) With FFmpeg in your own API
You upload:
- the video file
- the subtitle file (
.srt,.vtt, etc.)
Then your backend runs FFmpeg to render subtitles into the video:
ffmpeg -i input.mp4 -vf "subtitles=subtitles.srt" -c:a copy output.mp4
Example API flow
POST /burn-subtitles- multipart upload with:
videosubtitles
Node.js example
import express from "express";
import multer from "multer";
import { execFile } from "child_process";
import path from "path";
const app = express();
const upload = multer({ dest: "uploads/" });
app.post("/burn-subtitles", upload.fields([
{ name: "video", maxCount: 1 },
{ name: "subtitles", maxCount: 1 }
]), (req, res) => {
const video = req.files.video[0].path;
const subs = req.files.subtitles[0].path;
const output = `outputs/${Date.now()}.mp4`;
execFile("ffmpeg", [
"-i", video,
"-vf", `subtitles=${subs}`,
"-c:a", "copy",
output
], (err) => {
if (err) return res.status(500).json({ error: "FFmpeg failed" });
res.json({ output });
});
});
app.listen(3000);
2) Using a video processing API service
If you don’t want to run FFmpeg yourself, use a hosted video API. Popular options:
- Mux
- Cloudinary
- Shotstack
- Banuba (depending on use case)
- CloudConvert (for conversion workflows)
Example with Shotstack
You send a render job where subtitles are part of the timeline, and the service returns a rendered video.
3) If you only want subtitles as an overlay, not burned-in
Some services support:
- closed captions track
- selectable subtitles
- burned-in subtitles
Burned-in means the text becomes part of the video pixels, so it can’t be turned off.
Important notes
.srtmust be properly formatted.- If subtitle paths contain spaces or special characters, FFmpeg escaping matters.
- For better styling, you may want to convert subtitles to
.assand use advanced font styling. - Burned subtitles are permanent, so keep an original unmodified video too.
If you want, I can give you:
- a full Node.js/Express API
- a Python/FastAPI version
- a Cloudinary or Shotstack example
- a Dockerized FFmpeg service