From patchwork Fri Sep 24 00:31:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soft Works X-Patchwork-Id: 30531 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp988400iob; Thu, 23 Sep 2021 17:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzA0qM0lLWToypQTdGXzm/xgXPRpXKpbhh6x5Y179vD3GMzCInM4VhR4b3Y1BVKxaXKb4Tz X-Received: by 2002:a17:906:688a:: with SMTP id n10mr8247602ejr.389.1632443572803; Thu, 23 Sep 2021 17:32:52 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 7si7465144ejk.642.2021.09.23.17.32.52; Thu, 23 Sep 2021 17:32:52 -0700 (PDT) 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=K6jG0TFH; 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 D82F168A5C0; Fri, 24 Sep 2021 03:31:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2099.outbound.protection.outlook.com [40.92.18.99]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7649568A58D for ; Fri, 24 Sep 2021 03:31:21 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q3VnUbI+T8yUWOr3DTJITo/DBa+/Ywupr9xogIz1JwDkwiWuCoxhtuYYkupfS93Lu7xudEIJ3B/w8NJZ2Qp9r4oOlsVfNvg43EGeXvBSxJitd3jSemZ+4aG9Y7GbDj/LwciiQgkrdYCONE/rtjWdYl5ZH3ZWmNvE+fIFCbWnW+G3HL0vDI8ejhdN3W/MucPPuUQPdKQJzGYhVyqTLnaXJuV93121+yriWKdVqh2N9GarKXDN3jE0O8WzOdPlCi/gH/LMGpPAcMVP4Gu0HomBrQh7ihTgotSMqL987CxeK3YcqaaeBMo1isRb86nE+ZzVq491vByDyfSDiVOXqo5ZBw== 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; bh=Dr4yOfSi9qDtC6iQiY3JOa16sK2ljETANPfsGtExJbM=; b=iSfSXULCXp37Psgb/U9p4Lu05im7RyjuZcWiyNyaj2U9WE2UonWrVs0cVN1+CklWXYmx7+PXRrvAL5ZF4ltu7FK56dQLBle+k1/N7J/87wnmE+3TAGIe8ZUdXML+YsQXchF0kJs6BC2gFVfSdWKz5j/Zf8ccGFiKkg2HEtZ5EHaoIDqpuw7wSR1jD+sKa4zgOm0nUIgi0kG9RWayYuTROyWcMojxwRb0RMIew7RBbZxYihf5OBOyzWeuF5DVAPKcJrvCtd/dxMWMjVio8X0eBHdqhFRG7lzeWghGKMyuX8p4TFRUlR/e7QXt94/tbjmqG7q6xMU39VZQE22XNOYCoA== 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=Dr4yOfSi9qDtC6iQiY3JOa16sK2ljETANPfsGtExJbM=; b=K6jG0TFH5Q6aGqdZn0fK/UFga6BI8VJL2LYwXV73Y572UAuzIIPvWE1yl5qhuP5GsID8qwWVvwackx1ZtizKInDzkJFrM4mQcmjmG7lMboaTKB0LZf8LPBqnrlD3Qw0DYg1FfS+ybA2+sFfW1mq6NvmcdHMtzAdOpJGe57YehLkVnUeaA5p2OrAwiDOSwIcBPClWukzEQtYw3a6Twj/5wWk3voJAl5Fg3RTJwkZ8q7ZelDh0JE+lnBXxpJlu39AQZe19744VlQxv5Cd3t8sMFCV3HtJ6fx0m8uZSHsPJsnJ3nWazTCgXfk4/OHz61o0OdUC1O8VU0Nv/oF+NqlffXw== Received: from MN2PR04MB5981.namprd04.prod.outlook.com (2603:10b6:208:da::10) by MN2PR04MB5743.namprd04.prod.outlook.com (2603:10b6:208:38::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Fri, 24 Sep 2021 00:31:18 +0000 Received: from MN2PR04MB5981.namprd04.prod.outlook.com ([fe80::ecfe:2528:2012:22cb]) by MN2PR04MB5981.namprd04.prod.outlook.com ([fe80::ecfe:2528:2012:22cb%5]) with mapi id 15.20.4544.015; Fri, 24 Sep 2021 00:31:18 +0000 From: Soft Works To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH v9 12/13] avfilter/split_cc: Add split_cc filter for closed caption handling Thread-Index: AQHXsNt9gLj6YJHvNkunbCw9ZbxDCQ== Date: Fri, 24 Sep 2021 00:31:18 +0000 Message-ID: References: <5bc443d3efba607cef8020fdacce3fbec59514b7.1632443311.git.softworkz@hotmail.com> <74b7003baacf9847f879d785c002e4a78293f57c.1632443311.git.softworkz@hotmail.com> <2b7a471b8c1a6fe4ce2c4133710261ecafbbf13d.1632443311.git.softworkz@hotmail.com> <64913621bc7223946c513126a1abe0ea2001d6f5.1632443311.git.softworkz@hotmail.com> <20dacbb0f094ee36ce241dbe938b7722bb6957e9.1632443311.git.softworkz@hotmail.com> In-Reply-To: <20dacbb0f094ee36ce241dbe938b7722bb6957e9.1632443311.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: [cct1u82zWqR9P8Qvq5VZkCGL7R0MtWGB] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fe01395d-efff-4db9-a046-08d97ef2a075 x-ms-traffictypediagnostic: MN2PR04MB5743: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ymj5xg3WV13WuRU4GXO97hjaPw0ftD8sovhNhipn77BSKqXPKFH/sKPnQ+AQjMw9/AW1g6nLkOJyrYd8Mr9IUGkkg706HJ3LffIH/H1r5Xpc9ygW36x460cp8NGEUTJM7KL2WA26+Z2bXbiL6mG0Ort84Qnf0qHBAa0jT+XWEGbiSF0wHpte+7CO+4+S7onHgnE6QmaG3+AL/wMXBThd2xSem5ApIuYWVIQaQphIoDYlEWlYWW4SOVXFtP2y5RH6PLubcA3pKwhbEX/4uAlO0CgVIwoC1ehVvOgB957O5cltlmRD9zaRQqTP1/Ss0ZfS3ZlyvCMzKFH60HCXorrJQPPheggrGDkBZePB3CnMrfvqnl1Xjpm4Qd2kUW+tlSN0OgkCZJtQlREtUlGwd6pZY6xiCkLLB6cXYEb/L1fu4PHiYaQpy3fIC0LzRMMzYgfdLFWS3kXo0PcoY3MxyYbWk8fEBGZ1EZoVdczx8ncs68XPyRbhKP+9R4OhDPQb/kfpRowb99P9v/VBKgy0jcmQig== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: GJaNzn+4OgBmt5fudgA4cHo6kY27royn6rH8/IMl63gfbcZCblYfNh258OT9IwFX7RzlAhEE1y7bnDuEmQhqRMy3ia749yD0Iww0D04r+lExwnCSlG+PXwEa3pL1idsKtciqKJ/csi5ZQXpSUtgm3g== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-529c7.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB5981.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: fe01395d-efff-4db9-a046-08d97ef2a075 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2021 00:31:18.7915 (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: MN2PR04MB5743 Subject: [FFmpeg-devel] [PATCH v9 12/13] avfilter/split_cc: Add split_cc filter for closed caption handling 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: NYdg5gO08H/w - split_cc {V -> VS) Extract closed-caption (A53) data from video frames as subtitle Frames ffmpeg -y -loglevel verbose -i "https://streams.videolan.org/streams/ts/CC/NewsStream-608-ac3.ts" -filter_complex "[0:v]split_cc[vid1],textmod=mode=remove_chars:find='@',[vid1]overlay_textsubs" output.mkv Signed-off-by: softworkz --- configure | 1 + doc/filters.texi | 45 ++++++ libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/sf_split_cc.c | 298 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 346 insertions(+) create mode 100644 libavfilter/sf_split_cc.c diff --git a/configure b/configure index 37fc4c20e7..6da059e6ee 100755 --- a/configure +++ b/configure @@ -3663,6 +3663,7 @@ spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp" sr_filter_deps="avformat swscale" sr_filter_select="dnn" stereo3d_filter_deps="gpl" +split_cc_filter_deps="cc_dec_decoder" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" diff --git a/doc/filters.texi b/doc/filters.texi index 2d3dcdd7e6..c48e1fcf11 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -25378,6 +25378,16 @@ string containing ASS style format @code{KEY=VALUE} couples separated by ",". @end table +@subsection Examples + +@itemize +@item +Overlay ASS subtitles with animations: +@example +ffmpeg -i "http://streams.videolan.org/samples/sub/SSA/subtitle_testing_complex.mkv" -filter_complex "[0:v]overlay_textsubs" -map 0 -y out.mkv +@end example +@end itemize + @section show_speaker Prepend speaker names to subtitle lines (when available). @@ -25441,6 +25451,41 @@ ffmpeg -i INPUT -filter_complex "show_speaker=format=colon:style='@{\\c&HDD0000& @end example @end itemize + +@section split_cc + +Split-out closed-caption/A53 subtitles from video frame side data. + +This filter provides an input and an output for video frames, which are just passed through without modification. +The second out provides subtitle frames which are extracted from video frame side data. + +Inputs: +- 0: Video + +Outputs: +- 0: Video (same as input) +- 1: Subtitles [text] + +It accepts the following parameters: + +@table @option + +@item use_cc_styles +Emit closed caption style header. This will make closed captions look like on normal TV devices. +(white font on black background rectangles) + +@end table + +@subsection Examples + +@itemize +@item +Extract closed captions as text subtitle stream and overlay it onto the video: +@example +ffmpeg -i "https://streams.videolan.org/streams/ts/CC/NewsStream-608-ac3.ts" -filter_complex "[0:v:0]split_cc[vid1][sub1];[vid1][sub1]overlay_textsubs" output.mkv +@end example +@end itemize + @section textsub2video Converts text subtitles to video frames. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 309c404bf7..39abf6d2a6 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -540,6 +540,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_SPLIT_CC_FILTER) += sf_split_cc.o OBJS-$(CONFIG_STRIPSTYLES_FILTER) += sf_stripstyles.o # multimedia filters diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index b482f68286..802465fce2 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -528,6 +528,7 @@ extern const AVFilter ff_avf_showwavespic; extern const AVFilter ff_vaf_spectrumsynth; extern const AVFilter ff_sf_censor; extern const AVFilter ff_sf_show_speaker; +extern const AVFilter ff_sf_split_cc; extern const AVFilter ff_sf_stripstyles; extern const AVFilter ff_sf_textmod; extern const AVFilter ff_svf_graphicsub2video; diff --git a/libavfilter/sf_split_cc.c b/libavfilter/sf_split_cc.c new file mode 100644 index 0000000000..d96912a90b --- /dev/null +++ b/libavfilter/sf_split_cc.c @@ -0,0 +1,298 @@ +/* + * 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 + * subtitle filter for splitting out closed-caption/A53 subtitles from video frame side data + */ + +#include "libavutil/opt.h" +#include "subtitles.h" +#include "libavcodec/avcodec.h" + +typedef struct SplitCaptionsContext { + const AVClass *class; + enum AVSubtitleType format; + AVCodecContext *cc_dec; + int eof; + AVFrame *next_sub_frame; + int new_frame; + AVBufferRef *subtitle_header; + int use_cc_styles; +} SplitCaptionsContext; + +static int init(AVFilterContext *ctx) +{ + SplitCaptionsContext *s = ctx->priv; + + int ret; + const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_EIA_608); + if (!codec) { + av_log(ctx, AV_LOG_ERROR, "failed to find EIA-608/708 decoder\n"); + return AVERROR_DECODER_NOT_FOUND; + } + + if (!((s->cc_dec = avcodec_alloc_context3(codec)))) { + av_log(ctx, AV_LOG_ERROR, "failed to allocate EIA-608/708 decoder\n"); + return AVERROR(ENOMEM); + } + + if ((ret = avcodec_open2(s->cc_dec, codec, NULL)) < 0) { + av_log(ctx, AV_LOG_ERROR, "failed to open EIA-608/708 decoder: %i\n", ret); + return ret; + } + + if (s->use_cc_styles && s->cc_dec->subtitle_header && s->cc_dec->subtitle_header[0] != 0) { + char* subtitle_header = av_strdup((char *)s->cc_dec->subtitle_header); + if (!subtitle_header) + return AVERROR(ENOMEM); + s->subtitle_header = av_buffer_create((uint8_t *)subtitle_header, strlen(subtitle_header) + 1, NULL, NULL, 0); + if (!s->subtitle_header) { + av_free(subtitle_header); + return AVERROR(ENOMEM); + } + } + + return 0; +} + +static void uninit(AVFilterContext *ctx) +{ + SplitCaptionsContext *s = ctx->priv; + av_frame_free(&s->next_sub_frame); +} + +static int config_input(AVFilterLink *link) +{ + const SplitCaptionsContext *context = link->dst->priv; + + if (context->cc_dec) + context->cc_dec->pkt_timebase = link->time_base; + + return 0; +} + +static int query_formats(AVFilterContext *ctx) +{ + AVFilterFormats *formats; + AVFilterLink *inlink0 = ctx->inputs[0]; + AVFilterLink *outlink0 = ctx->outputs[0]; + AVFilterLink *outlink1 = ctx->outputs[1]; + static const enum AVSubtitleType subtitle_fmts[] = { AV_SUBTITLE_FMT_ASS, AV_SUBTITLE_FMT_NB }; + int ret; + + /* set input0 video formats */ + formats = ff_all_formats(AVMEDIA_TYPE_VIDEO); + if ((ret = ff_formats_ref(formats, &inlink0->outcfg.formats)) < 0) + return ret; + + /* set output0 video formats */ + if ((ret = ff_formats_ref(formats, &outlink0->incfg.formats)) < 0) + return ret; + + /* set output1 subtitle formats */ + formats = ff_make_format_list(subtitle_fmts); + if ((ret = ff_formats_ref(formats, &outlink1->incfg.formats)) < 0) + return ret; + + return 0; +} + +static int config_sub_output(AVFilterLink *outlink) +{ + const AVFilterLink *inlink = outlink->src->inputs[0]; + + outlink->time_base = inlink->time_base; + outlink->format = AV_SUBTITLE_FMT_ASS; + + return 0; +} + +static int request_sub_frame(AVFilterLink *outlink) +{ + SplitCaptionsContext *s = outlink->src->priv; + + if (s->eof) + return AVERROR_EOF; + + if (s->next_sub_frame && s->new_frame) { + AVFrame *out; + s->next_sub_frame->pts++; + + out = av_frame_clone(s->next_sub_frame); + if (!out) + return AVERROR(ENOMEM); + + out->subtitle_pts = av_rescale_q(s->next_sub_frame->pts, outlink->time_base, AV_TIME_BASE_Q); + s->new_frame = 0; + + return ff_filter_frame(outlink, out); + } + + return 0; +} + +static int decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) +{ + int ret; + + *got_frame = 0; + + if (pkt) { + ret = avcodec_send_packet(avctx, pkt); + // In particular, we don't expect AVERROR(EAGAIN), because we read all + // decoded frames with avcodec_receive_frame() until done. + if (ret < 0 && ret != AVERROR_EOF) + return ret; + } + + ret = avcodec_receive_frame(avctx, frame); + if (ret < 0 && ret != AVERROR(EAGAIN)) + return ret; + if (ret >= 0) + *got_frame = 1; + + return 0; +} + +static int filter_frame(AVFilterLink *inlink, AVFrame *frame) +{ + AVFrameSideData *sd; + SplitCaptionsContext *s = inlink->dst->priv; + AVFilterLink *outlink0 = inlink->dst->outputs[0]; + AVFilterLink *outlink1 = inlink->dst->outputs[1]; + AVPacket *pkt; + AVFrame *sub_out; + + int ret; + + outlink0->format = inlink->format; + + sd = av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC); + + if (sd) { + int got_output = 0; + + pkt = av_packet_alloc(); + pkt->buf = av_buffer_ref(sd->buf); + if (!pkt->buf) { + ret = AVERROR(ENOMEM); + goto fail; + } + + pkt->data = sd->data; + pkt->size = (int)sd->size; + pkt->pts = frame->pts; + + sub_out = ff_get_subtitles_buffer(outlink1, AV_SUBTITLE_FMT_ASS); + if (!sub_out) { + ret = AVERROR(ENOMEM); + goto fail; + } + + if ((ret = av_buffer_replace(&sub_out->subtitle_header, s->subtitle_header)) < 0) + goto fail; + + ret = decode(s->cc_dec, sub_out, &got_output, pkt); + + if (ret < 0) + goto fail; + + if (got_output) { + sub_out->pts = frame->pts; + av_frame_free(&s->next_sub_frame); + s->next_sub_frame = sub_out; + sub_out = NULL; + s->new_frame = 1; + + ret = request_sub_frame(outlink1); + if (ret < 0) + goto fail; + } + } + + if (!s->next_sub_frame) { + s->next_sub_frame = ff_get_subtitles_buffer(outlink1, outlink1->format); + if (!s->next_sub_frame) { + ret = AVERROR(ENOMEM); + goto fail; + } + + s->next_sub_frame->subtitle_end_time = 100; + s->next_sub_frame->pts = frame->pts; + s->new_frame = 1; + + if ((ret = av_buffer_replace(&s->next_sub_frame->subtitle_header, s->subtitle_header)) < 0) + goto fail; + } + else + s->next_sub_frame->pts = frame->pts; + + ret = ff_filter_frame(outlink0, frame); + +fail: + av_packet_free(&pkt); + av_frame_free(&sub_out); + return ret; +} + +#define OFFSET(x) offsetof(SplitCaptionsContext, x) +#define FLAGS (AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_FILTERING_PARAM) + +static const AVOption split_cc_options[] = { + { "use_cc_styles", "Emit closed caption style header", OFFSET(use_cc_styles), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS, NULL }, + { NULL }, +}; + +AVFILTER_DEFINE_CLASS(split_cc); + +static const AVFilterPad inputs[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .filter_frame = filter_frame, + .config_props = config_input, + }, +}; + +static const AVFilterPad outputs[] = { + { + .name = "video_passthrough", + .type = AVMEDIA_TYPE_VIDEO, + }, + { + .name = "subtitles", + .type = AVMEDIA_TYPE_SUBTITLE, + .request_frame = request_sub_frame, + .config_props = config_sub_output, + }, +}; + +const AVFilter ff_sf_split_cc = { + .name = "split_cc", + .description = NULL_IF_CONFIG_SMALL("Extract closed-caption (A53) data from video as subtitle stream."), + .init = init, + .uninit = uninit, + .query_formats = query_formats, + .priv_size = sizeof(SplitCaptionsContext), + .priv_class = &split_cc_class, + FILTER_INPUTS(inputs), + FILTER_OUTPUTS(outputs), +};