Embedding subtitles (SRT) into video files (AVI, MPG, MP4, MKV, etc.)
Video 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
- Resize Images Using AppleScript



03 Feb 2009 









author
Is there a program for windows?
I suggest you take a look at DivXLand Media Subtitler (freeware), Lifehacker recommended it in the past.
This works great! Thanks
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)
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.
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?
Hey Mangrilla
Have you tried manually copying the TTF fonts into your /Users/Damon/.spumux/ directory?
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.
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…
mmm, filters/Subtitles “load subtitles” is greyed out, can’t do anything.
Help
Peter
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?
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…
I use ffmpegx 0.0.9x
on OSX 10.5.7
Hi! i have no audio in the encoded file. what could be wrong?
Hi Quennie
I’ve found that sometimes it helps to change the audio codec of the output file.
subtitles are coming first and the video is coming later.
what should i do?
please somebody help me
How to use matroska?
Please help me….
Why would this program need your Mac’s password?? Why would anybody do this?? Wouldn’t this be rather dangerous??
Don’t I lose any quality in the process of separating them and putting them back together?
And how do we embed subtitles on a proper normal computer? This is for a Mac only, I guess.