User Tools

Site Tools


linux:embed_subtitles_avi

Embed subtitles in AVI files

26.06.2012

If you're in need to embed the subtitles into an avi file (for example to have decent font size on the DVD player), here is how you should do it:

0. (OPTIONAL) CONVERT SUBTITLES TO UTF-8 ENCODING

iconv -f <current_encoding> -t UTF-8 subtitle.srt > subtitle.utf8.srt

1. EMBED THE SUBTITLES INTO THE MOVIE USING MENCODER

MEncoder is an utility, usually found into the mplayer packages.

mencoder -subcp UTF-8 -ovc xvid -xvidencopts fixed_quant=4:autoaspect -oac copy -sub subtitle.srt -o output.avi source.avi

-subcp UTF-8 - specify the encoding for the subtitle file
-ovc - video codec (here xvid, use mencoder -ovc help for more details)
-xvidencopts - options for the video codec (either quant or bitrate specified, check the mencoder manual for details; fixed_quant=4 is an optimal choice here)
-oac - audio codec
-o output.avi - the result

linux/embed_subtitles_avi.txt · Last modified: 2013/03/16 17:40 (external edit)