From patchwork Tue Jul 30 20:19:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 14155 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 95D9B447006 for ; Tue, 30 Jul 2019 23:22:10 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 818F668A744; Tue, 30 Jul 2019 23:22:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B2AA568A408 for ; Tue, 30 Jul 2019 23:22:01 +0300 (EEST) Received: by mail-qk1-f196.google.com with SMTP id a27so47559323qkk.5 for ; Tue, 30 Jul 2019 13:22:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WZuAS3czPx8V3zSXaXdvz+AuPCDQ1qFOVNiUEI2WDqI=; b=XWOJyWeQqgZfdssn4QuAwDVyn+xs9ubLyDKUE71mHN7OMFUyQkg67SMCbvWAjz8ZjV MglrGDO1hyYaXviSGt/WA4phpgX+d65ytlP/BjFURNslXvKNZ06k7e5z+om5efE/ske6 LI8W9vPa4C+cM2Xwj91GhUxhCMJk9zLX7viSWUCXC7EE8R+D+D7ocxj5aVKzyxct0UAb N4+ob117XktQ3/ZoDZDZnZCDcI63TrIeRLJpk38EVZCXQ9L+QiX4v0ZrswNA27+QHEHW HVIq4vwFpCGhdGOkG8kEQ4nRvgYGLw3hGDX1LK92o+a/sKlNX+9lBAmKjcryGFit/eAZ i2RQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=WZuAS3czPx8V3zSXaXdvz+AuPCDQ1qFOVNiUEI2WDqI=; b=mK8O4TRRFF/wvA69j7Ops2dRfZ4wkCXMDcGkyXh/eAJNcOFDkUtDGNu9/MVnm4pO0o /gKofls6v+orzgW+P5YC3N8uhgiQvITax8h5qvBC2u6m0QIT4utbaUqkitA93zcuzkXF yZvwGrmKz/eueVRVe18JTmFLRdnt0BzY54X+6TUuF2vF6BKEPuNzAW2PkR7U9/MO8SXi 9RFUxsbKcq6trwTCpf+YuOu/jReyo9OiTioA3m115YVGDyOEuFNdUpGLYZ0xpN6+1yeW yGk67Eq7B7mHP080MHTOQ3LLyQEhsA67BTbh8eRIg3T3JXL/0iz8fvCrMUwN2iTI/Kws 2HVQ== X-Gm-Message-State: APjAAAUTeDMzZPmc3yClU6Q+tdvfsYC3B9sjq7v7svBhshGREPh6EN2A UwhcaaEcpMM5DPde1wIiQioOLGDE X-Google-Smtp-Source: APXvYqxXUWtbdTU+MLb1gb4qum9sUGxsmLjnb7wKcDbv14+Ud90JafBQvcSCSz5sxiEglvNnY1eBLw== X-Received: by 2002:a37:624b:: with SMTP id w72mr2268164qkb.368.1564518120498; Tue, 30 Jul 2019 13:22:00 -0700 (PDT) Received: from localhost.localdomain ([191.83.214.187]) by smtp.gmail.com with ESMTPSA id r36sm35243859qte.71.2019.07.30.13.21.59 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 13:22:00 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Jul 2019 17:19:50 -0300 Message-Id: <20190730201951.2033-7-jamrial@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190730201951.2033-1-jamrial@gmail.com> References: <20190730201951.2033-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/7] avformat/dashenc: fix writting the AV1 codec string in mp4 mode 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" From https://aomediacodec.github.io/av1-isobmff/#codecsparam, the parameters sample entry 4CC, profile, level, tier, and bitDepth are all mandatory fields. All the other fields are optional, mutually inclusive (all or none). Fixes ticket #8049 Signed-off-by: James Almer --- libavformat/dashenc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 50eba370d9..a3d8168110 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -35,6 +35,7 @@ #include "libavutil/time.h" #include "libavutil/time_internal.h" +#include "av1.h" #include "avc.h" #include "avformat.h" #include "avio_internal.h" @@ -389,6 +390,21 @@ static void set_codec_str(AVFormatContext *s, AVCodecParameters *par, av_strlcatf(str, size, ".%02x%02x%02x", extradata[1], extradata[2], extradata[3]); av_free(tmpbuf); + } else if (!strcmp(str, "av01")) { + AV1SequenceParameters seq; + if (!par->extradata_size) + return; + if (ff_av1_parse_seq_header(&seq, par->extradata, par->extradata_size) < 0) + return; + + av_strlcatf(str, size, ".%01u.%02u%s.%02u", + seq.profile, seq.level, seq.tier ? "H" : "M", seq.bitdepth); + if (seq.color_description_present_flag) + av_strlcatf(str, size, ".%01u.%01u%01u%01u.%02u.%02u.%02u.%01u", + seq.monochrome, + seq.chroma_subsampling_x, seq.chroma_subsampling_y, seq.chroma_sample_position, + seq.color_primaries, seq.transfer_characteristics, seq.matrix_coefficients, + seq.color_range); } }