From patchwork Thu Apr 13 09:44:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 41140 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp1111281pzb; Thu, 13 Apr 2023 02:46:15 -0700 (PDT) X-Google-Smtp-Source: AKy350bW8nl7sxwd2FRYJTobOcPpV9y+XZjuO/+4CuuHmNatXJo08XvBdGkJWr+w70dfel6m22KX X-Received: by 2002:a17:906:a0c7:b0:94a:89d0:3ee with SMTP id bh7-20020a170906a0c700b0094a89d003eemr2166942ejb.23.1681379175593; Thu, 13 Apr 2023 02:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681379175; cv=none; d=google.com; s=arc-20160816; b=hcDyPAmbaHdhKK4hQlK+qfCzSHmUiD57e+GGeM6d4saETsQccm9wAoU/Vwai4QqrrD FXIMUn4HQVRBYpJ9+oKub9nERhZvrOI3eaZtwxEKDBKc4xXL/8+zAY4SbT3MiIrDJS1f P7BHJsG0TXaGUCRcDQOz0CGG3hbWyMGEOC5d+wG8Tb9C6QN2dq7XykwC7POT85Ur6ph7 qvT5f76fhEF0gkeZtZA4SRTmxzqNZbDnVcrSLfaA3KnIZBkSLzO40DWX5Nlfp3U7H5jU kuVaVmINAUHU5vPjfJLf0B39P+Q/7MAAk1OU3BqFYJlxmrOG3U5l3cQ0su8M/9JWvR7f fsTQ== 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 :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:mime-version:references :in-reply-to:message-id:date:to:from:delivered-to; bh=JKU2GCg8MIz+NYvT9yX+LbjxXAX2E8wJ+FoCmlNhztU=; b=pgOzS7uj8dy+h8YKKgtm4Fy6opnbpRbXzYBvISpODH+noUwqmHFtEgsBhemS7H40w5 lzVGDL94tfz0P41QXuwZ95Cne3sdFX/hOM+uPOckoUFPZGm5EAv+Dt+fn818ZGhMVB26 xXrC9KJ0KpDVCVoKPFGORaizH/N+xnMwztUaF9It9AsB0uHPPBZHa4sHW0uoLePuAbmO I1snLd1oqF0XwTDL74HgPT6K5VfwYdRPNlP/+sac3Tgrw0m45OhqZk6NCvaNqWoH/5ke tcrCMhkYPXBEeGdgdemdYlD820BRdpR2KSWgs9BqZsPKNwyb2sDEsagP5neus3P4IxSQ 1cNA== 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 z23-20020aa7d417000000b005021d2480f8si1287504edq.282.2023.04.13.02.46.15; Thu, 13 Apr 2023 02:46:15 -0700 (PDT) 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 69E3A68A7E3; Thu, 13 Apr 2023 12:45:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D6EEF68BD27 for ; Thu, 13 Apr 2023 12:45:23 +0300 (EEST) X-QQ-mid: bizesmtpipv602t1681379118tuuc Received: from localhost ( [255.254.22.15]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 13 Apr 2023 17:45:17 +0800 (CST) X-QQ-SSF: 01100000000000Z0Z000000A0000000 X-QQ-FEAT: 83ShfzFP0oCClSBZY12KcrsRorwqFWdrbz5794F8b+uOLxBNmXavL58CtQE9F dVRWTQCDA4B7BmNb9jv1PFaYCHv2tN2vmNs4Dydvw94poi1QkkhQ6xcCNtaNhQrjoXMw2w2 fPkbKPFGcGpyRWP6BPhG+dfkOw/0GU1R1F4dsUHvM5G5cPurtG4bh5vPo4ewN//99sXe382 YIgisD3IMkRV45Zni5t9R1jahZau4Wn3FdRjdXAfiClzucHAMnx+GmvwiVryT9aM7bq6ybB M2sXUgHulrNrAs2fFa3zzz3pYPiQvBvx3OvacxRgKL2/JNCXuwZ+rAjRv8HCa+lKBMOqmxg zXLfqJ0/i20p1/cF6l73624uXUW4ZKzsGLSY9pzkqTVd0CExU8= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2538892541323463087 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 Apr 2023 17:44:41 +0800 Message-Id: <20230413094441.56225-7-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230413094441.56225-1-lq@chinaffmpeg.org> References: <20230413094441.56225-1-lq@chinaffmpeg.org> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpipv:chinaffmpeg.org:qybglogicsvr:qybglogicsvr2 Subject: [FFmpeg-devel] [PATCH v8 6/6] avformat/flvenc: support demux vp9 in enhanced flv 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: Steven Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ihK3six3CjXY Signed-off-by: Steven Liu --- libavformat/flvdec.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 98a2231559..bc93c23166 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -320,6 +320,8 @@ static int flv_same_video_codec(AVFormatContext *s, AVCodecParameters *vpar, int return vpar->codec_id == AV_CODEC_ID_HEVC; case MKBETAG('a', 'v', '0', '1'): return vpar->codec_id == AV_CODEC_ID_AV1; + case MKBETAG('v', 'p', '0', '9'): + return vpar->codec_id == AV_CODEC_ID_VP9; default: break; } @@ -365,6 +367,10 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream, par->codec_id = AV_CODEC_ID_AV1; vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; return 4; + case MKBETAG('v', 'p', '0', '9'): + par->codec_id = AV_CODEC_ID_VP9; + vstreami->need_parsing = AVSTREAM_PARSE_HEADERS; + return 4; default: break; } @@ -1285,7 +1291,8 @@ retry_duration: st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_MPEG4 || st->codecpar->codec_id == AV_CODEC_ID_HEVC || - st->codecpar->codec_id == AV_CODEC_ID_AV1) { + st->codecpar->codec_id == AV_CODEC_ID_AV1 || + st->codecpar->codec_id == AV_CODEC_ID_VP9) { int type = 0; if (flv->exheader) { type = flags & 0x0F; @@ -1317,7 +1324,7 @@ retry_duration: } if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC || st->codecpar->codec_id == AV_CODEC_ID_H264 || st->codecpar->codec_id == AV_CODEC_ID_HEVC || - st->codecpar->codec_id == AV_CODEC_ID_AV1)) { + st->codecpar->codec_id == AV_CODEC_ID_AV1 || st->codecpar->codec_id == AV_CODEC_ID_VP9)) { AVDictionaryEntry *t; if (st->codecpar->extradata) {