VOOZH about

URL: https://www.geeksforgeeks.org/techtips/how-to-create-an-srt-file-on-ubuntu/

⇱ How to create an SRT file on Ubuntu? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to create an SRT file on Ubuntu?

Last Updated : 23 Jul, 2025

Creating an SRT file on Ubuntu is a straightforward process that allows you to add subtitles to your videos. SRT file creation on Ubuntu involves using text editors or specialized software to generate and format subtitle files in the SRT format. This guide will walk you through how to create an SRT file on Ubuntu, including tips for using SRT file editors on Ubuntu and ensuring your subtitles are properly formatted.

Understanding SRT Format

SRT i.e. Subtitle, has a plain text file that includes a specific structure:

  • The text of the subtitles is in sequence.
  • The start and end timecodes are in " hh: mm: ss" format.
  • SRT files don't contain video or audio.

Creating an SRT file

There are many ways to create a SRT file on Ubuntu. Like using a text editor, subtitle editing software, command line tools, python script, etc. But in this article, we're going to see how to create a ' srt ' file using command line tools or terminal edit with gedit, Nano, and Vim.

Creating an SRT file using Gedit

Gedit is a text editor designed for the desktop environment. For creating an SRT file using gedit, Follow the steps provided below.

  1. Open the terminal (" Ctrl + Alt + T ")
  2. Type ' gedit ' and press ' Enter ' to open the Gedit text editor on your PC.
  1. Initiate the creation of the subtitles in Gedit by following the SRT format.
  2. And remember to separate each block with a blank line.
  1. Click on ' File ' and select ' Save As '.
  2. Enter a filename that you want to give with a .srt extension (e.g., subtitles.srt).
  3. Choose the location and click Save.

Creating an SRT File Using Terminal Editors

Terminal editor, also known as the console text editor, is a type of text editor that operates within a command-line interface (CLI). These editors are used for managing and editing files on systems. Terminal editors are widely used for tasks like editing configuration files, writing scripts, or even programming, and many more.

  1. Open the terminal.
  2. Type ' nano subtitles.srt '.
  3. Enter your subtitle in the SRT format.
  4. Save the file with ' Ctrl + O ', then ' Enter ', and exit with ' Ctrl + X '.
  1. Open the terminal.
  2. Type ' vim subtitles.srt '.
  3. To begin typing your subtitles, press 'I' to enter insert mode.
  4. Press ' Esc ', then type ' :wq ' to save and exit.

Verifying Your SRT File

To make sure that our SRT file is properly formatted, the User can use subtitle editors like ' Aegisub ' or check it by loading it into a media player like VLC, Windows media played, Itones, etc.

👁 How-to-create-an-SRT-file-on-Ubuntu
create an SRT file on Ubuntu

Conclusion

By following the steps to create an SRT file on Ubuntu, you can effectively add and manage subtitles for your video projects. Utilizing the right tools and understanding SRT file format ensures that your subtitles are accurate and well-timed. Whether you're using a text editor or a dedicated SRT file editor on Ubuntu, this process will help you enhance your video content with clear and accessible subtitles.

Comment
Article Tags: