Skip to content

Subtitle Creation and Proofreading: SRT from Generation to Burning In ​

In the previous lesson you got your voiceover. This lesson takes about 7 minutes and walks through AI video subtitles end to end—from generation and proofreading to burning in. No need to type the timeline by hand: edge-tts generates an SRT file at the same time it synthesizes the speech.

What You'll Be Able to Do After This Lesson ​

  • Get a timeline-aligned SRT subtitle file while generating the voiceover with edge-tts
  • Understand the SRT structure and be able to edit text and timelines by hand
  • Complete subtitle proofreading with the three-point checklist (typos, line-break timing, line length)
  • Burn subtitles into the frame with a single FFmpeg command

Where You Are Now ​

  • "The voiceover is done, but the moment I think about typing out the subtitle timeline line by line, I lose all motivation."
  • "There are tons of subtitle tools online—I installed three and none of them worked smoothly."
  • "I finally got the subtitles burned in, and the Chinese characters all turned into boxes."

When to Use This Technique ​

When you need to: add synchronized subtitles to a practice video's voiceover, and the voiceover was generated with edge-tts.

And you don't want to: type out the timeline line by line, or buy paid subtitle software just for this.

🎒 Before You Start ​

Core Idea ​

When edge-tts synthesizes speech, the server returns the time boundaries of each text segment. --write-subtitles writes these boundaries directly into an SRT, so the subtitles are naturally aligned with the speech—you only need to proofread, not type the timeline yourself.

StageToolOutput
Generationedge-tts --write-subtitlesSRT aligned with the audio
ProofreadingAny text editorCorrected SRT (UTF-8)
Burning InFFmpeg subtitles filtermp4 with hard subtitles

SRT is a plain-text format where each subtitle block has four parts (general format notes for this course):

text
1
00:00:00,000 --> 00:00:02,500
Welcome to the AI short drama class.

2
00:00:02,500 --> 00:00:05,000
Today we're making subtitles.

The timeline format is fixed as 时:分:秒,毫秒 --> 时:分:秒,毫秒 (HH:MM:SS,mmm --> HH:MM:SS,mmm), with milliseconds separated by a comma, and a blank line between blocks.

Follow Along ​

Step 1: Export the AI Video Subtitle File Alongside Voiceover Generation ​

Why: Typing the timeline separately is the most time-consuming part of subtitle creation, but edge-tts can produce aligned subtitles at the same time it produces the audio, eliminating that step.

Add --write-subtitles to the voiceover command from the previous lesson:

bash
edge-tts --text "欢迎来到 AI 短剧课堂。" --write-media voice.mp3 --write-subtitles voice.srt

You should see: After the command finishes, two files appear in the directory: voice.mp3 and voice.srt.

  • Quick check: Open voice.srt in a text editor and confirm you can see the three elements—sequence number, timeline, and text

💡 Already generated the voiceover in the previous lesson?

Just add --write-subtitles voice.srt to the original command and run it again to get the subtitle file.

Step 2: Proofread the Subtitles—The Three-Point Checklist ​

Why: The machine breaks lines based on the boundaries returned by the server, which may not match Chinese reading rhythm; homophone typos are also the easiest for viewers to spot.

Open voice.srt in any text editor and go through the three checks entry by entry:

  1. Typos: Read through each entry to check homophones (e.g., "zai/zai", "yi/yi")
  2. Line-break timing: Don't break a line in the middle of a word; subtitles appearing too early or disappearing too late will pull viewers out of the story
  3. Line length: If a line is too long for viewers to finish reading, split it into two lines or trim the text

After editing, save in UTF-8 encoding. If a line itself is too long and no break reads smoothly, revisit "Trimming Dialogue: Subtract Before Recording the Voiceover".

You should see: Every subtitle entry reads smoothly, has no typos, and each line can be read at a glance.

  • Quick check: Go through all three checks, and the file is saved as UTF-8

Step 3: Burn the Subtitles into the Frame with FFmpeg ​

Why: Burning in (hard subtitles) renders the subtitles into the frame itself, so they display on any platform and any player, without depending on viewers loading external subtitle files.

bash
ffmpeg -i shot.mp4 -vf "subtitles=voice.srt" -c:a copy subtitled.mp4

You should see: After FFmpeg finishes processing, it outputs subtitled.mp4; when played, subtitles appear at the bottom of the frame, aligned with the speech.

  • Quick check: Play subtitled.mp4—subtitles are in sync with the voiceover, no garbled text

