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 202BC41006 for ; Wed, 13 Apr 2022 17:22:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3C12C68B36E; Wed, 13 Apr 2022 20:22:14 +0300 (EEST) Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27CF168B1B2 for ; Wed, 13 Apr 2022 20:22:08 +0300 (EEST) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-2ebebe631ccso30262687b3.4 for ; Wed, 13 Apr 2022 10:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zZp9gRACZ9qjxCeCSewyjEZMFvkA6m0KMDqdP0B9bak=; b=Fc8e51sBy4dabkzHI2Ze8nd6Mjb3grUcnnIWdCk/VQo7Jw49XQ9cyYQqZenNY0QKHH aHgt2hZdFDR3pzktcwQ9AQCzMStjcQQNSaAi+EaheS78FN8bPvWXAnq2iKJ9Cq3/LJTk NaT5sRsU4mcgUutDo9XfuKjhk8CsqNW7/NTmGTqkYrZ01aCaNnw/xotsFkNstD4Oczp9 6NrZdG1sfRxJExc+3AfNtMwQPjgAiTzMTGzcH9Pp5geNEQL1lxU8Kq7+ANc0B2ROt1aS LjfPNoPFTW3CMryr838RnulhFn+9Rp3xtB2VMUIa1cLiPpN5XIFmSfRsyjhehH7CxPmL 3mNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zZp9gRACZ9qjxCeCSewyjEZMFvkA6m0KMDqdP0B9bak=; b=DKUnTnHfrMiJdNYl7K1VJgSvL36sN1qCt2wL/GkVWKTh3TrETQOu9KfLwv1AbqQ0Ek aDeXq2X4ZM0t63n923hiSULLZDFDkc5qt3NRDmSgOZbZEIShjUpyzMuZfJ+00P0wo9Es cJkrp6kgThkOGpOMdcEzBtN5TlmhQvRwcjajdE6NZ5u6c1KAoYHfJ3bo9CDZv7V81dHi Zc2e3u2cDEvA8E1IgXxSlA0EsZdQxetvqe6pAFHn5hEVgbjU3tc+OBQBZU4/5ioSxJRf wQi9tit+XNuEZxeKaDaUhjMoztpEvC4jP+y0EVjwuVE0jtHdeqOvZxxk4mLnsHA/Dlid lUPQ== X-Gm-Message-State: AOAM533Z5iYQhM3lmAmxOwfxTnyWsBn5yQNDoxXqOXSzV+R7ZCf+CogA cuwzfV8QvXWc12UfM8IASXTQBBeekka+2SCTcDbqe0dGGu0kcw== X-Google-Smtp-Source: ABdhPJxsmwMK0cyJab9d/woz6TDUlOxh+sWV7zQPTQfeNH3XYZmFVH4jgSOEW2wJ5PY7GVWbOxOE3/0Op/NSEMYyr8A= X-Received: by 2002:a0d:d844:0:b0:2ec:1ec9:205f with SMTP id a65-20020a0dd844000000b002ec1ec9205fmr13771347ywe.435.1649870525987; Wed, 13 Apr 2022 10:22:05 -0700 (PDT) MIME-Version: 1.0 References: <20220328204913.3343629-1-vigneshv@google.com> In-Reply-To: <20220328204913.3343629-1-vigneshv@google.com> From: James Zern Date: Wed, 13 Apr 2022 10:21:54 -0700 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH 3/3] avformat/movenc: Add support for AVIF muxing 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: On Mon, Mar 28, 2022 at 1:49 PM Vignesh Venkatasubramanian wrote: > > Add an AVIF muxer by re-using the existing the mov/mp4 muxer. > > AVIF Specifiation: https://aomediacodec.github.io/av1-avif > Specification > Sample usage for still image: > ffmpeg -i image.png -c:v libaom-av1 -avif-image 1 image.avif > > Sample usage for animated AVIF image: > ffmpeg -i video.mp4 animated.avif > > We can re-use any of the AV1 encoding options that will make > sense for image encoding (like bitrate, tiles, encoding speed, > etc). > > The files generated by this muxer has been verified to be valid > AVIF files by the following: > 1) Displays on Chrome (both still and animated images). > 2) Displays on Firefox (only still images, firefox does not support > animated AVIF yet). > 3) Verfied to be valid by Compliance Warden: Verified > https://github.com/gpac/ComplianceWarden > > Fixes the encoder/muxer part of Trac Ticket #7621 > > Signed-off-by: Vignesh Venkatasubramanian > --- > configure | 1 + > libavformat/allformats.c | 1 + > libavformat/movenc.c | 337 ++++++++++++++++++++++++++++++++++++--- > libavformat/movenc.h | 5 + > 4 files changed, 319 insertions(+), 25 deletions(-) > There might be some other issues, you can try tools/patcheck. > [...] > @@ -5068,6 +5231,31 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s) > // compatible brand a second time. > if (mov->mode == MODE_ISM) { > ffio_wfourcc(pb, "piff"); > + } else if (mov->mode == MODE_AVIF) { > + const AVPixFmtDescriptor *pix_fmt_desc = > + av_pix_fmt_desc_get(s->streams[0]->codecpar->format); > + const int depth = pix_fmt_desc->comp[0].depth; > + if (mov->is_animated_avif) { > + // For animated AVIF, major brand is "avis". Add "avif" as a > + // compatible brand. > + ffio_wfourcc(pb, "avif"); > + ffio_wfourcc(pb, "msf1"); > + ffio_wfourcc(pb, "iso8"); > + } > + ffio_wfourcc(pb, "mif1"); > + ffio_wfourcc(pb, "miaf"); > + if (depth == 8 || depth == 10) { > + // MA1B and MA1A brands are based on AV1 profile. Short hand for > + // computing that is based on chroma subsampling type. 420 chroma > + // subsampling is MA1B. 444 chroma subsampling is MA1A. > + if (pix_fmt_desc->log2_chroma_w == 0 && pix_fmt_desc->log2_chroma_h == 0) { !... is the preferred style. > @@ -6773,12 +6983,13 @@ static int mov_init(AVFormatContext *s) > pix_fmt == AV_PIX_FMT_MONOWHITE || > pix_fmt == AV_PIX_FMT_MONOBLACK; > } > - if (track->par->codec_id == AV_CODEC_ID_VP9 || > - track->par->codec_id == AV_CODEC_ID_AV1) { > - if (track->mode != MODE_MP4) { > - av_log(s, AV_LOG_ERROR, "%s only supported in MP4.\n", avcodec_get_name(track->par->codec_id)); > - return AVERROR(EINVAL); > - } > + if (track->par->codec_id == AV_CODEC_ID_VP9 && track->mode != MODE_MP4) { > + av_log(s, AV_LOG_ERROR, "%s only supported in MP4.\n", avcodec_get_name(track->par->codec_id)); > + return AVERROR(EINVAL); This is indented with tabs. _______________________________________________ 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".