@@ -7099,26 +7099,6 @@ Same as the @ref{subtitles} filter, except that it doesn't require libavcodec
and libavformat to work. On the other hand, it is limited to ASS (Advanced
Substation Alpha) subtitles files.
-This filter accepts the following option in addition to the common options from
-the @ref{subtitles} filter:
-
-@table @option
-@item shaping
-Set the shaping engine
-
-Available values are:
-@table @samp
-@item auto
-The default libass shaping engine, which is the best available.
-@item simple
-Fast, font-agnostic shaper that can do only substitutions
-@item complex
-Slower shaper using OpenType for substitutions and positioning
-@end table
-
-The default is @code{auto}.
-@end table
-
@section atadenoise
Apply an Adaptive Temporal Averaging Denoiser to the video input.
@@ -19227,6 +19207,21 @@ These fonts will be used in addition to whatever the font provider uses.
@item alpha
Process alpha channel, by default alpha channel is untouched.
+@item shaping
+Set the shaping engine
+
+Available values are:
+@table @samp
+@item auto
+The default libass shaping engine, which is the best available.
+@item simple
+Fast, font-agnostic shaper that can do only substitutions
+@item complex
+Slower shaper using OpenType for substitutions and positioning
+@end table
+
+The default is @code{auto}.
+
@item charenc
Set subtitles input character encoding. @code{subtitles} filter only. Only
useful if not UTF-8.
@@ -71,6 +71,10 @@ typedef struct AssContext {
{"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, \
{"fontsdir", "set the directory containing the fonts to read", OFFSET(fontsdir), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \
{"alpha", "enable processing of alpha channel", OFFSET(alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FLAGS }, \
+ {"shaping", "set shaping engine", OFFSET(shaping), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 1, FLAGS, "shaping_mode"}, \
+ {"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = -1}, INT_MIN, INT_MAX, FLAGS, "shaping_mode"}, \
+ {"simple", "simple shaping", 0, AV_OPT_TYPE_CONST, {.i64 = ASS_SHAPING_SIMPLE}, INT_MIN, INT_MAX, FLAGS, "shaping_mode"}, \
+ {"complex", "complex shaping", 0, AV_OPT_TYPE_CONST, {.i64 = ASS_SHAPING_COMPLEX}, INT_MIN, INT_MAX, FLAGS, "shaping_mode"}, \
/* libass supports a log level ranging from 0 to 7 */
static const int ass_libavfilter_log_level_map[] = {
@@ -216,10 +220,6 @@ static const AVFilterPad ass_outputs[] = {
static const AVOption ass_options[] = {
COMMON_OPTIONS
- {"shaping", "set shaping engine", OFFSET(shaping), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, FLAGS, "shaping_mode"},
- {"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = -1}, INT_MIN, INT_MAX, FLAGS, "shaping_mode"},
- {"simple", "simple shaping", 0, AV_OPT_TYPE_CONST, {.i64 = ASS_SHAPING_SIMPLE}, INT_MIN, INT_MAX, FLAGS, "shaping_mode"},
- {"complex", "complex shaping", 0, AV_OPT_TYPE_CONST, {.i64 = ASS_SHAPING_COMPLEX}, INT_MIN, INT_MAX, FLAGS, "shaping_mode"},
{NULL},
};
Commit 4b58349bc8ff2ff5dfbc9eef1e5856fd16e1f517 introduced a new option for selecting the font shaping engine used for rendering ASS subtitles. However, the shaping value was used in code shared with the ordinary subtitles filter (config_input in vf_subtitles.c), where it is left uninitialized, as opposed to defaulting to -1. This means that the subtitles filter is forced to use the "simple" shaping engine instead of automatically selecting the best available option. As a result, Indic scripts requiring "complex" shaping are not rendered correctly. This was reported as bug #8738. (Aside: Thanks to cehoyos for pointing to the responsible commit on the bug tracker.) Because I don't see a reason why font shaping should be an ASS-only option (especially considering the implementation was already shared), I moved it into the common options. Signed-off-by: Yorwba <yorwb4@gmail.com> --- doc/filters.texi | 35 +++++++++++++++-------------------- libavfilter/vf_subtitles.c | 8 ++++---- 2 files changed, 19 insertions(+), 24 deletions(-)