From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 8CB6144C43 for ; Fri, 13 Jan 2023 19:06:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4088168BC19; Fri, 13 Jan 2023 21:06:51 +0200 (EET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7EB7468BACA for ; Fri, 13 Jan 2023 21:06:45 +0200 (EET) Received: by mail-pf1-f179.google.com with SMTP id i65so13405846pfc.0 for ; Fri, 13 Jan 2023 11:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandflow-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=MaSpbUioOj3qwUcTYy1hEhE+nce6LTYpq8mbnAsLHOE=; b=DvWmjxS+XAycZTrfadsUl7VCosp06xGC7/ujmxodmWtWuGsIYxm0jb2yHHzuL3ph3a cIZlzeL+SIfgkeO74AzJL4ylyRJTArkSTAMwjssMWXuD/mqlXNSkuvJCIzj2i/88Ibes roIlgCeSIyyBf9cQbYkED7aR3046QcNhA4+vQDDzZWoBFRG1DSP7sjMWT1dWTQMlOc2e mPQsImerC1+XMvg/WQ5CkJAGBEPDBJ3ioeME8nCr691h16m0i+HasX0LQ9JhXcojSDiv +RKgsHMSja1pmMqAYvZdqx1im3Dm+zW1BMxu1hiDsHNdYCZxWAhK8ijBv3TFr1uL0qv3 o/qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MaSpbUioOj3qwUcTYy1hEhE+nce6LTYpq8mbnAsLHOE=; b=GP5wFcXMQGo35vpftgmcSI16ZGUQ+RyeY2Hfxk6du3K5UrKyAXRRZbgauKE5t7P7Uk udV9BA6CrdD7n7Ay1XB9aqXcktbQKxtyPLQjseJI/eYy4bMtwR+AImZe31GHjW2g4dtq UOhq0kVVuZB33TcBniCEEw+cfuiaBnXRxPaiaPvq0NxZ8pbgwFBti5ojJeieaXDvA0tg 40u5xwds0ao664pe8xbcgCpFQSUQ53XBFS+hzNU6fvmtMcbAIfwDU/GonzsAHl4hyTaA ggLX/poTMv7mUTFI31O97ztBFOeryxfIeGnKbzry+25I0JZz5E1y1JLSbDej9BcFkCH6 MT6Q== X-Gm-Message-State: AFqh2kpzD2LD/f5dqXo5cqD1rPaJhe0/AJOE1Rd8bP7zBKcd5j7JvDXQ ZW8IrdQdJ70sxAYicylufN5SgTnV+Qs0OjKk X-Google-Smtp-Source: AMrXdXtXLYaVbdKSR8r0mbQ4w6Xc4qAcvV2ve5/8olfa2lnTlSmjinN7f/ltrbGubsNA1ZQBepr/Eg== X-Received: by 2002:a05:6a00:26c8:b0:582:b3c9:efe with SMTP id p8-20020a056a0026c800b00582b3c90efemr36931383pfw.19.1673636802568; Fri, 13 Jan 2023 11:06:42 -0800 (PST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com. [209.85.210.181]) by smtp.gmail.com with ESMTPSA id b126-20020a62cf84000000b00574e84ed847sm3862710pfg.24.2023.01.13.11.06.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Jan 2023 11:06:41 -0800 (PST) Received: by mail-pf1-f181.google.com with SMTP id i65so13405783pfc.0 for ; Fri, 13 Jan 2023 11:06:41 -0800 (PST) X-Received: by 2002:a65:4942:0:b0:478:980a:53fb with SMTP id q2-20020a654942000000b00478980a53fbmr6095494pgs.484.1673636801458; Fri, 13 Jan 2023 11:06:41 -0800 (PST) MIME-Version: 1.0 References: <20230113172640.52901-1-rcombs@rcombs.me> In-Reply-To: <20230113172640.52901-1-rcombs@rcombs.me> From: Pierre-Anthony Lemieux Date: Fri, 13 Jan 2023 11:06:28 -0800 X-Gmail-Original-Message-ID: Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] lavf/matroska: add support for ARIB captions 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, Jan 13, 2023 at 9:27 AM rcombs wrote: > > Not yet ready for merge, pending finalization of the standard proposal for this mapping: > https://github.com/ietf-wg-cellar/matroska-specification/pull/724 Is sample ARIB caption available? > --- > libavformat/matroska.c | 1 + > libavformat/matroskadec.c | 30 ++++++++++++++++++++++++++++++ > libavformat/matroskaenc.c | 23 +++++++++++++++++++++++ > 3 files changed, 54 insertions(+) > > diff --git a/libavformat/matroska.c b/libavformat/matroska.c > index 90d94b65bf..79b2d09984 100644 > --- a/libavformat/matroska.c > +++ b/libavformat/matroska.c > @@ -76,6 +76,7 @@ const CodecTags ff_mkv_codec_tags[]={ > {"S_DVBSUB" , AV_CODEC_ID_DVB_SUBTITLE}, > {"S_HDMV/PGS" , AV_CODEC_ID_HDMV_PGS_SUBTITLE}, > {"S_HDMV/TEXTST" , AV_CODEC_ID_HDMV_TEXT_SUBTITLE}, > + {"S_ARIBSUB" , AV_CODEC_ID_ARIB_CAPTION}, > > {"V_AV1" , AV_CODEC_ID_AV1}, > {"V_AVS2" , AV_CODEC_ID_AVS2}, > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c > index d582f566a2..3a888e3ada 100644 > --- a/libavformat/matroskadec.c > +++ b/libavformat/matroskadec.c > @@ -50,6 +50,7 @@ > #include "libavutil/time_internal.h" > #include "libavutil/spherical.h" > > +#include "libavcodec/avcodec.h" > #include "libavcodec/bytestream.h" > #include "libavcodec/flac.h" > #include "libavcodec/mpeg4audio.h" > @@ -2813,6 +2814,35 @@ static int matroska_parse_tracks(AVFormatContext *s) > /* we don't need any value stored in CodecPrivate. > make sure that it's not exported as extradata. */ > track->codec_priv.size = 0; > + } else if (codec_id == AV_CODEC_ID_ARIB_CAPTION && track->codec_priv.size == 3) { > + int component_tag = track->codec_priv.data[0]; > + int data_component_id = AV_RB16(track->codec_priv.data + 1); > + > + switch (data_component_id) { > + case 0x0008: > + // [0x30..0x37] are component tags utilized for > + // non-mobile captioning service ("profile A"). > + if (component_tag >= 0x30 && component_tag <= 0x37) { > + st->codecpar->profile = FF_PROFILE_ARIB_PROFILE_A; > + } > + break; > + case 0x0012: > + // component tag 0x87 signifies a mobile/partial reception > + // (1seg) captioning service ("profile C"). > + if (component_tag == 0x87) { > + st->codecpar->profile = FF_PROFILE_ARIB_PROFILE_C; > + } > + break; > + default: > + break; > + } > + > + if (st->codecpar->profile == FF_PROFILE_UNKNOWN) > + av_log(matroska->ctx, AV_LOG_WARNING, > + "Unknown ARIB caption profile utilized: %02x / %04x\n", > + component_tag, data_component_id); > + > + track->codec_priv.size = 0; > } > track->codec_priv.size -= extradata_offset; > > diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c > index 2deb4284e8..67cfec761a 100644 > --- a/libavformat/matroskaenc.c > +++ b/libavformat/matroskaenc.c > @@ -58,6 +58,7 @@ > #include "libavutil/stereo3d.h" > > #include "libavcodec/av1.h" > +#include "libavcodec/avcodec.h" > #include "libavcodec/codec_desc.h" > #include "libavcodec/xiph.h" > #include "libavcodec/mpeg4audio.h" > @@ -1142,6 +1143,27 @@ static int mkv_assemble_native_codecprivate(AVFormatContext *s, AVIOContext *dyn > else > *size_to_reserve = MAX_PCE_SIZE; > break; > + case AV_CODEC_ID_ARIB_CAPTION: { > + unsigned stream_identifier, data_component_id; > + switch (par->profile) { > + case FF_PROFILE_ARIB_PROFILE_A: > + stream_identifier = 0x30; > + data_component_id = 0x0008; > + break; > + case FF_PROFILE_ARIB_PROFILE_C: > + stream_identifier = 0x87; > + data_component_id = 0x0012; > + break; > + default: > + av_log(s, AV_LOG_ERROR, > + "Unset/unknown ARIB caption profile %d utilized!\n", > + par->profile); > + return AVERROR_INVALIDDATA; > + } > + avio_w8(dyn_cp, stream_identifier); > + avio_wb16(dyn_cp, data_component_id); > + break; > + } > #endif > default: > if (CONFIG_MATROSKA_MUXER && par->codec_id == AV_CODEC_ID_PRORES && > @@ -3274,6 +3296,7 @@ static const AVCodecTag additional_subtitle_tags[] = { > { AV_CODEC_ID_DVB_SUBTITLE, 0xFFFFFFFF }, > { AV_CODEC_ID_DVD_SUBTITLE, 0xFFFFFFFF }, > { AV_CODEC_ID_HDMV_PGS_SUBTITLE, 0xFFFFFFFF }, > + { AV_CODEC_ID_ARIB_CAPTION, 0xFFFFFFFF }, > { AV_CODEC_ID_NONE, 0xFFFFFFFF } > }; > > -- > 2.38.1 > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".