After a long and delightful time using Elementary OS as my primary OS, I’ve had to switch to Mac OS for work and also due to my computer spontaneously combusting. I exaggerate but the thing decided to go to sleep and never wake up. In any case, I noticed that every time I tried to add srt subtitle files to QuickTime when watching a movie or show, it didn’t work as it did with VLC, that is to say via a simple drag and drop. I found it frustrating and had to look up a quick fix. This article will go over how to use ffmpeg to add srt files to .mp4 files so that QuickTime can recognize them.

Requirements

  • ffmpeg (If you don’t have it installed, do so using brew: brew install ffmpeg)

Lights, Camera, Action

To embed the srt file into your mp4 file, run the following command:

ffmpeg -i yourVideo.mp4 -i yourSubtitle.srt -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng yourOutputVideo.mp4

In the command above:

  • yourVideo.mp4 is the mp4 file in which you want to embed your subtitle file.
  • yourSubtitle.srt is the srt subtitle file you want to embed
  • eng is the language of the subtitle file
  • yourOutputVideo.mp4 is the final video that will have the subtitle file embedded in it

That should do it. Cheers