How to save an SRT file with a video to be part of the video?

I work for a company that generates videos, and my current task involves creating educational video content. One of the project’s videos features a guest speaker who gives a lecture in a language other than that of the video’s original audio. By adding subtitles in the SRT (SubRip) format, I hope to increase the video’s usability for viewers around the world.
These subtitles will be incorporated into the video itself in a seamless manner. Do you know how to do that?

2 Likes

Hey!

To make things easy Gumlet supports SRT upload from the dashboard,

You can use FFmpeg, a flexible multimedia framework for processing multimedia files, to incorporate an SRT (SubRip Subtitle) file into a video so that the subtitles become a fundamental component of the video. The steps to do this are as follows:

1. Set up FFmpeg

To download FFmpeg on your system follow the below guides:

2. Prepare your SRT file and video

Make sure the SRT subtitle file (ex. subtitles.srt) is prepared in the same directory as the video file (ex. input.mp4) to which subtitles will be added.

3. To embed subtitles, use FFmpeg

  • Launch your terminal or command prompt.
  • Use the FFmpeg command listed below to incorporate the SRT subtitles into the video:

ffmpeg -i input.mp4 -vf "subtitles=subtitles.srt" -c:a copy output.mp4

  • -i input.mp4: Specifies the input video file.
    * -vf "subtitles=subtitles.srt": Applies the subtitles filter, effectively merging the SRT subtitles onto the video. Replace “subtitles.srt” with the actual filename of your SRT file.
    * -c:a copy: Copies the audio codec without re-encoding, ensuring audio quality remains unchanged.
  • output.mp4: Specifies the name of the resulting video file. You can opt for an alternative filename as needed.

4. Execute the command

To run the FFmpeg command, hit Enter. The video will be edited using FFmpeg, which will also add the SRT subtitles.

5. Check the Result

When the command is finished, you will have a new video file (output.mp4) that has the subtitles incorporated into it.

You’ve successfully used FFmpeg to add SRT subtitles to your video. The subtitles will be visible to viewers as an essential part of the video when using this updated video file, which may be distributed and played with compatible video players.