Adding subtitles to AVI movies and converting them to Dreambox .TS format

Here are the commands I use to add subtitles to a movie, and then convert that resulting file into .TS format so you can FTP it to /hdd/movie  and watch it on your dreambox.

Usage:  avi-to-ts-subst name_of_movie

(type the name of the movie without extension)

UPDATE: Here is an improved version. The only requirement, is that you save the .srt subtitle file with the SAME filename, in the same directory. You call this script, (which I called avi-to-ts2-subst) like this:
$ avi-to-ts2-subst my-movie
(that is, do NOT specify an extension)

Subtitling is a two-step process.. First with mencoder, then with ffmpeg.
It creates a temporary .out file between these two programs.

mencoder -sub $1.srt -subfont-autoscale 1 \
-subpos 90 -vf expand=720:576 -fps 24000/1001 -ovc lavc \
-lavcopts vcodec=mpeg2video:vbitrate=2500:threads=2 \
-channels 2 -oac copy -o $1.out $1.avi
ffmpeg -y -threads 2 -i "$1.out" -ab 128k -b 2500k \
-r 25 -maxrate 8000k -bufsize 1000k -s 720x576\
-vcodec mpeg2video -ac 2 -s 4cif -acodec mp2 -map 0:0 -map 0:1 "$1.ts"

2 thoughts on “Adding subtitles to AVI movies and converting them to Dreambox .TS format

  1. Hocam, Türkçe altyazi gömerken noktali harfleri nasil dogru bi şekilde cikartiriz ? script cok güzel calisiyor bu arada 🙂 bir tek türkçe karakterlerde sorun cikartiyor.

Leave a Reply