diff --git a/docs.json b/docs.json index 8ac9da4..1603d41 100644 --- a/docs.json +++ b/docs.json @@ -60,7 +60,8 @@ "group": "Reference", "pages": [ "job-types/raw-ffmpeg", - "job-types/captions-animate" + "job-types/captions-animate", + "job-types/caption-burn" ] }, { diff --git a/job-types/caption-burn.mdx b/job-types/caption-burn.mdx new file mode 100644 index 0000000..c850580 --- /dev/null +++ b/job-types/caption-burn.mdx @@ -0,0 +1,167 @@ +--- +title: "caption.burn" +description: "Permanently burn styled subtitles into a video from an SRT, VTT, or ASS file, or auto-transcribe in any language. Web-hex styling, deterministic sizing." +icon: "closed-captioning" +tag: "Live" +--- + + +**Live.** Production-ready, available on all plans. + + +Burn subtitles permanently into a video. Provide an SRT, VTT, or ASS file as the `subtitles` input, or omit it to auto-transcribe the audio. Style the text with web-hex colors, an outline, a background box, and a position. This is the static counterpart to [`captions.animate`](/job-types/captions-animate), which renders per-word animated captions. + + +**Timeout:** 600 s max (plan-capped) · **Provider:** triggerdev · **Accepts:** video + + +## Request + + + +```bash cURL +curl -X POST https://api.rendobar.com/jobs \ + -H "Authorization: Bearer rb_live_YOUR_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "type": "caption.burn", + "inputs": { + "source": "https://cdn.rendobar.com/assets/examples/sample.mp4", + "subtitles": "https://cdn.rendobar.com/assets/examples/sample.srt" + }, + "params": { "fontFamily": "Inter", "fontSize": 48, "boxEnabled": true } + }' +``` + +```javascript JavaScript +const res = await fetch("https://api.rendobar.com/jobs", { + method: "POST", + headers: { + "Authorization": "Bearer rb_live_YOUR_KEY", + "Content-Type": "application/json", + }, + body: JSON.stringify({ + type: "caption.burn", + inputs: { + source: "https://cdn.rendobar.com/assets/examples/sample.mp4", + subtitles: "https://cdn.rendobar.com/assets/examples/sample.srt", + }, + params: { fontFamily: "Inter", fontSize: 48, boxEnabled: true }, + }), +}); +const { data } = await res.json(); +``` + +```python Python +import requests +res = requests.post( + "https://api.rendobar.com/jobs", + headers={"Authorization": "Bearer rb_live_YOUR_KEY"}, + json={ + "type": "caption.burn", + "inputs": { + "source": "https://cdn.rendobar.com/assets/examples/sample.mp4", + "subtitles": "https://cdn.rendobar.com/assets/examples/sample.srt", + }, + "params": {"fontFamily": "Inter", "fontSize": 48, "boxEnabled": True}, + }, +) +``` + + + +Omit `subtitles` to auto-transcribe. The spoken language is detected by default (`language: "auto"`); pass an ISO-639-1 code to skip detection. + +## Inputs + + + URL of the source video to caption. + + + + URL of an SRT, VTT, or ASS subtitle file. A provided ASS file is burned as-is, preserving its own styling. Omit to auto-transcribe the audio. + + +## Parameters + + + Spoken language for the auto-transcribe path, as an ISO-639-1 code (e.g. `en`, `es`, `ja`) or `auto` to detect. English uses a faster model; everything else routes to multilingual transcription. Ignored when a subtitle file is provided. + + + + Font family. Must resolve to a font available to the renderer. + + + + Font size in output pixels. Range 8–400. + + + + Text fill color as web hex (`#RRGGBB` or `#AARRGGBB`, alpha first). + + + + Render the text bold. + + + + Render the text italic. + + + + Outline (stroke) color as web hex. + + + + Outline thickness in pixels. Range 0–20. + + + + Drop-shadow depth in pixels. Range 0–20. `0` disables the shadow. + + + + Draw a filled background box behind the text (the accessibility "subtitle bar"). + + + + Background box color as web hex. Applies when `boxEnabled` is `true`. + + + + Background box opacity, `0` (transparent) to `1` (opaque). + + + + Vertical placement. One of `bottom`, `center`, `top`. + + + + Horizontal alignment. One of `left`, `center`, `right`. + + + + Vertical margin in pixels. Range 0–2000. + + + + Horizontal margin in pixels. Range 0–2000. Also bounds the line-wrap width. + + + + Maximum characters per line on the auto-transcribe path. Range 10–80. + + +## Response + +```json +{ "data": { "id": "job_abc123", "status": "dispatched" } } +``` + +Poll `GET /jobs/{id}` until `status: "complete"`, then read `outputUrl` (signed, 1-hour TTL). + +## See also + +- [captions.animate](/job-types/captions-animate) — per-word animated captions +- [Job lifecycle](/concepts/job-lifecycle) — how a job moves from `dispatched` to `complete` +- [Credits and billing](/concepts/credits) — how usage is charged