From patchwork Wed Jun 17 13:45:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 20435 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id EBF3944B8BB for ; Wed, 17 Jun 2020 17:11:15 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C282C68B3AF; Wed, 17 Jun 2020 17:11:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C0B8B68B393 for ; Wed, 17 Jun 2020 17:11:08 +0300 (EEST) Received: by mail-lj1-f195.google.com with SMTP id 9so3031885ljc.8 for ; Wed, 17 Jun 2020 07:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=j+CGQE1XMu9kzXBJ3PAIBz4Sj1YX3EpyAWtMwj3mC4U=; b=XdPnDUgBPtyBwggwajVV12VIPkgpHnKeF/ydEF3SYmwQjmcDJks5l4ElJnkfcA5D2M 02zsKHsHwLoCI5qs0CEhtawgf6NwwmwsUUwWWk1x4xTNAsJMLQPQZlhv/8JRKwntLgup BUU25TUYea2LyeuSi39sk90ylJ46GKHbU86TT0qNUTsdcvwT8zUQ0Jev+bDfrK/XTQfj /DjEIeswQ0eXolexZCW8MMN/goujOuEe2G14XWhrkpsTExc49h5wJOlDv8HCLOguc07Y HIgdsqOje0Us6PflmNbHfMe8eH3qEc26xxZYB05pava+th2QcvoZ3HbDeE61UMwZpHWJ vEhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=j+CGQE1XMu9kzXBJ3PAIBz4Sj1YX3EpyAWtMwj3mC4U=; b=K2caVEMP8t4utb9wKQnPQ/m6lqmQTr61l9W4OSo0iI37qTwG0GRkxMJCpz7wtOWetH 4u3ZMjhvyvxk0LkzavNLzGiKTzK2PorZTw7ZrhuX5e6yqBXfXGjxijTzJyfJqhj/X4ny nHetEGnh1/8uYZdZ9PTc+xwEFwpBgmOnizJ0zE60dpozS3IWNrrfHVxIlY1UHGRD32Dr ETLatQumVYiQMxTcyyFxQ3GXaBdpdU+4uIi/7eWpsvHBSLlxvGOiJwlYYRRgSZv2kreA afPZDSvwTM/2A+plIcEk5HROYBUOW7tjQnG2xc3oM9FFMZmlJWlChjE4AVINUTCb2fVt eY4g== X-Gm-Message-State: AOAM531RqxhlNSwgoKv6YeZx6ylGPf3tidLm6m21MtgHhgSk+cvt3xQu B0Rv0teMEvTtumTYIbDokuNJe0bU X-Google-Smtp-Source: ABdhPJwk1arvaBukwNWqf7qX0rV8glETJn5IzIxYfOXp0y1YwOHSglZvcusC3N3VN2ek5vq8NEFEIw== X-Received: by 2002:adf:e84e:: with SMTP id d14mr8318407wrn.31.1592401555290; Wed, 17 Jun 2020 06:45:55 -0700 (PDT) Received: from localhost.localdomain ([82.129.83.65]) by smtp.gmail.com with ESMTPSA id s2sm470876wmh.11.2020.06.17.06.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jun 2020 06:45:54 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Jun 2020 14:45:43 +0100 Message-Id: <20200617134543.89105-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.27.0.rc2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/movenc: Write 'av01' as a compatible brand when muxing AV1 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" This is a requirement of the AV1-ISOBMFF spec. Section 2.1. General Requirements & Brands states: * It SHALL have the av01 brand among the compatible brands array of the FileTypeBox Signed-off-by: Derek Buitenhuis --- libavformat/movenc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 520aaafb74..ddec551017 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4875,7 +4875,7 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s) { MOVMuxContext *mov = s->priv_data; int64_t pos = avio_tell(pb); - int has_h264 = 0, has_video = 0; + int has_h264 = 0, has_av1 = 0, has_video = 0; int i; for (i = 0; i < s->nb_streams; i++) { @@ -4886,6 +4886,8 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s) has_video = 1; if (st->codecpar->codec_id == AV_CODEC_ID_H264) has_h264 = 1; + if (st->codecpar->codec_id == AV_CODEC_ID_AV1) + has_av1 = 1; } avio_wb32(pb, 0); /* size */ @@ -4925,6 +4927,8 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s) ffio_wfourcc(pb, "iso2"); if (has_h264) ffio_wfourcc(pb, "avc1"); + if (has_av1) + ffio_wfourcc(pb, "av01"); } }