C.W.K.
Stream
Lesson 01 of 07 · published

Subtitle Formats — SRT, ASS, WebVTT

~10 min · srt, ass, webvtt, subtitles

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Three formats to know

  • SRT (SubRip) — the universal format. Plain text, simple. No styling. Almost every player supports it.
  • ASS (Advanced SubStation Alpha) — rich styling: fonts, colors, positions, animations. The format anime fansubs use.
  • WebVTT (.vtt) — the HTML5 standard. Required by YouTube/Vimeo HLS streams and the <track> element. Subset of ASS plus styling cues.

When to use which

Quick captions for offline files: SRT. Web video / streaming: WebVTT. Anything where you want styled karaoke or precise positioning: ASS. The good news: FFmpeg can convert between all three.

Code

Convert between subtitle formats·bash
# SRT → WebVTT
ffmpeg -i captions.srt captions.vtt

# WebVTT → SRT
ffmpeg -i captions.vtt captions.srt

# ASS → SRT (loses all styling — accept the loss)
ffmpeg -i fancy.ass plain.srt

# Check what subtitle codec your file uses
ffprobe -v error -select_streams s -show_entries stream=codec_name input.mkv
SRT format example·text
1
00:00:00,000 --> 00:00:03,500
Hello world

2
00:00:04,000 --> 00:00:07,000
This is line two
It can have multiple lines per cue
WebVTT format example·text
WEBVTT

00:00:00.000 --> 00:00:03.500
Hello world

00:00:04.000 --> 00:00:07.000 line:90% align:center
<v Pippa>This is line two
With VTT styling cues</v>

External links

Exercise

Take an SRT file (download a public-domain caption file or write 5 cues yourself). Convert it to WebVTT. Open both in a text editor and note the differences in punctuation and structure. Bonus: validate UTF-8 with file + iconv.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.