Embedding subtitles (SRT) into video files (AVI, MPG, MP4, MKV, etc.)
Author: willem In: apple, tools, unixVideo players like VLC have the option of rendering subtitles from an external file (.srt) on videos during playback, but many embedded players (e.g. those found in media centre systems like the Xbox 360), don’t. In cases like these, embedding the subtitles in the video track is often the best way to go.
If the video / subtitle files you want to merge are in the Matroska Video (.mkv) format, this will be a two-step process (MKV files can have subtitle files embedded, but they are kept separate from the video and audio tracks). You can follow these instructions to extracts the tracks from your MKV files.
If you already have the video and subtitle files separated (e.g. an .avi and a .srt file), you can simply use an application like ffmpegX (a visual interface to mencoder available for OS X only) or mencoder (Linux) to merge them.
To embed the subtitles into the video file using ffmpegX:
Open ffmpegX, click the ‘Open‘ button and select your original video file. Then click on the ‘Filters‘ tab, check the ‘VOB Subtitles‘ checkbox, click the ‘Load subs‘ button, and select your subtitles file. You might need to modify the Font size and Pos values to align the embedded subtitles properly.
Click the ‘Encode‘ button to start encoding your new movie file.

Related posts:
- Extracting Audio, Video and Subtitle tracks from Matroska Video (MKV) files
- Converting RealVideo (RMVB, RealPlayer) files to AVI, MPEG, or MP4 on the Mac
- Bash Script to split a single CSV file into multiple files with headers
- Extract and sort email addresses from text files with Automator
- Showing hidden files and directories in the Finder in Mac OS X
Like this post? Subscribe to the Geekology RSS 2.0 feed!













j
April 14th, 2009 at 05:55
Is there a program for windows?
willem
April 15th, 2009 at 12:07
I suggest you take a look at DivXLand Media Subtitler (freeware), Lifehacker recommended it in the past.
seamus
May 1st, 2009 at 08:29
This works great! Thanks
djender
May 10th, 2009 at 21:49
Once you have embedded subs in a avi file, is there a way to separate or extract the srt file from the avi? (revert the process)
willem
May 11th, 2009 at 19:39
MKV files store the audio, video and subtitle tracks separately, but unfortunately this process embeds the subtitles within the AVI video stream, making it virtually impossible to extract.
mangrilla
June 2nd, 2009 at 02:11
I’ve tried to follow the above instructions, however, when I preview the video to make sure the subtitles are showing up, I don’t see any.
Then, once I close the video, I get this error message:
“FIXME:Hardenabling SSE and SSE2 without detection
/Users/Damon/.spumux/Arial.ttf doesn’t look like a font description, ignoring.
Cannot load font: /Users/Damon/.spumux/Arial.ttf
SUB: Could not determine file format
Cannot load subtitles: /Users/Damon/Downloads/The.Counterfeiters[DivX-MP3][DVDRip] [mattlb0619][h33t]/The.Counterfeiters.ENG.srt
MPlayer interrupted by signal 11 in module: uninit_vo
- MPlayer crashed by bad usage of CPU/FPU/RAM.
Recompile MPlayer with –enable-debug and make a ‘gdb’ backtrace and
disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn’t happen.
It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
gcc version. If you think it’s MPlayer’s fault, please read
DOCS/HTML/en/bugreports.html and follow the instructions there. We can’t and
won’t help unless you provide this information when reporting a possible bug.”
I try different fonts but it says that it can’t find any of them. Any ideas of what I’m doing wrong?
willem
June 16th, 2009 at 12:22
Hey Mangrilla
Have you tried manually copying the TTF fonts into your /Users/Damon/.spumux/ directory?
Graeme
July 2nd, 2009 at 17:14
I’ve been experiencing the exact same issue as mangrilla. I did a few searches with the mdfind command in the Terminal, and as best I can figure out, the directory Damon and the hidden directory .spumux appear nowhere on my computer.
On the other hand, I didn’t think I had Mplayer installed, but it seems that ffmpegx is still somehow playing previews with Mplayer.
Graeme
July 2nd, 2009 at 17:32
OK…now I’m feeling pretty stupid. Damon is obviously the name of a user on mangrilla’s comp, and mdfind wasn’t finding .spumux because I didn’t have hidden files showing.
That said, there is a copy of Arial.ttf in there, although it’s an older one (from 2004), so not sure why its throwing an error…
Peter Boodts
July 5th, 2009 at 23:23
mmm, filters/Subtitles “load subtitles” is greyed out, can’t do anything.
Help
Peter
willem
July 6th, 2009 at 00:01
Hi Graeme
Have you tried manually copying the font file in there or using a different font?
Hi Peter
Which version of ffmpegX are you using, and which version of Mac OS X are you running?
Graeme
July 6th, 2009 at 00:16
Tried using a few other fonts (all of which have a .ttf file present in .spumux), but getting a similar error message for each:
FIXME:Hardenabling SSE and SSE2 without detection
/Users/username/.spumux/TrebuchetMS.ttf doesn’t look like a font description, ignoring.
Cannot load font: /Users/username/.spumux/TrebuchetMS.ttf
SUB: Could not determine file format
Cannot load subtitles: /Users/username/Movies/Needs_SRT/movie.srt
SUB: Could not determine file format
Cannot load subtitles: /Users/username/Movies/Needs_SRT/movie.srt
mpg123: Can’t rewind stream by 417 bits!
objc[2331]: FREED(id): message release sent to freed object=0xa89680
It may be a problem with the subtitle file (whch is a .srt), I was able to harcode subs for a different movie (also .srt). It plays fine in VLC though…
Peter Boodts
July 6th, 2009 at 20:26
I use ffmpegx 0.0.9x
on OSX 10.5.7
quennie
July 11th, 2009 at 01:43
Hi! i have no audio in the encoded file. what could be wrong?
willem
July 11th, 2009 at 20:58
Hi Quennie
I’ve found that sometimes it helps to change the audio codec of the output file.
Francisco (Nervioso) « Embedding subtitles (SRT) into video files (AVI, MPG, MP4, MKV, etc... « Chat Catcher
August 16th, 2009 at 04:30
[...] 2009-08-15T19:30:03 Embedding subtitles (SRT) into video files (AVI, MPG, MP4, MKV, etc.) [link to post] [...]
lionknight
August 27th, 2009 at 18:52
subtitles are coming first and the video is coming later.
what should i do?
please somebody help me
lionknight
August 27th, 2009 at 18:53
How to use matroska?
Please help me….
PimpThisBlog (PimpThisBlog) « Embedding subtitles (SRT) into video files (AVI, MPG, MP4, MKV, etc... « Chat Catcher
October 19th, 2009 at 23:27
[...] PUBLISHED: Embedding subtitles (SRT) into video files (AVI, MPG, MP4, MKV, etc.) - [link to post],#apple #avi #ffmpegx #mencoder [...]
Canes
January 7th, 2010 at 05:26
Why would this program need your Mac’s password?? Why would anybody do this?? Wouldn’t this be rather dangerous??
lucas
February 15th, 2010 at 01:10
Don’t I lose any quality in the process of separating them and putting them back together?