SRT File - File Format Docs

What is an SRT file?

SRT (SubRip file format) is a simple subtitle file saved in the SubRip file format with the .srt extension. It contains a sequential number of subtitles, start and end timestamps, and subtitle text. SRT files make it possible to add subtitles to video content after it is produced.

SRT file Structure

Each subtitle has four parts in the SRT file.

  1. A numeric counter indicating the number or position of the subtitle.
  2. Start and end time of the subtitle separated by –> characters
  3. Subtitle text in one or more lines.
  4. A blank line indicating the end of the subtitle.

Example of SRT

1 00:05:00,400 --> 00:05:15,300 This is an example of a subtitle. 2 00:05:16,400 --> 00:05:25,300 This is an example of a subtitle - 2nd subtitle.

To specify the time hours:minutes:seconds,milliseconds (00:00:00,000) format is used.

Formatting of SRT files

The formatting of SRT files is derived from HTML tags. The formatting tags for the SRT file are listed below.

EffectTags
Bold<b>…</b> or {b}…{/b}
Italic<i>…</i> or {i}…{/i}
Underline<u>…</u> or {u}…{/u}
Font Color<font color=“white”>…</font>
Line Position{\a3} (indicates that the text should start appearing on line 3)

SubRip Software

SubRip is a free software program that runs on Windows. It extracts subtitles and their timings from different video formats and saves the subtitles in SRT format. SubRip uses optical character recognition to extract subtitles from live video, other video files, and DVDs.

How SRT files work?

Basic Structure of an SRT File

Each subtitle entry includes:

  1. Sequence number
  2. Timecodes for when the subtitle appears and disappears
  3. Subtitle text

Example:

1 00:00:01,000 --> 00:00:04,000 Hello, how are you? 2 00:00:05,000 --> 00:00:07,000 I'm good, thanks!
  • Time Format: hours:minutes:seconds,milliseconds
  • --> separates the start time and end time

How It Works With Video

  • The media player reads the SRT file alongside the video file.
  • When the playback time matches a timestamp in the SRT, the corresponding subtitle text is shown on screen.
  • SRT files are usually named exactly the same as the video (except the extension) to sync automatically:
    • movie.mp4
    • movie.srt

How to Use or Edit SRT Files

  • Edit: With any text editor (Notepad, VS Code, etc.)
  • Create: With subtitle editors like Aegisub or Subtitle Edit
  • Play with Video: Use players like VLC, MPC-HC, or PotPlayer

References

  • SRT - Wikipedia

Từ khóa » File Srt Phụ đề