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 E470C41035 for ; Wed, 13 Apr 2022 20:41:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E59BF68B459; Wed, 13 Apr 2022 23:41:52 +0300 (EEST) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E0CC68B272 for ; Wed, 13 Apr 2022 23:41:46 +0300 (EEST) Received: by mail-yb1-f178.google.com with SMTP id j2so5998604ybu.0 for ; Wed, 13 Apr 2022 13:41:46 -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=YltGRh+/pbL7Oq13+Sx3Co2RZuOdUpwYuQXCFeyCj9w=; b=G6m5yIhjlXcl/f7PCpOb/I5uEn4kAKH+btNot9z/vnwnzQpCEhUpVC8xDpOCJJ6EnN DNPqhqpues0oqjOoIRVW5O9Qz7G68McaKT08qb+2uuOKI8CXtyYopmPMWty4lYrfMj08 2OpY/rAPJwU9NLOulPPYI6McnoFErQfItLAxYXIEVu7HhAYwQ7j7FHgPL1MKT7iMSJtT LZJuqVb7g2+qMyaYKBGs7wEyOTggJIgwdrTk2hpEOHRMU3QTMVKoICYEVA8jPA2oGwPJ ITQqsiWdLM7TiJ5OqCdVhCiYmeyMTuKM3RrqSwnaulGRXoSemQbGsJeLXm8wz22nvyJa qbKg== 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=YltGRh+/pbL7Oq13+Sx3Co2RZuOdUpwYuQXCFeyCj9w=; b=U4I5z4l66m4ogII2VWvY9hKbR7uw+u4Eh9jpOUrROFroQXKUBZoqvO80viBDqwX8oo 6OpGx5I9XlUMATlqcoXMHYpgw2xXZicuWjs9ZIsN2OIDEw5tjtJ2bV0vXdqNCNqo+xmX 2XqyO3nVljk3TpoAxC2OAhmCRF3ZZGcLUiILO4d7KsmfBXd7YAgLEAtRPFf1V9tqFCf2 OsMS5AVKuqagyMvkbXXJ+CHOLNqUXoIm1ecFHc4RqwNTUxLi412QK2v1sjMrtI4lzrfP ZUVRNd0vOGHgbHDryDo47gu63kU1gb9LV9VbvdUJtyH3Anf7f0ZS52jHFGWG0JdVzYYt JVtQ== X-Gm-Message-State: AOAM5338mLlyoA6LzHAA+Q0pNwBnPmvUpxccfKGyuh+llIFTrIeOTWts w3QbiVtc64XQQXd7r6B8C0Dzoli+mX+d2giSlV/isuahemk= X-Google-Smtp-Source: ABdhPJx5XqEBIfFnanebexKhsFuDJj2XLZISvG44kDY3QfV3hqEWn/I878iEguUizB0HFGsaf5U9TAgCs24qBgSQESc= X-Received: by 2002:a25:6143:0:b0:641:17e7:616b with SMTP id v64-20020a256143000000b0064117e7616bmr593123ybb.41.1649882505179; Wed, 13 Apr 2022 13:41:45 -0700 (PDT) MIME-Version: 1.0 References: <20220328204913.3343629-1-vigneshv@google.com> In-Reply-To: From: Vignesh Venkatasubramanian Date: Wed, 13 Apr 2022 13:41:34 -0700 Message-ID: To: James Zern 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: 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 Wed, Apr 13, 2022 at 10:22 AM James Zern wrote: > > 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 > Fixed. > > 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 > Fixed. > > 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. > Thanks, i ran this and only found a couple of other "} before else-if" warnings. In those cases, i was just being consistent with the code around it. > > [...] > > @@ -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. Done. > > > @@ -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. Oops, fixed. -- Vignesh _______________________________________________ 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".