Checkpoint ✅ ​

  • voice.srt and voice.mp3 are generated by the same command, with aligned timelines
  • The SRT has been proofread with the three-point checklist and saved as UTF-8
  • The burned-in video displays subtitles correctly, with no garbled text
  • The subtitle timeline matches the frame content

Pitfall Warnings ​

❌ Chinese characters turn into boxes or garbled text after burning in ​

Cause: The SRT file is not encoded in UTF-8, or the system lacks an available Chinese font.

Correct approach: Re-save the SRT as UTF-8 before burning in. If the SRT comes from another tool and is genuinely in a different encoding, declare the encoding with the subtitles filter's charenc option (this option is only useful for non-UTF-8 files). If Chinese fonts are missing, put the font files together in one directory and point the filter to it with the fontsdir option; fonts in that directory become available in addition to system fonts.

❌ The subtitle timeline doesn't match the frame ​

Cause: The SRT timings are based on the start of the voiceover audio, while editing and splicing shift the frame's start point.

Correct approach: Do the burning in after editing is finalized, based on the final video's timeline—come back and run Step 3 after finishing the edit in the next lesson.

❌ Breaking the timeline format while editing by hand ​

Cause: -->, the comma, or the number of time digits was accidentally altered, invalidating the entire SRT block.

Correct approach: Only touch the text lines; when adjusting times, strictly preserve the 00:00:02,500 --> 00:00:05,000 format.

❌ FFmpeg reports that the subtitles filter cannot be found ​

Cause: the FFmpeg build in use was not compiled with libass enabled—the subtitles filter requires a --enable-libass build.

Correct approach: switch to an FFmpeg version compiled with libass enabled, then rerun the burn-in command.

Advanced tips (optional) ​

Customizing subtitle styles: force_style ​

The subtitles filter first converts SRT to ASS before rendering, and the default style may not be to your taste. force_style accepts ASS style syntax in KEY=VALUE form, with multiple entries separated by commas. The example from the official FFmpeg manual—making the subtitles 80% transparent blue DejaVu Serif:

bash
ffmpeg -i shot.mp4 -vf "subtitles=voice.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&HCCFF0000'" -c:a copy subtitled.mp4

Replace Fontname with the name of a Chinese font already installed on your system; other style parameters are likewise appended as comma-separated KEY=VALUE entries.

Lesson summary ​

  • ✅ edge-tts --write-subtitles: generate voiceover and AI video subtitles in one pass, no manual timing needed
  • ✅ Four parts of the SRT structure: sequence number, timeline, text, blank line
  • ✅ Three-check list: typos, line-break timing, line length
  • ✅ FFmpeg subtitles filter: burn in hard subtitles with a single command
Field / OptionRecommended valueDescription
--write-mediavoice.mp3Voiceover audio
--write-subtitlesvoice.srtSRT subtitles generated in sync
subtitles filtersubtitles=voice.srtBurn subtitles into the picture
charencSet only for non-UTF-8Declare the subtitle encoding
force_styleASS styles in KEY=VALUE form, comma-separatedOverride the default subtitle style
fontsdirPath to a font directoryFonts in the directory are available in addition to system fonts

Next lesson preview ​

With the subtitles in place, the next lesson "Editing and volume checking: assembling your first finished video with FFmpeg" stitches the shots and voiceover into a complete video. You will learn:

  • Using trim to trim excess head and tail from each shot
  • Using concat to join multiple shot segments into one
  • Using loudnorm to normalize loudness across the whole video

After editing, remember to come back and run the step 3 burn-in on the finished video, then move on to 《Export and pre-publish check: against YouTube's official specs》.

Appendix: source code references ​

Click to expand and view source locations

Last updated: 2026-11-07

FactFileLocation
edge-tts installation, basic usage, and --write-subtitlesdocs/raw-edge-tts-readme.md:9-13, :21
Server-side boundary metadata and progress bar behaviordocs/raw-edge-tts-readme.md:71
subtitles filter (libass) and the options filename / charenc / force_style / fontsdirdocs/ffmpeg-filters.md:17299-17343
subtitles=sub.srt is equivalent to filename=sub.srt; force_style official exampledocs/ffmpeg-filters.md:17344-17367

The SRT timeline format is the general format description used throughout this course; the three-check proofreading list (typos / line-break timing / line length) is a course teaching template.

gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.