Generate subtitles automatically
Speech Revolutions can hand you finished subtitle files, not just raw text. Set output_type to "srt" or "vtt" and the transcript comes back as a ready-to-ship caption file — correctly numbered, time-cued, and line-wrapped. No post-processing of word timestamps required. This tutorial covers picking the format, saving the file, and the choice between shipping it as a sidecar or burning it into the video.
SRT vs VTT
Both are supported values of output_type (alongside txt, json, docx, and pdf). They differ only in where they're used:
srt(SubRip) — the universal default. Accepted by virtually every video player, editor, and platform (YouTube, Premiere, VLC). Reach for this unless you specifically need VTT.vtt(WebVTT) — the web-native format for the HTML5<track>element. Use it when captions are served to a browser<video>player.
See the Output formats & subtitles guide for the full list of formats and what each returns.
Generate and save the file
Pass the format as output_type, then call result.save(). It writes the raw content to disk and appends the correct extension if your path has none — save("captions") with output_type="srt" writes captions.srt — and returns the path it wrote.
from speechrevolutions import SpeechRevolutions
client = SpeechRevolutions() # reads SPEECHREVOLUTIONS_API_KEY
result = client.transcribe(
"talk.mp4", # audio or video: local path, URL, bytes, or file object
output_type="srt", # ask Speech Revolutions for SubRip captions (use "vtt" for WebVTT)
)
path = result.save("captions") # writes captions.srt; returns the path
print(f"Wrote {path}")Timestamps are already handled
When you ask for srt or vtt, Speech Revolutions does the cueing for you — you don't need to request word_timestamps or assemble cues from .words yourself. The file is ready to load into a player as-is.
Sidecar vs burned-in
Once you have the file, there are two ways to get captions in front of a viewer, and the right one depends on where the video plays.
| Approach | What it is | Best when |
|---|---|---|
| Sidecar | Ship the .srt/.vtt as a separate file alongside the video; the player overlays it at playback. | You control the player (a web <video>, a streaming platform, VLC). Viewers can toggle captions on/off and you can serve multiple languages. |
| Burned-in | Render the captions permanently into the video's pixels, so they're part of the picture. | The destination has no caption support or you can't trust it to — social autoplay clips, embedded GIFs, downloads. Always visible; not toggleable. |
Sidecar is the default and needs nothing beyond the saved file. For a browser player, point a <track> at the VTT file:
<video controls>
<source src="talk.mp4" type="video/mp4" />
<track src="captions.vtt" kind="subtitles" srclang="en" label="English" default />
</video>Burning in happens outside Speech Revolutions — Speech Revolutions produces the subtitle file; a video tool renders it into the frames. The common tool is ffmpeg, which reads your saved .srt:
# ffmpeg is third-party tooling, not part of Speech Revolutions — shown for completeness.
ffmpeg -i talk.mp4 -vf "subtitles=captions.srt" talk-captioned.mp4Which should I ship?
Prefer sidecar whenever the player supports it — it keeps captions accessible, toggleable, translatable, and re-editable without re-encoding the video. Reach for burned-in only when the playback surface won't render a separate track.
That's subtitles end to end: one output_type, one save(), and a delivery choice. To generate captions from an upload with a live progress bar, combine this with the meeting-app tutorial; for the full format reference see Output formats & subtitles.