33 #if CONFIG_SUBTITLES_FILTER
59 #define OFFSET(x) offsetof(AssContext, x)
60 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
81 static void ass_log(
int ass_level,
const char *
fmt, va_list args,
void *ctx)
92 static const char *shorthand[] = {
"filename",
NULL };
106 ass->
library = ass_library_init();
129 ass_free_track(ass->
track);
133 ass_library_done(ass->
library);
148 ass_set_frame_size (ass->
renderer, inlink->
w, inlink->
h);
150 ass_set_aspect_ratio(ass->
renderer, (
double)inlink->
w / inlink->
h,
157 #define AR(c) ( (c)>>24)
158 #define AG(c) (((c)>>16)&0xFF)
159 #define AB(c) (((c)>>8) &0xFF)
160 #define AA(c) ((0xFF-c) &0xFF)
163 const ASS_Image *image)
165 for (; image; image = image->next) {
166 uint8_t rgba_color[] = {
AR(image->color),
AG(image->color),
AB(image->color),
AA(image->color)};
172 image->bitmap, image->stride, image->w, image->h,
173 3, 0, image->dst_x, image->dst_y);
182 int detect_change = 0;
184 ASS_Image *image = ass_render_frame(ass->
renderer, ass->
track,
185 time_ms, &detect_change);
214 #if CONFIG_ASS_FILTER
216 #define ass_options options
222 int ret =
init(ctx, args, &ass_class);
230 "Could not create a libass track when reading file '%s'\n",
239 .description =
NULL_IF_CONFIG_SMALL(
"Render subtitles onto input video using the libass library."),
246 .priv_class = &ass_class,
250 #if CONFIG_SUBTITLES_FILTER
252 #define subtitles_options options
266 ret =
init(ctx, args, &subtitles_class);
309 ass_process_codec_private(ass->
track,
321 if (ret < 0 || !got_subtitle)
327 ass_process_data(ass->
track, ass_line, strlen(ass_line));
344 .description =
NULL_IF_CONFIG_SMALL(
"Render subtitles onto input video using the libass library."),
346 .
init = init_subtitles,
351 .priv_class = &subtitles_class,