HowTo: Embed subtitles (srt) into a video

The files must have the same name, by example video1.flv & video1.srt, then copy this script into the folder and let it run. (gist)

#!/bin/bash
for f in *.flv;
    do
        nameis=${f%.*}
        mencoder -utf8 -subfont-text-scale 3 -sub $nameis.srt $nameis.flv -o $nameis.SUB.flv -oac mp3lame -ovc lavc
    done

If your subtitles are not in the “srt” format you can try an convert them with ffmpeg by example: ffmpeg -i subtitle.rt subtitle.srt FFmpeg subtitle formats.