I'm using mencoder (version 1.1-4.8 on Ubuntu 14.04) to encode various avi, mp4 and mkv files into smaller .avi files with srt subtitles "burned in" (to view in a portable dvd player that has very limited format support). It usually works great, except with some mkv files that already include one or more subtitle tracks. In those cases the output file displays the original subtitle lines for around half a second and then switches to the text from the srt file I provided, repeating this behavior for every piece of dialog. I use spanish language .srt files, and the mkv files usually have english subtitles produced from closed-captioning, so the quick switch (nothing on screen -> english dialogue -> Spanish dialogue) can be extremely confusing.

I can't find a way of telling mencoder to ignore any subtitles that come with the mkv file and use only the srt file I provided, so I wonder if anyone here had a similar problem and could find a solution.

for reference, I'm doing 2-pass conversion and these are the parameters I use for the second pass:

original_file.mkv -oac mp3lame -ovc xvid -vf scale -zoom -xy 720 -xvidencopts bitrate=2500:me_quality=6:threads=2:pass=2 -noautosub -forcedsubsonly -sub subtitles.srt -subfont-text-scale 2.5 -subcp latin1 -subpos 85 -passlogfile /tmp/logfile -o output.avi -quiet

Thank you!


Well, couldn't find a way of stopping mencoder from overlying the 2 subtitles, but I found an easy workaround.

I added to my conversion script a new step at the start that checks if the original file's extension is mkv, and if so, removes any subtitles from it using this command:

mkvmerge -S -o original.mkv /tmp/no_subtitles.mkv

then I use the output of this command instead of my "original" file and there's no embedded subtitles to supress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.