From patchwork Wed Jun 9 04:18:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xiang, Haihao" X-Patchwork-Id: 28182 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp479486iol; Tue, 8 Jun 2021 21:19:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9xvDwBN5LtxkMHb+RJ/Siy4bqT93YMqGRKFcMRCGIiym1r9FrmQ0DLKpNbx1sMfXI8dCW X-Received: by 2002:a50:fb8f:: with SMTP id e15mr27823205edq.46.1623212348652; Tue, 08 Jun 2021 21:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623212348; cv=none; d=google.com; s=arc-20160816; b=XuZgHTdebgG1d84f7PGM6x/aWnjqXB0JuZ7XPFk0FMK/XvaPY/F9ZXDaSumDSsyMRA 5PN/N+ijZX73pT2yqr/UayGw13S0n+P7yZowE5+BCAtJA2Dip/2D4eFqXIQx4z43Xrzf 1fzDlcnREqI16MCHUpeMLUdhuY5XiCVosW6EIi4txkLWkpxZ1jFD5y9xPtiofMRKzxQN uf9EAezu7qpXGsX5vFSrNdTNsterkF2D8RZKF8vJ0DR9JgWhBhUPUnbIVE2orEwbqEpd bpR4j/fSbvgDefgwUVR1y+xPmh3LSCBNEk2XSwUXmTC/kq/rusz6RL6QEqVC7kTBEFfO U8QQ== 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:mime-version:references:in-reply-to :message-id:date:to:from:ironport-sdr:ironport-sdr:delivered-to; bh=NVKX1m5zExQqVqOp+jwC206+vrBCcRjvV4pA77Cy7Kg=; b=s5GkihIAtdMZy+az0yR2gIPThTMIfMjR/Wpa2idY8DNKo6p9DZt3z8g95scCjtefkB hYlrcBXdmJnT7sVRc8QDanO2+8mc3TxW7Htq7DHjjj/Zj3YIQGT1wyS+9+NuxTQO8fOr NqDeClQP3hvi8yr5ADB1IYmxG1mQsSp2yg4abjqzhl+C8br/qzvsGu3OMd5HbNuJazj0 AbE3bslfwZPBvAWFY1y+IV+PSc7n3Ng1zCKNvUijJ08nD3WbCBTORjq+KBm5kZuG7EAp tF0BlYm7avmpvIBcSHdMhSZvUTZQIaaFMOrdwfA0S2et0Mt7Gi8VLh7nPX2Lnj/X28iu oBVg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m1si1375976ejj.214.2021.06.08.21.19.08; Tue, 08 Jun 2021 21:19:08 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F7D4687FB2; Wed, 9 Jun 2021 07:19:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 82A7A680BBD for ; Wed, 9 Jun 2021 07:18:53 +0300 (EEST) IronPort-SDR: cblCq1VlSsUBrmeBTzNC5gnsKddmHmffokljy/aeLXHxS4PJrTAuJUr4gV/DANZd2tupXzp7iB s256Swq03OeA== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="192108173" X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="192108173" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 21:18:44 -0700 IronPort-SDR: hG6LXsr5j+Lg1PzdCZyYsLKVvZArTqspTF2rOEJLj5dXTtF711vBtJ+0bvauV2NbsXQ65lT9Wc 2m/DjZiR3Omw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="485580305" Received: from xhh-tgl64.sh.intel.com ([10.239.159.53]) by fmsmga002.fm.intel.com with ESMTP; 08 Jun 2021 21:18:43 -0700 From: Haihao Xiang To: ffmpeg-devel@ffmpeg.org Date: Wed, 9 Jun 2021 12:18:30 +0800 Message-Id: <20210609041830.1302044-2-haihao.xiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210609041830.1302044-1-haihao.xiang@intel.com> References: <20210609041830.1302044-1-haihao.xiang@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavfi/vf_vpp_qsv: fix the time_base for outlink 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: Haihao Xiang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: U1U9emTLuq+G Since commit 89ffcd1, the pts on output pad is in the time base of the input link, not the time base of the output link when EOF is reached, so a filter after vpp_qsv might output some unexpected frames. In order to avoid this issue, use the same time base for input and ouput links The issue can be triggered with the command below: $> ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -vf "vpp_qsv=w=1920:h=1080,fps=fps=60" -f null - [out_0_0 @ 0x55eb017b5060] 100 buffers queued in out_0_0, something may be wrong. [out_0_0 @ 0x55eb017b5060] 1000 buffers queued in out_0_0, something may be wrong. [out_0_0 @ 0x55eb017b5060] 10000 buffers queued in out_0_0, something may be wrong. --- libavfilter/vf_vpp_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index b9ab5c6490..74d1d51e7c 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -303,7 +303,7 @@ static int config_output(AVFilterLink *outlink) outlink->w = vpp->out_width; outlink->h = vpp->out_height; outlink->frame_rate = vpp->framerate; - outlink->time_base = av_inv_q(vpp->framerate); + outlink->time_base = inlink->time_base; param.filter_frame = NULL; param.num_ext_buf = 0;