Burn Subtitles into Video
Operator: Abdulla Al Fahad. How tools are built and checked
Soft subtitles, the kind in an SRT file next to a video, only work where the player loads them. Instagram, TikTok, WhatsApp, most slide software and plenty of embedded players ignore them. Hard-coded captions fix that by painting the words into the picture itself. This page takes a video and an SRT, WebVTT or SBV file, lets you set the font, size, colours, outline, background box and position while a preview plays over the footage, and renders a new video with the text baked in. No account and no watermark.
The price of doing it in a browser is time. A web page cannot call a hardware video encoder directly, so the page plays the chosen range through a hidden player, draws every frame onto a canvas with the current cue on top, and records that canvas together with the original sound using MediaRecorder. A 4-minute range takes about 4 minutes, the tab has to stay in front, and the output is a fresh encode rather than a copy of the original frames.
Key features
- Reads SRT, WebVTT and SBV, detected by content, with skipped and empty cues reported
- Live preview on the video that follows playback, seeking and every style change, using the same drawing code as the render
- Five font stacks, bold toggle, size, text colour, outline colour and thickness
- Optional background box per line with its own colour and opacity
- Top, middle or bottom position with a margin, and a maximum line width as a share of the frame
- Subtitle shift in seconds (positive or negative) for files that are a little early or late
- Start and end trim, resolution cap, three quality levels and a choice of MP4 or WebM
- Original sound kept by default; Cancel at any point; a before and after player with a download link
What gets burned in and what is flattened
The subtitle reader is the same one the Subtitle Converter on this site uses. SRT, WebVTT and SBV are detected from their content, not their extension, so a .txt file holding SRT works. Timestamps may use a comma or a dot before the milliseconds, and hours are optional in WebVTT. A block whose end time is not after its start time is skipped and counted, and cues with no text left after cleaning are dropped; both counts are shown after loading. Files up to 5 MB are read, which is far beyond a feature-length film's subtitles.
Formatting is deliberately flattened. Tags such as <i>, <b>, <font> and WebVTT voice and class tags are removed, as are {\an8}-style overrides, and the text is drawn in the single style you choose. WebVTT cue settings (line, position, align) and SSA or ASS styling are not applied, so a cue meant for the top of the frame appears wherever you set Position. Two cues that overlap in time are shown together, stacked in start order, rather than one hiding the other.
Sizes are expressed against the picture height so the preview and the render match at any resolution. Font size runs from 2% to 12% of the height (default 5%), the outline from 0 to 25% of the font size (default 12%), the margin from 0 to 20% of the height, and the widest line from 40% to 100% of the width. On a 1280 × 720 render, 5% is a 36 px font, a 12% outline is 4.3 px of stroke outside each letter, and an 88% line limit is 1,126 px.
Fonts are system font stacks (sans-serif, Georgia-style serif, monospace, Trebuchet or Verdana, and Impact), not uploaded files. A stack resolves to whatever your own computer has, so the same project on Windows and macOS can pick slightly different letterforms. Text without spaces, such as Chinese or Japanese, wraps between characters; right-to-left scripts and complex shaping depend on the canvas text support in your browser and the fonts installed.
The output size is the source size or a cap on the shorter side (1080, 720, 480 or 360 px), never enlarged, with both sides rounded to even numbers. Burned-in text is sharp edges on flat colour, which a compressor handles worst, so choose High if the lettering looks soft on the result; Smallest tends to smear thin outlines. The container is WebM in Chrome and Edge and MP4 elsewhere when the browser can write it, with a fallback to whichever it supports, and the result panel reports the bitrate the recorder actually achieved.
How it works
For every frame the renderer draws the video onto the canvas, then asks which cues are showing. A cue shows while start + shift <= t < end + shift, using the media time of the frame just presented, so a cue from 00:00:05,200 to 00:00:08,000 covers the frames from 5.2 s up to, but not including, 8.0 s. At 30 frames per second the edges are accurate to about 33 ms.
Text is wrapped greedily. Words are added to a line while the measured width stays under the limit; a word that cannot fit alone is split between characters. Each line is then drawn centred. The outline is drawn first as a round-joined stroke twice as wide as the outline you chose, because a stroke is centred on the letter edge and half of it lands under the fill, and the colour fill goes on top. With the box on, each line gets a rectangle behind it that is the line's width plus 0.4 of the font size on each side, so short lines get short boxes.
The block of lines is placed from the position setting: its first line starts at the margin for Top, its last line ends at the margin for Bottom, and Middle centres it. The block is then pulled back inside the frame, so a four-line cue with a large margin cannot run off the bottom of the picture.
Common use cases
- Putting captions on a vertical clip for Instagram or TikTok, where an uploaded SRT file is not an option and the platform's own captions cannot be styled
- Sending a lecture recording to a colleague whose player ignores subtitle tracks, with the captions guaranteed to show
- Adding translated subtitles from a freelance translator to a product demo before it goes in a slide deck
- Making an accessible copy of a training video for a corporate intranet that only plays plain MP4 or WebM files
- Fixing a subtitle file that is half a second late by shifting it, then checking the sync in the preview before committing to a render
How to use this tool
- Drop the video onto the first box. The preview and its size and length appear.
- Drop an .srt, .vtt or .sbv file onto the second box. The preview jumps to the first cue and the cue count appears.
- Play or scrub the preview and adjust the style until the text reads well on the busiest part of the picture. Use Jump to next cue to check long cues.
- If the words come too early or late, type a shift in seconds, such as 0.5 or -1.2, and watch the preview move.
- Set the range, resolution, quality and whether to keep the sound, then click Burn in subtitles.
- Keep the tab in front until the progress bar finishes, then play the result and download it.
Example
A 1280 × 720 clip and this SRT, with the default style and a shift of +0.5 s
1
00:00:05,200 --> 00:00:08,000
Welcome back to the channel.
2
00:00:08,400 --> 00:00:11,000
<i>Today we are looking at
how subtitles are burned in.</i>What is drawn
Cue 1 appears from 5.7 s to 8.5 s in a 36 px bold sans-serif font (5% of 720), white with a 4.3 px black outline, bottom aligned with a 43 px margin (6% of 720).
Cue 2 appears from 8.9 s to 11.5 s on two lines; the <i> tags are removed, so it is upright.
Rendered at Balanced: 1,659 kbit/s video + 128 kbit/s sound, about 1.1 MB for every 5 seconds.Tips for best results
- Judge the style on the brightest and darkest scenes in the video, not the first frame. White text with a black outline survives both; a pale box with white text does not.
- Use the background box at 50 to 70% opacity for footage with a lot of detail, such as screen recordings, where an outline alone gets lost in the texture.
- Keep Bottom, but raise the margin to about 10% for video that will be posted to a feed. Many apps cover the lowest part of the frame with their own buttons.
- Render a short range first. Set the start and end around a few cues, check the file in the app it is headed for, then render the whole thing once the look is settled.
- When a cue wraps awkwardly, narrow the widest line to about 70% rather than editing the subtitle file; the page rewraps every cue the same way.
Common pitfalls
The captions become part of the picture. They cannot be switched off or edited afterwards, so keep the original video and the subtitle file.
The output is a new encode. Expect a small quality loss against the original, and a file that can be larger or smaller than it depending on the quality level and the footage. The page shows the size it actually produced.
A range longer than 60 minutes is refused. If you leave the tab mid-render the recording pauses, so check the subtitle timing on the preview first and avoid redoing a long render for a half-second shift.
Only the audio track the browser plays by default is recorded, and chapters, extra subtitle tracks and metadata are not carried across.
Colour and typography are the same for every cue. If you need one speaker in yellow or a different position for one line, that needs a desktop subtitle editor.
A video the browser cannot decode will not open. HEVC (H.265) from recent iPhones is the usual culprit; Safari plays it, other browsers may not.
Frequently asked questions
Does my video or subtitle file get uploaded?
No. Both files are read by your browser through local object URLs, the frames are drawn and encoded in the tab, and the result stays in memory until you download it. The page has no code that sends either file to a server.
Which subtitle formats work?
SRT, WebVTT and SBV. The format is detected from the content. SSA, ASS and embedded subtitle tracks inside an MKV or MP4 are not read; extract them to SRT first, or use the Subtitle Converter on this site to convert.
Why is rendering as slow as the video?
The canvas can only be recorded as frames are produced, and the video plays at normal speed while it is captured. A 10-minute range takes about 10 minutes, and the tab must stay visible because browsers throttle hidden tabs.
Can I use my own font?
Not by upload. You choose from five system font stacks, which resolve to fonts already installed on your computer. If a font from a stack is missing, the browser substitutes the next one.
The subtitles are out of sync. Can I fix that here?
A single shift can, and a file that is uniformly early or late is the common case. Type a positive number of seconds to show every cue later or a negative one to show them earlier. A file that drifts gradually, because it was made for a different frame rate, needs retiming in a subtitle editor first.
Will the output be MP4 or WebM?
Automatic picks WebM in Chrome and Edge and MP4 in other browsers. You can ask for either; if the browser cannot write the one you chose, it falls back and the line under the settings says which format you will get.