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.

Advertisements
This entry was posted in Bash, ffmpeg, Linux, simpleScripts and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s