[MEncoder-users] Generating switchable binary subtitles with MEncoder

Nicolas George nicolas.george at normalesup.org
Tue Oct 30 11:46:18 CET 2007


L'octidi 8 brumaire, an CCXVI, Giacomo Comes a écrit :
> The code in spumux that render text subtitles in graphic subtitles
> comes from mplayer. So basically both should do the same work.

It does not come from libass.

Which gives me an idea:

perl -e 'while(1) { print "\xFF\x00\x00" x (720*576) }' | \
  mplayer -demuxer rawvideo -rawvideo fps=1:w=720:h=576:format=rgb24 \
  -aspect 16:9 -ass -sub foo.ass -vo png -benchmark -

should do most of the work. Before that, you need to adapt your subtitle
file to have one sentence per second, of course.

You then need a tool to change the red into an alpha channel, and to reduce
the number of colors. Unfortunately, I do not know of any such tool.

> About anti-aliasing, what I know is that it requires a lot of colors.
> ImageMagick when it renders a one color text with anti-aliasing can use 
> up to 256 different colors. The rendering looks very nice, but then
> if you put it in a DVD subtitle you cannot have more that 4
> colors in total. How do you keep the anti-alias effect if you can only
> use 1 or may be 2 colors for the text and 1 or 2 for the border?

You need 1 color for the background, 1 for the letters body, 1 for the
letters outline, which makes 3 out of 4: there is 1 color available to
anti-alias either between the body and the outline or between the outline
and the background. This is not much, but it makes a lot of difference
compared to no anti-aliasing at all.

Regards,

-- 
  Nicolas George



More information about the MEncoder-users mailing list