From patchwork Sun Dec 17 16:24:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Felix de Souza via ffmpeg-devel X-Patchwork-Id: 45192 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp6886285pzf; Sun, 17 Dec 2023 08:24:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHxjIO4qyaC5iZ8iEnsYDx4NIBAj7ka7IG0xR6OaxGw+zISDifUzGvJ+7ehlBj2NEMU52J X-Received: by 2002:a05:600c:3147:b0:40c:3fa7:bba8 with SMTP id h7-20020a05600c314700b0040c3fa7bba8mr6570714wmo.155.1702830287919; Sun, 17 Dec 2023 08:24:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702830287; cv=none; d=google.com; s=arc-20160816; b=g1zo7AQlXwy6vjz9TVcnKxw1zb9zWO6gCgy9e0hKaFY0mmNQQzIUK4+SW9qiv5/HYk VYrq5SJRnv68QHx7kg6P15lVEF23nR8+nY2ofmBuQVhDJN49Qe5tclT/GS75uJa6tJzv dYcrxgGbpa5YSMpD/vqpM0kWE9zjuZ3YbgEN9bMbPajX4eCPOHeLss2j+6//rYTGD1C8 fQIRYlpqaKGhQqQT6e2pIM3Pu2iZusyzAr3K8B1iVk8+6us0kU0EZnW3a3jlqBAipeF5 lclaVPEV+c0Ot73i4YT97h0La2Ahu7+XVzDvuXPLVuUU1MQ0C7hQdd1iBTLVojfrwQ4L RHXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to:date :to:message-id:delivered-to; bh=01r2xhnVwwAxLVuVsLAtqaUkfQGLxgLnDismF/VPVro=; fh=frUT2hx60kzuIVmkNUv7bM3Y/kw3lxlKoLH+4fdDqZk=; b=fTFdgtqxOerVRavHnhFMoF3AyehwtJELso3gTxamJ60l5Epgcm6LuGqgOekMnzmfRd fDSpfNvpc2Oq8S9vc4qApWl53IuyEH9jXGXu49zyriDR7m6JazLn6/bL5VX532sZ5nsV PQkbp/foHTMN7lPwvJCNw0AFRwOk1vujd20BuHBTY+rjmt1tDWojfkIBQ/ueyCsSFdOt VGpv/AC4a3mW9PYV68zmcQjlaC46gXKRlDbzE4xALLQFfs7EbjHTtOsgIAZpfnCJx3In +XTdmgot7QhqdW/0GEhBiiUJ2A9ENbs+Owa8f6cD64yeVEUorNyUKn/rJIFm0CwKtVFP YXbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b23-20020a170906491700b00a1db7b9706fsi8874001ejq.188.2023.12.17.08.24.47; Sun, 17 Dec 2023 08:24:47 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 985CB68D0EE; Sun, 17 Dec 2023 18:24:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-251-73.mail.qq.com (out203-205-251-73.mail.qq.com [203.205.251.73]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6086F68CFF7 for ; Sun, 17 Dec 2023 18:24:37 +0200 (EET) Received: from localhost.localdomain ([103.102.203.203]) by newxmesmtplogicsvrszb9-1.qq.com (NewEsmtp) with SMTP id 61EB6842; Mon, 18 Dec 2023 00:24:30 +0800 X-QQ-mid: xmsmtpt1702830270t9gyi81eu Message-ID: X-QQ-XMAILINFO: MIXpHopat2IaqYBfVcoO3y0vInPXOec/Y/DqzFRTYJ+SpFB9sCguIEHN8pWvkf N7yUAGeBJEoa1FxIEwqwDXD7sCwGeUUoy5eR0ocm3nAG2pknEcvpcwY9p0S5RISGVccTUUPN2Tbz oaCy45i39Uykclj6lwWmDDh+/eNNbOuT5sE3Hrcie7wbYRpmXTamtRtYIWzfQBxVcd6V7f+vgptP jJzK/neMaV1dP0O9IJL+PW7xV6BABblJbZyC45u37p37B67++Yk83egxMTVZz561bT62MdV6kysv QxbyBSy4cqBGGNDr7bhNKHGRJmnXXM4ePSarVRTzMAg4INEuo+D7xdi0/AlucZ3hbSL90jLffEeR VlHp/sVM3Lsh4+da71nNMNG+DopoT6WrmLP2ikb5tZUZ+L4LnBNTHzyEzceidziEqgurwGI/eNZm 597n0Rh2qojlsQSdAZL5QLwtq94xIUWw0OKyUtXzjHxuaXFZ0jqhy8attIC+ljal4gTF+Q5Nchwd RyPpChqI8IZz28bNM2XOdEjiA7ft6r/2Umx1QhPzSODmujU4J+/sFzuj3Gz455MO1HTpHJodYDt+ N/Aho1WGC51azwR25sGCnCj3hav7wHpYFzH35LpnT0Fu0YVoGHqVA+9KPVACSHlLpUhXVrpwIBrz 8RhKpxaKTkkXQA1WgxAW8mk++07kTkF2sAo1lVYdoVSNbXkwuEgJKLIcz9Zk59PDQPdfaZzf1Sot 9Hc5ykrKsDzJuEiRYuc2w+LC9/EcCd7x7bE6+ZST7NamWPsP3aTpAFWbeufhrH6aQr/hsPndeUdB zzLi/LMz5sTdLbu37gcxscan4jD2vnN0TU9JD1Z1cvD5xekF7nDri4NE0ENick6cbkvtI9wlt0Br F8KiYkUwVhWhCrrnJz37iVb9K8UUHarvLPrKHwfCjwFN9OhphsVHkC4vQEbRXhHNd5MiFPhv2ht8 M0b9prKsVqSukE19dwFYyQkgYR72Qo0QRoVa/6xVXHiEu2Mz6qHea9pqYmC+QUwMJh/+uXNgMjEo /p2Tnv/Eg77SWIYXvVjlUC97Qk1X0OU7maMuUdoEUXUtlYrQ0i5DHBZBT68wkxwC2/yn8OO4/TKe I65AlX X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Dec 2023 00:24:25 +0800 X-OQ-MSGID: <20231217162425.93044-1-411294962@qq.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <29ed7620-f60f-4f31-bc22-3f0903456c07@gmail.com> References: <29ed7620-f60f-4f31-bc22-3f0903456c07@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/2] avformat/flvenc: support enhanced flv PacketTypeMetadata 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: , X-Patchwork-Original-From: zhupengfei via ffmpeg-devel From: Diego Felix de Souza via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: 411294962@qq.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 96DCqIkvix1m From: Zhu Pengfei <411294962@qq.com> Signed-off-by: Zhu Pengfei <411294962@qq.com> --- libavformat/flvenc.c | 155 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index f6d10f331c..7268394b93 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -24,6 +24,7 @@ #include "libavutil/intfloat.h" #include "libavutil/avassert.h" #include "libavutil/mathematics.h" +#include "libavutil/mastering_display_metadata.h" #include "libavcodec/codec_desc.h" #include "libavcodec/mpeg4audio.h" #include "avio.h" @@ -124,6 +125,7 @@ typedef struct FLVContext { int flags; int64_t last_ts[FLV_STREAM_TYPE_NB]; + int write_metadata_pkt; } FLVContext; static int get_audio_flags(AVFormatContext *s, AVCodecParameters *par) @@ -478,6 +480,158 @@ static void write_metadata(AVFormatContext *s, unsigned int ts) avio_wb32(pb, flv->metadata_totalsize + 11); } +static void flv_write_metadata_packet(AVFormatContext *s, AVCodecParameters *par, unsigned int ts) +{ + AVIOContext *pb = s->pb; + FLVContext *flv = s->priv_data; + AVContentLightMetadata *lightMetadata = NULL; + AVMasteringDisplayMetadata *displayMetadata = NULL; + const int flags_size = 5; + int64_t metadata_size_pos = 0; + int64_t total_size = 0; + const AVPacketSideData *side_data = NULL; + + if (par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == AV_CODEC_ID_AV1 || + par->codec_id == AV_CODEC_ID_VP9) { + if (flv->write_metadata_pkt) return; + + side_data = av_packet_side_data_get(par->coded_side_data, par->nb_coded_side_data, + AV_PKT_DATA_CONTENT_LIGHT_LEVEL); + if (side_data) + lightMetadata = (AVContentLightMetadata *)side_data->data; + + side_data = av_packet_side_data_get(par->coded_side_data, par->nb_coded_side_data, + AV_PKT_DATA_MASTERING_DISPLAY_METADATA); + if (side_data) + displayMetadata = (AVMasteringDisplayMetadata *)side_data->data; + + if (!lightMetadata && !displayMetadata) return; + + /* + * Reference Enhancing FLV + * https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp.pdf + * */ + avio_w8(pb, FLV_TAG_TYPE_VIDEO); //write video tag type + metadata_size_pos = avio_tell(pb); + avio_wb24(pb, 0 + flags_size); + put_timestamp(pb, ts); //ts = pkt->dts, gen + avio_wb24(pb, flv->reserved); + + if (par->codec_id == AV_CODEC_ID_HEVC) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeMetadata| FLV_FRAME_VIDEO_INFO_CMD); // ExVideoTagHeader mode with PacketTypeMetadata + avio_write(pb, "hvc1", 4); + } else if (par->codec_id == AV_CODEC_ID_AV1 || par->codec_id == AV_CODEC_ID_VP9) { + avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeMetadata| FLV_FRAME_VIDEO_INFO_CMD); + avio_write(pb, par->codec_id == AV_CODEC_ID_AV1 ? "av01" : "vp09", 4); + } + + avio_w8(pb, AMF_DATA_TYPE_STRING); + put_amf_string(pb, "colorInfo"); + + avio_w8(pb, AMF_DATA_TYPE_OBJECT); + + put_amf_string(pb, "colorConfig"); // colorConfig + + /* mixed array (hash) with size and string/type/data tuples */ + avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY); + + avio_wb32(pb, 0); // write array count + + if (par->color_trc != AVCOL_TRC_UNSPECIFIED && + par->color_trc < AVCOL_TRC_NB) { + put_amf_string(pb, "transferCharacteristics"); // color_trc + put_amf_double(pb, par->color_trc); + } + + if (par->color_space != AVCOL_SPC_UNSPECIFIED && + par->color_space < AVCOL_SPC_NB) { + put_amf_string(pb, "matrixCoefficients"); // colorspace + put_amf_double(pb, par->color_space); + } + + if (par->color_primaries != AVCOL_PRI_UNSPECIFIED && + par->color_primaries < AVCOL_PRI_NB) { + put_amf_string(pb, "colorPrimaries"); // color_primaries + put_amf_double(pb, par->color_primaries); + } + + put_amf_string(pb, ""); + avio_w8(pb, AMF_END_OF_OBJECT); // array end of object + + if (lightMetadata) { + put_amf_string(pb, "hdrCll"); + + /* mixed array (hash) with size and string/type/data tuples */ + avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY); + + avio_wb32(pb, 0); // write array count + + put_amf_string(pb, "maxFall"); + put_amf_double(pb, lightMetadata->MaxFALL); + + put_amf_string(pb, "maxCLL"); + put_amf_double(pb, lightMetadata->MaxCLL); + + // array end of object + put_amf_string(pb, ""); + avio_w8(pb, AMF_END_OF_OBJECT); + } + + if (displayMetadata && (displayMetadata->has_primaries || displayMetadata->has_luminance)) { + put_amf_string(pb, "hdrMdcv"); + + /* mixed array (hash) with size and string/type/data tuples */ + avio_w8(pb, AMF_DATA_TYPE_MIXEDARRAY); + avio_wb32(pb, 0); // write array count + + if (displayMetadata->has_primaries) { + put_amf_string(pb, "redX"); + put_amf_double(pb, av_q2d(displayMetadata->display_primaries[0][0])); + + put_amf_string(pb, "redY"); + put_amf_double(pb, av_q2d(displayMetadata->display_primaries[0][1])); + + put_amf_string(pb, "greenX"); + put_amf_double(pb, av_q2d(displayMetadata->display_primaries[1][0])); + + put_amf_string(pb, "greenY"); + put_amf_double(pb, av_q2d(displayMetadata->display_primaries[1][1])); + + put_amf_string(pb, "blueX"); + put_amf_double(pb, av_q2d(displayMetadata->display_primaries[2][0])); + + put_amf_string(pb, "blueY"); + put_amf_double(pb, av_q2d(displayMetadata->display_primaries[2][1])); + + put_amf_string(pb, "whitePointX"); + put_amf_double(pb, av_q2d(displayMetadata->white_point[0])); + + put_amf_string(pb, "whitePointY"); + put_amf_double(pb, av_q2d(displayMetadata->white_point[1])); + } + if (displayMetadata->has_luminance) { + put_amf_string(pb, "maxLuminance"); + put_amf_double(pb, av_q2d(displayMetadata->max_luminance)); + + put_amf_string(pb, "minLuminance"); + put_amf_double(pb, av_q2d(displayMetadata->min_luminance)); + } + put_amf_string(pb, ""); + avio_w8(pb, AMF_END_OF_OBJECT); + } + avio_w8(pb, AMF_DATA_TYPE_OBJECT_END); + + total_size = avio_tell(pb) - metadata_size_pos - 10; + avio_seek(pb, metadata_size_pos, SEEK_SET); + avio_wb24(pb, total_size); + avio_tell(pb); + avio_skip(pb, total_size + 10 - 3); + avio_tell(pb); + avio_wb32(pb, total_size + 11); // previous tag size + flv->write_metadata_pkt = 1; + } +} + static int unsupported_codec(AVFormatContext *s, const char* type, int codec_id) { @@ -878,6 +1032,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) memcpy(par->extradata, side, side_size); flv_write_codec_header(s, par, pkt->dts); } + flv_write_metadata_packet(s, par, pkt->dts); } if (flv->delay == AV_NOPTS_VALUE) From patchwork Sun Dec 17 16:24:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Felix de Souza via ffmpeg-devel X-Patchwork-Id: 45193 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1225:b0:181:818d:5e7f with SMTP id v37csp6886336pzf; Sun, 17 Dec 2023 08:24:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXctcRzSK4ffUAlonbIZGFPi5UBSgRCew9flLtNpdvLAkDx8d3oMZ4egfDFoZz/Yvq/DuH X-Received: by 2002:a50:c189:0:b0:54c:6fc0:483a with SMTP id m9-20020a50c189000000b0054c6fc0483amr16056463edf.2.1702830296708; Sun, 17 Dec 2023 08:24:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702830296; cv=none; d=google.com; s=arc-20160816; b=zMUA8MguCwzoDQTI5Rr4SugjKBc9UBG2dHgtLvwSN6y+sBtSsJ9DIIjAIzxvCA9Ox2 6ZszCGXR6aeX3r/vF6lxx0MktGYaXuV6krV7xtW3SbUvadFY+fckSsmzFBAghH/IMLZK gpRa+o3hZybTFd1I02FZO3z9XG8FjgKbFOM4KpQLldud6M1rgdGt/N2fJiGffdCtE9mX MBWzFzvTKSP4mXdN4rhhohSbqOvbnR0XIHtRsVpXDmkKwsoedWnfIDzwx9lUQjRTa3aK AAqN/44Q3eWKy71VFjh3xtQ5k2nJCh6G4LQoZeuXE6xvnnMFDvePBKz1uiPNY3IH1ht2 +cYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to:date :to:message-id:delivered-to; bh=5ieL5viFW0mzLZIzBlChe3xcr4P04CjwLR7uN1AkqKM=; fh=frUT2hx60kzuIVmkNUv7bM3Y/kw3lxlKoLH+4fdDqZk=; b=g8ca3HJZewItOgJ3VQsEg/KnzqCD5IqSUY803QFiiTYt8iL1beJHAkbqvMOYjSxpQq lLUILTjYWVHR9dN7FGa5QXS/rAadNgB6c4QI15t13Cj2Mdgr2+bwQ4BUJvltQ7fGV+rg Wcc0GIQ8kV0wLask9W8ksHfXuMTeJxd6BYGPGCHDOq2zxP7ojwKpi/QLkb2yu669ZW1+ vGBiVFSW2Wp6S6Tdy+srmNC0XFOEnkTnKz2TkPD8d6fgDxkbJ5HcZVGrGocELlIbHKqe EMaZQXIqPmSLX+xpQ2bsfBBES1bPtCFuK7oLxeP8HApFNjeilGTENqCtUEiKwFQgqsQS 7cOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ch11-20020a0564021bcb00b005530afe81bbsi1244538edb.325.2023.12.17.08.24.55; Sun, 17 Dec 2023 08:24:56 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CF90068D16C; Sun, 17 Dec 2023 18:24:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out162-62-58-211.mail.qq.com (out162-62-58-211.mail.qq.com [162.62.58.211]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A8D5C68D14F for ; Sun, 17 Dec 2023 18:24:45 +0200 (EET) Received: from localhost.localdomain ([103.102.203.203]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 627B221B; Mon, 18 Dec 2023 00:24:39 +0800 X-QQ-mid: xmsmtpt1702830279t7hvjf3ak Message-ID: X-QQ-XMAILINFO: MmPNY57tR1XnMVxsfQaSxl/e+vRiEY7BB3VAfTE7OAv8vcyMEKkv9PK7jVeE+Z cqYXL2WkYZV1j6tqpA11JdChWnHd+UxBd5shUdKefSnlcUlChxTfNQM55Y5IHnVzXk0qYyhLdM0+ L/PF07cCODgminUW9HN99AokSOsJFaQpT3BnUysxWfW06eNdvvEeqtIvNR5Xax1G1giA6AHZvv/5 BphGpOzSkBuNbZu7FPhEgvQ3h/O7U4e5Yv/Tb+aI+FBlXs4ecbNXm+bYNT+fjuXigzLkc+i84/8V kVb5cgAeUT40TcIg4dJ+OlIIELs/dqk867HWgDqzgTeN8H+6Btj84WPygzvY7RFbrXy+5HmhKE8c uJUoz/prHziyvWw8sZ9NQlKQ7XW0bUSW7KBxt9ZlhacYRoSTysAJAPYqxk4xSVZbXwNj77+dAAqD vLfEo768l1BjbcPe4zELPBM5XJxFR4pASJdges2AgVe45jMR+5cpX0BhdX3mAtjRHoQgMS3o2Q3u GPlpCYhjYXx7veiwEnLcBSDrVaWCGfAZwXAF03GD6jTNMr92mkeFZWGjv5sNShhslqVkFYTczZ/Q X7pNDXW5EP5RkzrczwFL8exaP5NRa4p/0D1S0QqAzsU5zqakrVehPtIkkp3KOdBBJjsmuhgMZjqH Xbm5zmRVq4GzJNJkOtBoXW/8490iJViSot7mGcgKKpJvdzZfb0/UFXWXB3rESOPEuRqo8ADNYXLS B3bIEoDs9JC+1UzX5gCDzdzEBXT0I5V+j424PimQcmEtyIM0LL7qRWXQY0Qyu/td+/cqfaYRCnrY otF/mRW70jXF68vkZYHA9KdkdfjHxkkMcJY7HbeH1BQRfRIrzrw6tylVcnivQxzAQKfGlnkJewQp aB4a3efbDYlibCKiqJ6tMQ1wwHQY/4rk9Cwan7vjOpblClJVBiueUaRzahIqJxVVe8trzdLi/Q3M ExjbwXb1U0CT1I1YpUPcwR2wv6unKS X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= To: ffmpeg-devel@ffmpeg.org Date: Mon, 18 Dec 2023 00:24:37 +0800 X-OQ-MSGID: <20231217162437.93122-1-411294962@qq.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <29ed7620-f60f-4f31-bc22-3f0903456c07@gmail.com> References: <29ed7620-f60f-4f31-bc22-3f0903456c07@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/2] avformat/flvdec: support enhanced flv PacketTypeMetadata 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: , X-Patchwork-Original-From: zhupengfei via ffmpeg-devel From: Diego Felix de Souza via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: 411294962@qq.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Zp1U4lIGtJ7o From: Zhu Pengfei <411294962@qq.com> Signed-off-by: Zhu Pengfei <411294962@qq.com> --- libavformat/flvdec.c | 178 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 177 insertions(+), 1 deletion(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index e25b5bd163..6d40b4c7d5 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -34,6 +34,7 @@ #include "libavutil/intfloat.h" #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h" +#include "libavutil/mastering_display_metadata.h" #include "avformat.h" #include "demux.h" #include "internal.h" @@ -45,6 +46,28 @@ #define MAX_DEPTH 16 ///< arbitrary limit to prevent unbounded recursion +typedef struct FLVMasteringMeta { + double r_x; + double r_y; + double g_x; + double g_y; + double b_x; + double b_y; + double white_x; + double white_y; + double max_luminance; + double min_luminance; +} FLVMasteringMeta; + +typedef struct FLVMetaVideoColor { + uint64_t matrix_coefficients; + uint64_t transfer_characteristics; + uint64_t primaries; + uint64_t max_cll; + uint64_t max_fall; + FLVMasteringMeta mastering_meta; +} FLVMetaVideoColor; + typedef struct FLVContext { const AVClass *class; ///< Class for private options. int trust_metadata; ///< configure streams according onMetaData @@ -80,6 +103,8 @@ typedef struct FLVContext { int64_t time_offset; int64_t time_pos; + FLVMetaVideoColor *metaVideoColor; + int meta_color_info_flag; } FLVContext; /* AMF date type */ @@ -524,6 +549,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, FLVContext *flv = s->priv_data; AVIOContext *ioc; AMFDataType amf_type; + FLVMetaVideoColor *meta_video_color = flv->metaVideoColor; char str_val[1024]; double num_val; amf_date date; @@ -672,6 +698,43 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, } } + if (meta_video_color) { + if (amf_type == AMF_DATA_TYPE_NUMBER || + amf_type == AMF_DATA_TYPE_BOOL) { + if (!strcmp(key, "colorPrimaries")) { + meta_video_color->primaries = num_val; + } else if (!strcmp(key, "transferCharacteristics")) { + meta_video_color->transfer_characteristics = num_val; + } else if (!strcmp(key, "matrixCoefficients")) { + meta_video_color->matrix_coefficients = num_val; + } else if (!strcmp(key, "maxFall")) { + meta_video_color->max_fall = num_val; + } else if (!strcmp(key, "maxCLL")) { + meta_video_color->max_cll = num_val; + } else if (!strcmp(key, "redX")) { + meta_video_color->mastering_meta.r_x = num_val; + } else if (!strcmp(key, "redY")) { + meta_video_color->mastering_meta.r_y = num_val; + } else if (!strcmp(key, "greenX")) { + meta_video_color->mastering_meta.g_x = num_val; + } else if (!strcmp(key, "greenY")) { + meta_video_color->mastering_meta.g_y = num_val; + } else if (!strcmp(key, "blueX")) { + meta_video_color->mastering_meta.b_x = num_val; + } else if (!strcmp(key, "blueY")) { + meta_video_color->mastering_meta.b_y = num_val; + } else if (!strcmp(key, "whitePointX")) { + meta_video_color->mastering_meta.white_x = num_val; + } else if (!strcmp(key, "whitePointY")) { + meta_video_color->mastering_meta.white_y = num_val; + } else if (!strcmp(key, "maxLuminance")) { + meta_video_color->mastering_meta.max_luminance = num_val; + } else if (!strcmp(key, "minLuminance")) { + meta_video_color->mastering_meta.min_luminance = num_val; + } + } + } + if (amf_type == AMF_DATA_TYPE_OBJECT && s->nb_streams == 1 && ((!apar && !strcmp(key, "audiocodecid")) || (!vpar && !strcmp(key, "videocodecid")))) @@ -824,6 +887,7 @@ static int flv_read_close(AVFormatContext *s) av_freep(&flv->new_extradata[i]); av_freep(&flv->keyframe_times); av_freep(&flv->keyframe_filepositions); + av_freep(&flv->metaVideoColor); return 0; } @@ -1028,6 +1092,104 @@ static int resync(AVFormatContext *s) return AVERROR_EOF; } +static int flv_parse_video_color_info(AVFormatContext *s, AVStream *st, int64_t next_pos) +{ + FLVContext *flv = s->priv_data; + AMFDataType type; + AVIOContext *ioc; + char buffer[32]; + ioc = s->pb; + + // first object needs to be "colorInfo" string + type = avio_r8(ioc); + if (type != AMF_DATA_TYPE_STRING || + amf_get_string(ioc, buffer, sizeof(buffer)) < 0) + return TYPE_UNKNOWN; + + if (strcmp(buffer, "colorInfo")) { + av_log(s, AV_LOG_DEBUG, "Unknown type %s\n", buffer); + return TYPE_UNKNOWN; + } + + flv->metaVideoColor = av_mallocz(sizeof(FLVMetaVideoColor)); + if (!flv->metaVideoColor) { + return AVERROR(ENOMEM); + } + flv->meta_color_info_flag = 1; + amf_parse_object(s, NULL, NULL, buffer, next_pos, 0); // parse metadata + return 0; +} + +static int flv_update_video_color_info(AVFormatContext *s, AVStream *st) +{ + FLVContext *flv = s->priv_data; + const FLVMetaVideoColor* meta_video_color = flv->metaVideoColor; + const FLVMasteringMeta *mastering_meta = &meta_video_color->mastering_meta; + + int has_mastering_primaries, has_mastering_luminance; + // Mastering primaries are CIE 1931 coords, and must be > 0. + has_mastering_primaries = + mastering_meta->r_x > 0 && mastering_meta->r_y > 0 && + mastering_meta->g_x > 0 && mastering_meta->g_y > 0 && + mastering_meta->b_x > 0 && mastering_meta->b_y > 0 && + mastering_meta->white_x > 0 && mastering_meta->white_y > 0; + has_mastering_luminance = mastering_meta->max_luminance >= 0 && mastering_meta->min_luminance >= 0; + + if (meta_video_color->matrix_coefficients != AVCOL_SPC_RESERVED) + st->codecpar->color_space = meta_video_color->matrix_coefficients; + if (meta_video_color->primaries != AVCOL_PRI_RESERVED && + meta_video_color->primaries != AVCOL_PRI_RESERVED0) + st->codecpar->color_primaries = meta_video_color->primaries; + if (meta_video_color->transfer_characteristics != AVCOL_TRC_RESERVED && + meta_video_color->transfer_characteristics != AVCOL_TRC_RESERVED0) + st->codecpar->color_trc = meta_video_color->transfer_characteristics; + + if (meta_video_color->max_cll && meta_video_color->max_fall) { + size_t size = 0; + AVContentLightMetadata *metadata = av_content_light_metadata_alloc(&size); + if (!metadata) + return AVERROR(ENOMEM); + if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data, + AV_PKT_DATA_CONTENT_LIGHT_LEVEL, metadata, size, 0)) { + av_freep(&metadata); + return AVERROR(ENOMEM); + } + metadata->MaxCLL = meta_video_color->max_cll; + metadata->MaxFALL = meta_video_color->max_fall; + } + + if (has_mastering_primaries || has_mastering_luminance) { + AVMasteringDisplayMetadata *metadata; + AVPacketSideData *sd = av_packet_side_data_new(&st->codecpar->coded_side_data, + &st->codecpar->nb_coded_side_data, + AV_PKT_DATA_MASTERING_DISPLAY_METADATA, + sizeof(AVMasteringDisplayMetadata), 0); + if (!sd) + return AVERROR(ENOMEM); + metadata = (AVMasteringDisplayMetadata*)sd->data; + memset(metadata, 0, sizeof(AVMasteringDisplayMetadata)); + // hdrCll + if (has_mastering_luminance) { + metadata->max_luminance = av_d2q(mastering_meta->max_luminance, INT_MAX); + metadata->min_luminance = av_d2q(mastering_meta->min_luminance, INT_MAX); + metadata->has_luminance = 1; + } + // hdrMdcv + if (has_mastering_primaries) { + metadata->display_primaries[0][0] = av_d2q(mastering_meta->r_x, INT_MAX); + metadata->display_primaries[0][1] = av_d2q(mastering_meta->r_y, INT_MAX); + metadata->display_primaries[1][0] = av_d2q(mastering_meta->g_x, INT_MAX); + metadata->display_primaries[1][1] = av_d2q(mastering_meta->g_y, INT_MAX); + metadata->display_primaries[2][0] = av_d2q(mastering_meta->b_x, INT_MAX); + metadata->display_primaries[2][1] = av_d2q(mastering_meta->b_y, INT_MAX); + metadata->white_point[0] = av_d2q(mastering_meta->white_x, INT_MAX); + metadata->white_point[1] = av_d2q(mastering_meta->white_y, INT_MAX); + metadata->has_primaries = 1; + } + } + return 0; +} + static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) { FLVContext *flv = s->priv_data; @@ -1100,8 +1262,17 @@ retry: video_codec_id = avio_rb32(s->pb); size -= 4; } - if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD) + + if (enhanced_flv && stream_type == FLV_STREAM_TYPE_VIDEO && (flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD) { + type = flags & 0x0F; + if (type == PacketTypeMetadata) { + int ret = flv_parse_video_color_info(s, st, next); + av_log(s, AV_LOG_INFO, "enhanced flv parse metadata ret %d and skip\n", ret); + } + goto skip; + } else if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD) { goto skip; + } } else if (type == FLV_TAG_TYPE_META) { stream_type=FLV_STREAM_TYPE_SUBTITLE; if (size > 13 + 1 + 4) { // Header-type metadata stuff @@ -1287,6 +1458,11 @@ retry_duration: goto leave; } + if (enhanced_flv && stream_type == FLV_STREAM_TYPE_VIDEO && flv->meta_color_info_flag) { + flv_update_video_color_info(s, st); // update av packet side data + flv->meta_color_info_flag = 0; + } + if (st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || (st->codecpar->codec_id == AV_CODEC_ID_HEVC && type == PacketTypeCodedFrames)) { // sign extension From patchwork Sat Mar 2 08:51:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Felix de Souza via ffmpeg-devel X-Patchwork-Id: 46696 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a919:b0:19e:cdac:8cce with SMTP id cd25csp1750659pzb; Sat, 2 Mar 2024 00:52:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgYETkbYchlsY6+D+1+/AKiZWw1Oq2XE65ip0rey4nZe02/Ar03CMM4LulmvbaSpBV4B9bjEtJPMV/67oBrTfUI/DaH28qJqMA2g== X-Google-Smtp-Source: AGHT+IExBmtYSvk0aFU9kInIPUtTwDIyQ9L9Khb3Ttsf+0cp3e9BRCfj+3z0Rajl90UA0YVhAuub X-Received: by 2002:a17:906:35c9:b0:a44:e426:bf7e with SMTP id p9-20020a17090635c900b00a44e426bf7emr429229ejb.67.1709369530784; Sat, 02 Mar 2024 00:52:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709369530; cv=none; d=google.com; s=arc-20160816; b=yDrjRYX51mXwMvtJ3mlszBVsZ3vc0C02Xb4Pw87ji7s0zQ1aTY2eXR+08jAw73zkZE wFvlkkRhrWWyC5mlixkVNrPKNX/IHf7Cm19spu1eWOgoIGW8Ce+2WP8uuBuAXXD/lAvW 86qUDAGVIH49i/bPEC1oZHJhh3QlWGcNBxd8qQmtNrM6jRsrGlAr45/GOuF9yXWfVmMV rSJEY3r+82opsvBZoIArwtNS52GEAPG7t+OykNPXtB9jfBTq3FsOWO0az+0McvAXmuS6 uYa1bNMiXmo5iG+KabJtZgr/YiDCP0TZ8Y8kygGTSrvc14YG+BfPquO5TzPVQZvK5LFV GbbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to:date :to:message-id:delivered-to; bh=Sff/7PwE2zstc9wS4LoFSq2fcwXwkyXhqFYRClcR6kw=; fh=frUT2hx60kzuIVmkNUv7bM3Y/kw3lxlKoLH+4fdDqZk=; b=K8/zJmAyDWj6hxslQZdF1dYJ0XTCQByeQ1wDnEcqqcFrZQTzpkDs4qudH7BOsSyGi3 ax8niCsQu2LQnlOjdi78vaIHYVEL2pxfZZfpmc4TdK5FInuD4J4s39V3lEAm5HoVSFHk wFPzj0osChettoZdpQ12RqOzdGy2A6Zs/ND8kXmpY5gPaotF7RSaPKD9v+pzgiGNZ8es Nynk9dXSQrpRMK9QazeQJSYtYwPogkPo394HMFqX3E32fPBqqoqz9in2sBuTmdMqHOG5 8AwlCec/rHTV0fAuxYTLhNFYHbxBVDWsZcy4WjccdvbLiauIxAu5Gsa9ONMoNmR4xsRx +N+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ji8-20020a170907980800b00a43eb9b6f23si2196462ejc.382.2024.03.02.00.52.10; Sat, 02 Mar 2024 00:52:10 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8533168D30A; Sat, 2 Mar 2024 10:51:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out162-62-57-49.mail.qq.com (out162-62-57-49.mail.qq.com [162.62.57.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 970AC68D2FB for ; Sat, 2 Mar 2024 10:51:52 +0200 (EET) Received: from localhost.localdomain ([163.125.127.26]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id CF105E44; Sat, 02 Mar 2024 16:51:49 +0800 X-QQ-mid: xmsmtpt1709369509t7vog95s9 Message-ID: X-QQ-XMAILINFO: MmpliBmRb3iCMbtY5uOAvJ/fV+Kx+dTVcaHYCegvpBhz3g5zXkT+QtpPHXsJCo 3YfvIoWwv3e4TBRGZjLNPdm5/oMaoci33IJgEPy6Jv9XUx8oz6IK1QZ0wUPiFZ03mpIotu6SS4Q4 L6kpfdcFHPzG99UIME+nc3B8XlKwtvPnZPXiLu+up8M1csVl7oDfb61p/EUyDlRJUa5XnWn48tDf ILcg03+DG8b5mhLOCmciHmskE3TlVRY+5aqD/tbcZuRWDi0VzD78rLgNVfEa4rhHP5pWyBUlmlop j5VDyisTSfcXvTst4CBUD9BvZkiK4ysZpPpjTpQ69EBR88qwDI/Uz4jYZQ5/uXUtcRR/HgqBOrnq FkynUg1uMtJSGW4JKE/0DS7Tlc+2J8xR4y26kMJOw9gv5v4IKKzO1T9/EIP0SDpE9ezxyk46hKwe CzBtq8S4h25EtmgHYd7IaRUIcQyueUmizWQ6RZMDSD70CnjtsEV5/aXlfwMpyAe+M6S6SkkxVMwf azb6zRGku9wNHMlS9baxo+4s5vaHx1znVK7Kj+ruDzpSglSuZ+2+S8xruln53zhNRdkhUAzqnXw7 c4pvk9BEppaBq7UVhKFo1whZb26opkGnrtcH5SnCyuNa64bQt0Tn8w6n3KWMapEbL7okfDshrk3I U+E9jh1Lavtr3U46zf98V/JFfSi5V9qgg3pwN6S6rgL5+I7nVMFXBglwtMaSsl8K8bDCuMMevTSN gzbCDir7+vQqeH+rmuIN/qt4Z8tkVOPQhNp8sqzMGqTbdxan/NUnrWpZVNj/pSMy6HbKI4Ihh94c JVXxPUsKUOHbBkuewaQTvMBFu7i/KrdNaa0DiL8b2Ar0X+oo+2mCI8uObAPIF7kUbeZuc5J8LFbE PL0/BO1TQ+kj8AgJZ9UHh9RxXrXA+UBIUuveQH5srdc8sIqn9M/8YcoQF27GYKecZi6Ub7g+tHHA 2VaeZmc2xzznr4qUjJbpIilRtezYlGG2CDdnEN0tWCrN+xYpUFVA== X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= To: ffmpeg-devel@ffmpeg.org Date: Sat, 2 Mar 2024 16:51:45 +0800 X-OQ-MSGID: <20240302085145.23686-1-411294962@qq.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <29ed7620-f60f-4f31-bc22-3f0903456c07@gmail.com> References: <29ed7620-f60f-4f31-bc22-3f0903456c07@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 3/3] fate/flvenc: support enhanced flv PacketTypeMetadata 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: , X-Patchwork-Original-From: zhupengfei via ffmpeg-devel From: Diego Felix de Souza via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: 411294962@qq.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Y5F/BrNACYQ3 From: Zhu Pengfei <411294962@qq.com> Signed-off-by: Zhu Pengfei <411294962@qq.com> --- tests/fate/lavf-container.mak | 2 ++ tests/ref/fate/enhanced-flv-hevc | 4 ++-- tests/ref/fate/enhanced-flv-vp9 | 4 ++-- tests/ref/lavf-fate/hevc.flv | 3 +++ 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 tests/ref/lavf-fate/hevc.flv diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak index fa7ecd2cb5..efef00d5b3 100644 --- a/tests/fate/lavf-container.mak +++ b/tests/fate/lavf-container.mak @@ -80,6 +80,7 @@ FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MOV_DEMUXER LATM_MUXER) + FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MP3_DEMUXER MP3_MUXER) += mp3 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MOV_DEMUXER MOV_MUXER) += qtrle_mace6.mov FATE_LAVF_CONTAINER_FATE-$(call ALLYES, AVI_DEMUXER AVI_MUXER) += cram.avi +FATE_LAVF_CONTAINER_FATE-$(call ALLYES, AVI_DEMUXER FLV_MUXER) += hevc.flv FATE_LAVF_CONTAINER_FATE = $(FATE_LAVF_CONTAINER_FATE-yes:%=fate-lavf-fate-%) @@ -96,6 +97,7 @@ fate-lavf-fate-latm: CMD = lavf_container_fate "aac/al04_44.mp4" "" "-acodec cop fate-lavf-fate-mp3: CMD = lavf_container_fate "mp3-conformance/he_32khz.bit" "" "-acodec copy" fate-lavf-fate-qtrle_mace6.mov: CMD = lavf_container_fate "qtrle/Animation-16Greys.mov" "-idct auto" fate-lavf-fate-cram.avi: CMD = lavf_container_fate "cram/toon.avi" "-idct auto" +fate-lavf-fate-hevc.flv: CMD = lavf_container_fate "mkv/hdr10tags-both.mkv" "" "-c:v copy" FATE_SAMPLES_FFMPEG += $(FATE_LAVF_CONTAINER_FATE) fate-lavf-fate fate-lavf: $(FATE_LAVF_CONTAINER_FATE) diff --git a/tests/ref/fate/enhanced-flv-hevc b/tests/ref/fate/enhanced-flv-hevc index 90b81fcc0f..f011d38a30 100644 --- a/tests/ref/fate/enhanced-flv-hevc +++ b/tests/ref/fate/enhanced-flv-hevc @@ -1,5 +1,5 @@ -25fb1fcdcfde498ab86a3387f1a7f833 *tests/data/fate/enhanced-flv-hevc.flv -3602897 tests/data/fate/enhanced-flv-hevc.flv +0da54607064548fa1aae5695751f189c *tests/data/fate/enhanced-flv-hevc.flv +3603038 tests/data/fate/enhanced-flv-hevc.flv #extradata 0: 551, 0xa18acf66 #extradata 1: 2, 0x00340022 #tb 0: 1/1000 diff --git a/tests/ref/fate/enhanced-flv-vp9 b/tests/ref/fate/enhanced-flv-vp9 index c9bcaa8029..1c70b52e6a 100644 --- a/tests/ref/fate/enhanced-flv-vp9 +++ b/tests/ref/fate/enhanced-flv-vp9 @@ -1,5 +1,5 @@ -f5cd49123111202ff220850e60f17ac4 *tests/data/fate/enhanced-flv-vp9.flv -9388 tests/data/fate/enhanced-flv-vp9.flv +7dae331e8e7a73e2e2288a31fe51104c *tests/data/fate/enhanced-flv-vp9.flv +9441 tests/data/fate/enhanced-flv-vp9.flv #extradata 0: 12, 0x03bc009d #tb 0: 1/1000 #media_type 0: video diff --git a/tests/ref/lavf-fate/hevc.flv b/tests/ref/lavf-fate/hevc.flv new file mode 100644 index 0000000000..5f47c352fd --- /dev/null +++ b/tests/ref/lavf-fate/hevc.flv @@ -0,0 +1,3 @@ +eca3b99e846e509c6957260b1ce4d82d *tests/data/lavf-fate/lavf.hevc.flv +11784 tests/data/lavf-fate/lavf.hevc.flv +tests/data/lavf-fate/lavf.hevc.flv CRC=0xd29da885