Sub topic 15
Burned-in captions versus a separate track
This chapter assumes you can already produce a corrected SRT file (see the chapters on transcripts and the SRT format) and have a finished, cut lecture such as lecture_cut.mp4. You should be comfortable running ffmpeg in a terminal. The goal is to choose how the captions reach the viewer and to produce both versions.
The two delivery methods
There are two ways to ship captions with a video.
- Burned-in captions (also called open or hardcoded captions) are drawn into the picture. After export they are ordinary pixels. Every viewer sees them, and nobody can turn them off.
- A separate track (also called closed or soft captions) stores the text as its own stream or file. The player draws it on top of the video and lets the viewer switch it on or off, choose a language, and often adjust its size.
The choice affects accessibility, re-encoding cost, and what you can fix after publishing.
| Property | Burned-in | Separate track |
|---|---|---|
| Viewer can turn off | No | Yes |
| Viewer can resize or restyle | No | Usually, depending on the player |
| Multiple languages | One version of the video per language | One file or stream per language |
| Fixing a typo later | Re-encode the whole video | Replace the text file |
| Re-encodes the video | Yes | No, if you only copy streams |
| Works on any player | Yes | Only where the player supports the format |
| Searchable and readable by software | No | Yes |
How each method works internally
A burned-in caption is rendered by a filter. For every frame, the filter checks which cue is active at that timestamp, draws the text onto the frame, and passes the frame on. Because the frame changes, the video must be re-encoded. That costs time, and each lossy re-encode removes a little quality. The codecs chapter explains why: encoded frames depend on one another, so changing pixels means producing a new encoding.
A separate track never touches the video frames. The container (MP4, MKV, WebM) holds the video stream, the audio stream, and a subtitle stream, each with its own timestamps. The player reads the cues and renders them. This is why -c copy works: the video and audio bytes are copied as they are, and only the container is rewritten.
There are two kinds of separate track:
- Embedded in the container. The captions travel inside the same file. MP4 uses the
mov_textformat. MKV can hold SRT or ASS directly. - A sidecar file. The captions live next to the video as
.srtor.vtt. Web players and course platforms usually accept an uploaded caption file this way. Browsers' HTML5 video element uses WebVTT (.vtt), which is close to SRT with aWEBVTTheader line and dots instead of commas in timestamps.
Choosing between them
In practice, use a separate track for a course platform, a learning management system, or a video host that accepts caption uploads. Accessibility rules and good practice favour viewer control, and a track lets you fix errors without re-exporting. Use burned-in captions when the video will be played in an unknown player, sent as a file, or posted where autoplay is muted and caption tracks are unreliable. Either way, keep the SRT file. It is your source of truth, and you will need it if you later translate or re-burn.
You can also ship both: a burned-in version for sharing and a clean version with a track for your course site. Name the files clearly, for example lecture_burned.mp4 and lecture_soft.mp4.
Burning captions in with ffmpeg
The subtitles filter reads the SRT and draws it onto each frame. The audio is not changed, so it is copied.
ffmpeg -i lecture_cut.mp4 -vf "subtitles=captions.srt" -c:a copy lecture_burned.mp4For MP4 output, ffmpeg re-encodes the video with its default H.264 encoder. To control quality, set the encoder and quality explicitly:
ffmpeg -i lecture_cut.mp4 \
-vf "subtitles=captions.srt:force_style='FontName=Arial,FontSize=24,Outline=2,MarginV=30'" \
-c:v libx264 -crf 18 -preset medium -c:a copy lecture_burned.mp4Notes on this command:
-crf 18gives high visual quality. Higher numbers give smaller files and lower quality.force_styletakes ASS style fields. ffmpeg converts SRT to ASS internally, andFontSizeis measured against a reference height of 288 pixels rather than your real frame height. A value near 24 is readable on 1080p. Adjust it by checking a frame, not by guessing.Outlinedraws a dark border so white text stays readable over bright slides.MarginVlifts the text away from the bottom edge, which matters if the platform overlays its own controls there.- The
subtitlesfilter needs ffmpeg built with libass. If you get an error about an unknown filter, your build lacks it. - Keep the SRT in the current directory. Paths with spaces, colons, or backslashes (common on Windows) need escaping inside filter strings.
Burn captions in after all cuts and zooms are final. The SRT timestamps match the cut video. If you burn captions into a version and later cut again, the timing is wrong and you must start over from the clean edit.
Adding a separate track with ffmpeg
To embed the SRT as a switchable track in an MP4, copy the video and audio and convert only the subtitle stream:
ffmpeg -i lecture_cut.mp4 -i captions.srt -c copy -c:s mov_text lecture_soft.mp4This takes seconds, because nothing is re-encoded. Add a language tag so players label the track properly:
ffmpeg -i lecture_cut.mp4 -i captions.srt \
-map 0:v -map 0:a -map 1:0 \
-c copy -c:s mov_text \
-metadata:s:s:0 language=eng -metadata:s:s:0 title="English" \
lecture_soft.mp4The -map options choose the streams explicitly: video and audio from the first input, and the subtitle from the second. Without them, ffmpeg picks streams by its own rules. -metadata:s:s:0 sets metadata on the first subtitle stream.
For a web page or course platform, a sidecar WebVTT file is often the better choice. ffmpeg converts the format directly:
ffmpeg -i captions.srt captions.vttMany platforms accept the SRT as is, so check the upload requirements first.
Common errors and gotchas
- Captions are out of sync. The SRT was timed against an earlier cut. Regenerate or shift the timings after the last edit. A container with a nonzero start time can also shift a track. Check the video's start timestamp if every cue is off by the same amount.
- The track exists but is not visible. Players differ. Some show embedded
mov_textonly if you choose it in a menu, and some ignore it. Test in the player your viewers will use, not only in your editor. - Styling disappears.
mov_textsupports little styling, and SRT supports almost none. If you need fonts and positions on a soft track, use ASS in MKV, but expect less player support. - Burned-in text is too small on phones. Check the export on a small screen. If the text is not readable there, increase
FontSize. - Text covers important content. Burned-in captions can hide slide content at the bottom of the frame, and you cannot move them afterward. Use
MarginVand review the frames, or use a track so the viewer controls placement. - Quality loss from a second re-encode. Burn from your cleanest cut, not from an already-compressed export. Do not burn in, export, and then cut again.
- Mistaking burned-in captions for accessibility compliance. Open captions help hearing-impaired viewers, but they give screen readers and search nothing to read. A separate text file does.
Verifying the result
Use ffprobe to confirm the streams in a finished file:
ffprobe -hide_banner lecture_soft.mp4The output should list one video stream, one audio stream, and one Subtitle: mov_text stream with the language you set. For the burned-in file, it should list only video and audio, and the captions should be visible in the picture when you play it. Then play both files, scrub to a few random points, and confirm that the text matches the speech at the start, the middle, and the end. Drift that grows over the lecture suggests a frame-rate or timestamp problem.
Exercise
You have a finished lecture and a corrected SRT. The lecture will be uploaded to a course platform that accepts caption files, and a colleague also wants a copy to send by email to students who will play it in unknown players. A typo is later found in the captions. Which delivery method suits each case, and what does fixing the typo involve in each?
Show answer
For the course platform, use a separate track (or upload the SRT or VTT as a sidecar). Fixing the typo means editing the SRT and re-uploading or re-muxing it with -c copy, which takes seconds and does not re-encode the video. For the emailed copy, burn the captions in, since the player may not support tracks. Fixing the typo means correcting the SRT and re-running the burn-in from the clean cut, which re-encodes the entire video. Keep the SRT in both cases.
Exercise
Why does -c copy work when adding a mov_text track but not when burning captions in with -vf "subtitles=captions.srt"?
Show answer
A video filter changes the pixels of each frame, so the frames must be decoded, modified, and encoded again. Stream copy transfers the compressed video bytes unchanged, so it cannot be combined with a video filter. A soft track is a separate stream, so the video can be copied and only the container changes.