sub: add --osd-blur and --sub-text-blur options

These require bleeding edge libass (latest git version), and will be
ignored otherwise.

I'm not sure about the blur factor and scaling. The ASS/VSFilter
semantics for blur scaling are a bad mess. Might require further
investigation.
This commit is contained in:
wm4 2013-04-13 18:53:03 +02:00
parent 3097176ff1
commit df8a481eba
4 changed files with 8 additions and 0 deletions

View File

@ -1351,6 +1351,9 @@
--osd-back-color=<#RRGGBB>, --sub-text-back-color=<#RRGGBB>
See ``--osd-color``. Color used for OSD/sub text background.
--osd-blur=<0..20.0>, --sub-text-blur=<0..20.0>
Gaussian blur factor. 0 means no blur applied (default).
--osd-border-color=<#RRGGBB>, --sub-text-border-color=<#RRGGBB>
See ``--osd-color``. Color used for the OSD/sub font border.

View File

@ -69,6 +69,9 @@ void mp_ass_set_style(ASS_Style *style, struct osd_style_opts *opts)
style->MarginV = opts->margin_y * scale;
style->ScaleX = 1.;
style->ScaleY = 1.;
#if LIBASS_VERSION >= 0x01020000
style->Blur = opts->blur;
#endif
}
ASS_Track *mp_ass_default_track(ASS_Library *library, struct MPOpts *opts)

View File

@ -79,6 +79,7 @@ const struct m_sub_options osd_style_conf = {
OPT_FLOATRANGE("spacing", spacing, 0, -10, 10),
OPT_INTRANGE("margin-x", margin_x, 0, 0, 300),
OPT_INTRANGE("margin-y", margin_y, 0, 0, 600),
OPT_FLOATRANGE("blur", blur, 0, 0, 20),
{0}
},
.size = sizeof(struct osd_style_opts),

View File

@ -192,6 +192,7 @@ struct osd_style_opts {
float spacing;
int margin_x;
int margin_y;
float blur;
};
extern const struct m_sub_options osd_style_conf;