[MPlayer-dev-eng] [PATCH] SVG overlay

Nicolas George nicolas.george at ens.fr
Sun Aug 20 23:49:05 CEST 2006


Hi.

When I found out that MPlayer had now support for enriched subtitles in
SSA/ASS format, my first reaction was it was great news, but my second
reaction was "too bad that SSA/ASS is such an ad hoc and limited format".
But it gave me a hint that it could be done, and how it can be done:

http://www.eleves.ens.fr/home/george/info/prg/mplayer-svg/
http://www.eleves.ens.fr/home/george/info/prg/mplayer-svg/mplayer-svg-20060820.diff

This patch adds the "svg" video filter, that can render Scalable Vector
Graphics files on top of any video.

In the same directory, you will find a sample SVG file, fancy subtitles for
the well-known humorous video Matrix XP <URL: http://www.matrix-xp.de/ >. It
should be used that way:

mplayer -vf svg=Matrix-XP.svg,scale Matrix-XP.avi

It requires libxml2, and libsvg-cairo <URL:
http://cairographics.org/libsvg-cairo >, which itself requires libsvg <URL:
http://cairographics.org/libsvg >.

Since animations features of SVG are not supported by libsvg-cairo nor any
SVG rendering library I found, I use timing attributes in a dedicated
namespace. I am abusing the http://www.mplayerhq.hu/DOCS/tech/svg-sub.html
URL for this namespace; the page itself remains to be written.

Some work is still needed to make this patch perfect: handle negative
strides without segfault, find why it does not work with mencoder (static
parts are there, but not variable parts, I believe the timestamps are not
what I expect), and of course documentation. And maybe some perl scripts,
srt2svg and ass2svg.

Nonetheless it does already work pretty well, and can give some nice-looking
results. I home some will enjoy it.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060820/76ac0271/attachment.pgp>


More information about the MPlayer-dev-eng mailing list