From patchwork Sun Dec 5 19:41:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soft Works X-Patchwork-Id: 32012 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp3630046iog; Sun, 5 Dec 2021 11:44:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcqTco33bUyprScj+IdX42k6ne0WIoFpMungh6yP80QB3J1GaVTx/S8pY/yKL6adq9bSjF X-Received: by 2002:a17:906:4dd0:: with SMTP id f16mr38939890ejw.454.1638733480692; Sun, 05 Dec 2021 11:44:40 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qk9si15133151ejc.171.2021.12.05.11.44.40; Sun, 05 Dec 2021 11:44:40 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@hotmail.com header.s=selector1 header.b=JzDqPgBD; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9AF7B68AFF3; Sun, 5 Dec 2021 21:42:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (unknown [40.92.23.83]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B587568AFE7 for ; Sun, 5 Dec 2021 21:42:01 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E2N/2pdhQ3IL/uYOun6oUtwmvdzKTmOuHcVxN6MuVgVxg94tGMAE7RAi7PW+EDMFNEbfOd+OzwiwNt7OiPU/LXAg3mY6EchkAXmUO7BRp9aZZg4zyE1LFTbetDRp4BACfQRmrE1x94PPckE1GSSUhg5IEQyc4AmDupFGfjfJcGJNKRU47ExyOlZNh9wo2eSB6ZpH63uGkOSyYex42RLS9290Ekbv93mVOlgDT0yy7LSdtFlz3y7G0VOMYfFORAgV1NQ7cVOvIq3RU6i02LhGWkWeV7KcYJQQXWh51953C0qln9KTGplqP4zKdMyH+DNEjZLK3VG8iwoMqvaj0UJTVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e0kiAWs4IqbLjZMBRLC9NCFsGZUKPdairX2xRWPi6RM=; b=YyFLiGlXYHbl+SdqyyP4RK4unea7XFBT2PsiYDDJVPbax1+MPYUx9vpLrjKHohfOYt2WahmCankTeK9skwM71mvKpgxkLNxI+jxREqE/Uk+YAukPSpNkoo94qSF7zknwUF3TsfEeD0xD5mwlpJ6/H2a8KJUQjmsZELNE6199BfAKdNRQlnOh2vrmwTs+W96UMTozGHW/0Wzn5YRvtQxpnMx+AQLxkQ4/VX6iXOy6+IIED9WqluMQUgKWojOXXZ4MEfQMEg5dIPxkCtUQk2TXZw1EfkuNqFIeVwXL/na88DRk/x5hwz9lILA8Oru0qqioIBEqOXgfcLa4/ntWBNL2TQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e0kiAWs4IqbLjZMBRLC9NCFsGZUKPdairX2xRWPi6RM=; b=JzDqPgBDe8xxddnoTCkWAN6MTI/IEOfcnnvdOGDITQcaeKk/+9M2iopveIDXXTQnq0Z9tB9ZQ/i2qGsiiaRFDk2cmfCE+Ayk2D521m4diGQ1TNI6ZUB8lpSg7q/dYDJ/CDFHXjvOlcQI1UTl48W9w8SHIAhCz3HXzlhMctB7g0K7F4yJjjyPgJyrI6gbK33SOcSnQY7/1wxn6jMAEUDuocj23L7LtgNIq1vKiwCoqTlx7omcTjyNVBB+5rVhNXNjvD0HfOtEAterDeRzCJQLUQQGIeV9DYn8hhcqghPDqbpYSBs9dQAZlW6cfCaeBgonAyKFho6ygtHZwWdsOcDtOw== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by DM8P223MB0320.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Sun, 5 Dec 2021 19:41:58 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::9c8d:fc63:9488:9775]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::9c8d:fc63:9488:9775%8]) with mapi id 15.20.4755.021; Sun, 5 Dec 2021 19:41:58 +0000 From: Soft Works To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH v21 17/20] avfilter/stripstyles: Add stripstyles filter Thread-Index: AQHX6hAqxjk0W8oB00Kd19rgjr90TQ== Date: Sun, 5 Dec 2021 19:41:58 +0000 Message-ID: References: <1bdaf4de8cf369e4a28e7a5d8be2870ea5e34b39.1638733198.git.softworkz@hotmail.com> <9fdc2f3e9bedd2ade341e81095496866d786488b.1638733198.git.softworkz@hotmail.com> <9189c7c58671e4d611b5a7f44c9db4b37416088c.1638733198.git.softworkz@hotmail.com> <3ce4c329dfd8718fb86f61ee73b044f1a3285486.1638733198.git.softworkz@hotmail.com> <8e26ae0f796a7c9be3aa94740b68a7fa9400dafc.1638733198.git.softworkz@hotmail.com> <7cd2de4f62b2e30ce670cfe421afa1171ad23594.1638733198.git.softworkz@hotmail.com> <602d3c490440d703afd815714e183e62367e3e3e.1638733198.git.softworkz@hotmail.com> <65fed074109cab2b1dc123b0f37e85890dea528b.1638733198.git.softworkz@hotmail.com> <72b7410d291e8356649700eaaef61b30a526db3d.1638733198.git.softworkz@hotmail.com> <99dc80c1b7f60adefdb1812c0fda7ca2b49b3524.1638733198.git.softworkz@hotmail.com> <0fbd116020f0accff90e78704527a90b38b4da9c.1638733198.git.softworkz@hotmail.com> <1bcd5eac7b3d980803e828771f7dd8ac62d2d6fc.1638733198.git.softworkz@hotmail.com> <42ac242cb70029add2b251ff3d5b719aa3e40cff.1638733199.git.softworkz@hotmail.com> In-Reply-To: <42ac242cb70029add2b251ff3d5b719aa3e40cff.1638733199.git.softworkz@hotmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [8Zsi1KlVZ6oGDUfTTNSJTknDRETJn2JGHn9Zg0MiswZhe7r9JwW9VPr2N2VsBb2P] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 96ed66f4-838c-465a-af1a-08d9b8274d38 x-ms-traffictypediagnostic: DM8P223MB0320: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PBIKHGeXZO5ai9QcFV9RfYGprWkA+2xCtyRNqRHY6YpBLXpfv2kIn8hnc4qkMhS/v5qqLBzHNnEDG2GxWqCfiSGUVG5Pohqt8RDMuKttDQaqYgE7M+J1dfPMygTVqdzryj35UojW97x1TaAw+Bm0Mbr0m8d0j/m45OMDMssg2nYv6qVfXZfaUt4wHzAq1UJGpvUIK5xHwEXvaEbUcqrVKoKvmTNA7kwvTVV+kX1PJB7SazXrqAInHAq3eXw/m6PPhS1Q+jKceNSESDZoSq4i7xZ1xiZ+BWqTtBJ4dZi4O4dmzm9jfF7mSb3ImgF7iI+RerfshmBTAqfq1RC4xTxKWuoxrFqHjmlLCtoO0VwqN1yz5PeCl0AVa8wX5lXNo+TO3lLqwEaQMaEe5NcC23wby2jFp+CqAfaXhZtDNxBqciJpPuvhNx7hx8XzDYbQEOpI4fJjMjtMhXVfwYPJuE0g3JyE8MNZQieo/kYm/lAvwdSvl2Pg06Z1zRP7vNMWtAMQgc7zFA4/8rN61CcF2vvX5buDKeO75EifUWu9wZnRMLiO7NpYAEnm+uBZzfi/Q867gS+m87JAjGewX2A+4tEhK0NVqkreWGXvU87pT1rgS7VwFe2bgtjaQRxJlwnIHfKtaeplcOTW+oFKTspiYTkVwH7fjlymPbdBNbMmd4FcTGk= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?5M3uC2MnYHvvXfKcRIThp3sdKGdD?= =?utf-8?q?ondUnq2Bxpp2Npt/vYnmwLIDCSWhTRZwhKs1zs/dpbjognG/KZ8vCU1XAf5RH9bno?= =?utf-8?q?DyrwX8GI8fPMFIrbXyDIy0CCPwmBUdgedDUSvCN2xYnh92fYlVNewBHvqT8APGXcs?= =?utf-8?q?p9VIfet26W/F7efIst0hdDpuctaFoNxkMEdYQBro7jDXxo6jhXRWaYWoBt7DHagKN?= =?utf-8?q?k+bijeNiCAdZqcwHNN94g/lzRimHTPrc3+3QUMDD5AvtNDQ6VHN/ECXEQBjiF7yVQ?= =?utf-8?q?LST8A/I3Eo0Lbg8jQl4DpYfcQ4LxWEZ01+XZC3RFAkk4G51vpbnU2gf1rR5oO/OCD?= =?utf-8?q?qw148HqC8AgZia6ZeLgiHnMaa/KN3IEZqyXid/i7pQF6w/8inz42zbnZuKdKyUnCr?= =?utf-8?q?F/yI52QuOW5fdzufoY8cLE3iN0SIfJXmNNytjFPV6qy5mqK46koVgv6Vrt6stQNil?= =?utf-8?q?mxD2NDxwBOxAotNdrP+ZY6MKDGLFW1DqL9OvOOAZtC0RQ/WNrO/Tm6rdoRlU3RKrx?= =?utf-8?q?MpGcOsIuLhMBa+iRbAvYS2x6AgzZb6yv/z4kPBZM1AZ5yyIyAz9rsVRO7K+L5BC3R?= =?utf-8?q?LrgWWiyByk6zhfG4lP1axQwDZ3dmfe0mLEo1L3EyoYSFpztfBIEl+fpst0unYOg/3?= =?utf-8?q?EWqyPplhSagFxWU77HY/6QAqfzHiW2dPyvk5R2+CBB7WOO+PeLGd6gSO2BLMd2TdC?= =?utf-8?q?/o+XA89OwHV1QFD9FaG4Ry96ffGYSLc9YF1LZKiaeAXVugUx5mYC7yCR7EE7+m3cb?= =?utf-8?q?KhyGZMVKhrxqdTkMxbZBMRik3EvnN5xdp84qoq+Vj3OcmsgqBvNCPevPN2+YLHTh/?= =?utf-8?q?o0Fz3fHzHLapYSdoeCMj7RRAoRrTtidg5Kr8nY7M/11pA5Wh+bGghSRDxC9oFiNR1?= =?utf-8?q?aL+HvMFRhIsZz0QYLKJYO339gwfc9/ksUKhRqD0acSQmne3b2PIMalLeVUrjBVD1w?= =?utf-8?q?9946REU6Kjdblzrd0E3xCzwkYdViaeS8mEQ6KmzEPsQ=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-1ff67.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 96ed66f4-838c-465a-af1a-08d9b8274d38 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2021 19:41:58.7346 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8P223MB0320 Subject: [FFmpeg-devel] [PATCH v21 17/20] avfilter/stripstyles: Add stripstyles filter X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CtWNxfyaA54J - stripstyles {S -> S) Remove all inline styles from subtitle events Signed-off-by: softworkz --- doc/filters.texi | 37 +++++++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/sf_stripstyles.c | 196 +++++++++++++++++++++++++++++++++++ 4 files changed, 235 insertions(+) create mode 100644 libavfilter/sf_stripstyles.c diff --git a/doc/filters.texi b/doc/filters.texi index c53bf0c60d..d4c564b3f0 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -25703,6 +25703,43 @@ ffmpeg -i "http://streams.videolan.org/samples/sub/SSA/subtitle_testing_complex. @end example @end itemize +@section stripstyles + +Remove all inline styles from subtitle events. + +Inputs: +@itemize +@item 0: Subtitles[TEXT] +@end itemize + +Outputs: +@itemize +@item 0: Subtitles[TEXT] +@end itemize + +It accepts the following parameters: + +@table @option +@item remove_animated +Also remove text which is subject to animation (default: true) +Usually, animated text elements are used used in addition to static subtitle lines for creating effects, so in most cases it is safe to remove the animation content. +If subtitle text is missing, try setting this to false. + +@item select_layer +Process only ASS subtitle events from a specific layer. This allows to filter out certain effects where an ASS author duplicates the text onto multiple layers. + +@end table + +@subsection Examples + +@itemize +@item +Remove styles and animations from ASS subtitles and output events from ass layer 0 only. Then convert asn save as SRT stream: +@example +ffmpeg -i "https://streams.videolan.org/samples/sub/SSA/subtitle_testing_complex.mkv" -filter_complex "[0:1]stripstyles=select_layer=0" -map 0 -c:s srt output.mkv +@end example +@end itemize + @section textmod diff --git a/libavfilter/Makefile b/libavfilter/Makefile index d2995fbec6..7d7da0c59a 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -557,6 +557,7 @@ OBJS-$(CONFIG_NULLSINK_FILTER) += vsink_nullsink.o OBJS-$(CONFIG_CENSOR_FILTER) += sf_textmod.o OBJS-$(CONFIG_SHOW_SPEAKER_FILTER) += sf_textmod.o OBJS-$(CONFIG_TEXTMOD_FILTER) += sf_textmod.o +OBJS-$(CONFIG_STRIPSTYLES_FILTER) += sf_stripstyles.o # multimedia filters OBJS-$(CONFIG_ABITSCOPE_FILTER) += avf_abitscope.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 673f9fb839..27680a2f00 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -546,6 +546,7 @@ extern const AVFilter ff_avf_showwavespic; extern const AVFilter ff_vaf_spectrumsynth; extern const AVFilter ff_sf_censor; extern const AVFilter ff_sf_showspeaker; +extern const AVFilter ff_sf_stripstyles; extern const AVFilter ff_sf_textmod; extern const AVFilter ff_svf_graphicsub2video; extern const AVFilter ff_svf_textsub2video; diff --git a/libavfilter/sf_stripstyles.c b/libavfilter/sf_stripstyles.c new file mode 100644 index 0000000000..82cb9c7647 --- /dev/null +++ b/libavfilter/sf_stripstyles.c @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2021 softworkz + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * text subtitle filter which removes inline-styles from subtitles + */ + +#include "libavutil/opt.h" +#include "internal.h" +#include "libavutil/ass_split_internal.h" +#include "libavutil/bprint.h" + +typedef struct StripStylesContext { + const AVClass *class; + enum AVSubtitleType format; + int remove_animated; + int select_layer; +} StripStylesContext; + +typedef struct DialogContext { + StripStylesContext* ss_ctx; + AVBPrint buffer; + int drawing_scale; + int is_animated; +} DialogContext; + +static void dialog_text_cb(void *priv, const char *text, int len) +{ + DialogContext *s = priv; + + av_log(s->ss_ctx, AV_LOG_DEBUG, "dialog_text_cb: %s\n", text); + + if (!s->drawing_scale && (!s->is_animated || !s->ss_ctx->remove_animated)) + av_bprint_append_data(&s->buffer, text, len); +} + +static void dialog_new_line_cb(void *priv, int forced) +{ + DialogContext *s = priv; + if (!s->drawing_scale && !s->is_animated) + av_bprint_append_data(&s->buffer, forced ? "\\N" : "\\n", 2); +} + +static void dialog_drawing_mode_cb(void *priv, int scale) +{ + DialogContext *s = priv; + s->drawing_scale = scale; +} + +static void dialog_animate_cb(void *priv, int t1, int t2, int accel, char *style) +{ + DialogContext *s = priv; + s->is_animated = 1; +} + +static void dialog_move_cb(void *priv, int x1, int y1, int x2, int y2, int t1, int t2) +{ + DialogContext *s = priv; + if (t1 >= 0 || t2 >= 0) + s->is_animated = 1; +} + +static const ASSCodesCallbacks dialog_callbacks = { + .text = dialog_text_cb, + .new_line = dialog_new_line_cb, + .drawing_mode = dialog_drawing_mode_cb, + .animate = dialog_animate_cb, + .move = dialog_move_cb, +}; + +static char *ass_get_line(int readorder, int layer, const char *style, + const char *speaker, const char *effect, const char *text) +{ + return av_asprintf("%d,%d,%s,%s,0,0,0,%s,%s", + readorder, layer, style ? style : "Default", + speaker ? speaker : "", effect, text); +} + +static char *process_dialog(StripStylesContext *s, const char *ass_line) +{ + DialogContext dlg_ctx = { .ss_ctx = s }; + ASSDialog *dialog = avpriv_ass_split_dialog(NULL, ass_line); + char *result = NULL; + + if (!dialog) + return NULL; + + if (s->select_layer >= 0 && dialog->layer != s->select_layer) + return NULL; + + dlg_ctx.ss_ctx = s; + + av_bprint_init(&dlg_ctx.buffer, 0, AV_BPRINT_SIZE_UNLIMITED); + + avpriv_ass_split_override_codes(&dialog_callbacks, &dlg_ctx, dialog->text); + + if (av_bprint_is_complete(&dlg_ctx.buffer) + && dlg_ctx.buffer.len > 0) + result = ass_get_line(dialog->readorder, dialog->layer, dialog->style, dialog->name, dialog->effect, dlg_ctx.buffer.str); + + av_bprint_finalize(&dlg_ctx.buffer, NULL); + avpriv_ass_free_dialog(&dialog); + + return result; +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *frame) +{ + StripStylesContext *s = inlink->dst->priv; + AVFilterLink *outlink = inlink->dst->outputs[0]; + int ret; + + outlink->format = inlink->format; + + ret = av_frame_make_writable(frame); + if (ret <0 ) { + av_frame_free(&frame); + return AVERROR(ENOMEM); + } + + for (unsigned i = 0; i < frame->num_subtitle_areas; i++) { + + AVSubtitleArea *area = frame->subtitle_areas[i]; + + if (area->ass) { + char *tmp = area->ass; + area->ass = process_dialog(s, area->ass); + + if (area->ass) { + av_log(inlink->dst, AV_LOG_INFO, "original: %d %s\n", i, tmp); + av_log(inlink->dst, AV_LOG_INFO, "stripped: %d %s\n", i, area->ass); + } + else + area->ass = NULL; + + av_free(tmp); + } + } + + return ff_filter_frame(outlink, frame); +} + +#define OFFSET(x) offsetof(StripStylesContext, x) +#define FLAGS (AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_FILTERING_PARAM) + +static const AVOption stripstyles_options[] = { + { "remove_animated", "remove animated text (default: yes)", OFFSET(remove_animated), AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, FLAGS, 0 }, + { "select_layer", "process a specific ass layer only", OFFSET(remove_animated), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, FLAGS, 0 }, + { NULL }, +}; + +AVFILTER_DEFINE_CLASS(stripstyles); + +static const AVFilterPad inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_SUBTITLE, + .filter_frame = filter_frame, + }, +}; + +static const AVFilterPad outputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_SUBTITLE, + }, +}; + +const AVFilter ff_sf_stripstyles = { + .name = "stripstyles", + .description = NULL_IF_CONFIG_SMALL("Strip subtitle inline styles"), + .priv_size = sizeof(StripStylesContext), + .priv_class = &stripstyles_class, + FILTER_INPUTS(inputs), + FILTER_OUTPUTS(outputs), + FILTER_SINGLE_SUBFMT(AV_SUBTITLE_FMT_ASS), +}; +