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 D3DD8446AB for ; Tue, 20 Sep 2022 21:17:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 730C568BAA4; Wed, 21 Sep 2022 00:17:22 +0300 (EEST) Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20C2268B6BE for ; Wed, 21 Sep 2022 00:17:17 +0300 (EEST) Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-34558a60c39so34000997b3.16 for ; Tue, 20 Sep 2022 14:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=8EBzDualL9tVzRdyhU+FOCWlCBredjx00kKmUfVOgvU=; b=GhM0ay/Spp7baffdXvghDe47x88Nv5X6oAYSZDjwn0XT3Ips0mzm+5XKQE01sLG6kg aPO3kXHPd8u2CB+w30tgb8SL3RILdpYqF/ZUU4eroio332verqmHwVqHXLMzxXH9JZqW Oq1swqflJuBvVkie3Q6ydymUhV96NhJ3mFPa7ViBl8gH4pbyBDxhaIfgozgeQUB5mQDj gbsOMP88oT4LiMRd569Q9XdrLgtscxJIj5HbYpaZA/e0dESPqfaGB4ZoshGYCKvZwTmN gnX0n1gSOO8DwiuozDeB9U9GlQDu6VgCwz3dso2KQk5cJX79T6HC2YpYNiA6BSq+TXGy cHDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=8EBzDualL9tVzRdyhU+FOCWlCBredjx00kKmUfVOgvU=; b=m0nbx9rBvMehbW4p/Og+QJR54hfD0TXG16hbtoESMHV6MaxzhsaIicmV37Az+X9WF/ W2LqGnpCCsAVTyHsMay9AhappQ5yWtIAFXG6daF7lLo9TxdrhRVNriLHyH0tJg2INd/+ XvAM9Y88TPuA8Tu3YLoW7WPeP6p151pMDBhp34QScnNX2yDhTahqyl9LjjRXcJa9hyQV agnQr/DK5ZbfFrNjXxwXu561EkbiEuDMIrEnfpfYTDL1wY4wwauVKiJKzsoERAcdEDB+ uB64DbNLYIPAIGLPJk//tL23GeuaxQ0sQT1YDSOw8/G115dP18lWcdyLufPqq8OSDI43 werA== X-Gm-Message-State: ACrzQf0ajzy3FuLeZW36+yKdSHNr5JlCpuDVVPvKgP9mykKV/gDYwv6f 8bLmZKKrZ3TxzcQbmhuI1So53JDzN3CV4MMZm+35LUAuWzOhCVu/fUfvcYZI2XZtj8Xbd7PvUMk Rg0MUYulrHLU/F3oSi+YuSAG7gowZeyCVHfcuObL0auMfWShzNeWmwAufKX4yNfUkmc8q X-Google-Smtp-Source: AMsMyM5rn9L1UORSpUFWsYd3HSWxj+kyulxXrlWPDnKeBOEeRgSrOv85EoZoTzxdf25a+3x3YfB9zZZcjokRJg== X-Received: from vigneshv3.mtv.corp.google.com ([2620:0:1000:2511:1439:d92:5527:7805]) (user=vigneshv job=sendgmr) by 2002:a25:2342:0:b0:6ae:b056:17fd with SMTP id j63-20020a252342000000b006aeb05617fdmr19736628ybj.582.1663708635216; Tue, 20 Sep 2022 14:17:15 -0700 (PDT) Date: Tue, 20 Sep 2022 14:17:11 -0700 In-Reply-To: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog Message-ID: <20220920211711.640518-1-vigneshv@google.com> From: Vignesh Venkatasubramanian To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] avformat/movenc: Write auxi box for animated AVIF with alpha 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 Cc: Vignesh Venkatasubramanian 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: According to the HEIF specification (ISO/IEC 23008-12) Section 7.5.3.1, tracks with handler_type 'auxv' must contain a 'auxi' box in its SampleEntry to notify the nature of the auxiliary track to the decoder. The content is the same as the 'auxC' box. So parameterize and re-use the existing function. Signed-off-by: Vignesh Venkatasubramanian --- libavformat/movenc.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index c8b2e141cb..754f95912a 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2179,6 +2179,16 @@ static int mov_write_ccst_tag(AVIOContext *pb) return update_size(pb, pos); } +static int mov_write_aux_tag(AVIOContext *pb, const char *aux_type) +{ + int64_t pos = avio_tell(pb); + avio_wb32(pb, 0); /* size */ + ffio_wfourcc(pb, aux_type); + avio_wb32(pb, 0); /* Version & flags */ + avio_write(pb, "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0", 44); + return update_size(pb, pos); +} + static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int ret = AVERROR_BUG; @@ -2363,8 +2373,11 @@ static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex if (avid) avio_wb32(pb, 0); - if (track->mode == MODE_AVIF) + if (track->mode == MODE_AVIF) { mov_write_ccst_tag(pb); + if (s->nb_streams > 0 && track == &mov->tracks[1]) + mov_write_aux_tag(pb, "auxi"); + } return update_size(pb, pos); } @@ -3044,16 +3057,6 @@ static int mov_write_pixi_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatConte return update_size(pb, pos); } -static int mov_write_auxC_tag(AVIOContext *pb) -{ - int64_t pos = avio_tell(pb); - avio_wb32(pb, 0); /* size */ - ffio_wfourcc(pb, "auxC"); - avio_wb32(pb, 0); /* Version & flags */ - avio_write(pb, "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0", 44); - return update_size(pb, pos); -} - static int mov_write_ipco_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { int64_t pos = avio_tell(pb); @@ -3066,7 +3069,7 @@ static int mov_write_ipco_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatConte if (!i) mov_write_colr_tag(pb, &mov->tracks[0], 0); else - mov_write_auxC_tag(pb); + mov_write_aux_tag(pb, "auxC"); } return update_size(pb, pos); } -- 2.37.3.968.ga6b4b080e4-goog _______________________________________________ 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".