From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9DF58444E2 for ; Tue, 13 Sep 2022 11:40:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9ACB468BB05; Tue, 13 Sep 2022 14:40:11 +0300 (EEST) Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F0FE868B99E for ; Tue, 13 Sep 2022 14:40:05 +0300 (EEST) Received: by mail-yb1-f177.google.com with SMTP id a67so17268257ybb.3 for ; Tue, 13 Sep 2022 04:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date; bh=DXQ70lSqMQuuz3Xc8f21IQPrVsQVkekozFZC9D/vLLk=; b=Yt4dZOrDoGVgkGS5qEtL+4QwqES/uXzJw+zBrmSCp+7p+NgRGRwtk1PKHvkfQ2egr3 uur8bwkWFc+fqCWmm1mHwFdFOpGeVtAL2vrDj/tzgv2zXqk4a1/KZ7HAUI0v2XzKqoEE pFw5sMEYevmhT+Egq0xn0DCSN3yZ0H+KJ/S4JCyAfRBlQ9MSgVCxZzATUASJoILQHWC6 zETZIljFHss+3L5IvuhdCkahphXl/IeA6Hmf6TGlyNXDDYpWtCDou6u4ksXpNSR/DwLI wTXMNZYCwgjskkUj06EFORmwcqHOvRb9csU+S1jBAvCwDIrM58YIm3lhSA/LAoqOlr61 vWXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=DXQ70lSqMQuuz3Xc8f21IQPrVsQVkekozFZC9D/vLLk=; b=4p4lpI1/4w5GYEZh3g2jaUMmqxDXK8xmwBSzoJEZXqwrC7kJqb6LuVGfJvOWC2eDmk 0w8S5RqIEVckIypphkzOxwzU5limxbyuCHEYmE6JoD+QXe468DxiiMTE2ZHsuKeCfsIz 7475VMZEdYTNmVTAa5oqVfo26Pklh7+v00l6rSF42pIQ1//YsZIx6GUQQm0UJ5/p9z/O 3neNpkz3DY7cTj/hVRzhqVLQK2+Ny1D6pCmsD07sn4t0xLmW/M7HcA7V6Xw++GQUQnkA BSZsU/QWojOtrCaLfLFVDaGbZWuLO15SP+Xubjnns/V2nuO2vX7d8gY1qfWJqjG7k7Kc zkSQ== X-Gm-Message-State: ACgBeo3OZdxg9ESWXNXg22/Sh1/LfsY/hjFlCGzBff3nd0F4VdTeI7at 1wRFcWTtG/8kMWznK+gxBKWgcQEMqyWP3BboCyx7XF+o X-Google-Smtp-Source: AA6agR6+7GQ0vJqst4kLCxIKGX45Dsvo0f2uVg6sEaVwiq8Tq/phIri/fn34vIItW+1E+jO7M6D73OKVOMSMza+tYA0= X-Received: by 2002:a25:5142:0:b0:691:e8f5:e582 with SMTP id f63-20020a255142000000b00691e8f5e582mr24002602ybb.586.1663069204271; Tue, 13 Sep 2022 04:40:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a81:7402:0:0:0:0:0 with HTTP; Tue, 13 Sep 2022 04:40:03 -0700 (PDT) In-Reply-To: References: From: Paul B Mahol Date: Tue, 13 Sep 2022 13:40:03 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: Fix EOF pts for libavfilter in send_filter_eof() 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 9/11/22, Li-Heng Chen wrote: > When input is video bitstream (e.g. *.264) with framerate set by -r, > ist->pts could be a nonsense value. > > In libavfilter/vf_fps, the pts value of EOF from above is compared to pts > derived from inlink. The wrong EOF pts may trigger a bug, where ffmpeg keeps > writting the last video frame to the output. This bug can be easily > reproduced by the ffmpeg cmd below (h264 bitstreams in fate-suite can > reproduce this issue): > > ffmpeg -r num_in/den_in -i bitstream -vf fps=num_out/den_out -f rawvideo > out.yuv > > Example: ffmpeg -r 24/1 -i fate-suite/h264/bbc2.sample.h264 -vf fps=24/1 -f > rawvideo out.yuv > Signed-off-by: Li-Heng Chen > --- > fftools/ffmpeg.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c > index 0e1477299d..e9a986c95b 100644 > --- a/fftools/ffmpeg.c > +++ b/fftools/ffmpeg.c > @@ -2383,6 +2383,9 @@ static int send_filter_eof(InputStream *ist) > int64_t pts = av_rescale_q_rnd(ist->pts, AV_TIME_BASE_Q, > ist->st->time_base, > AV_ROUND_NEAR_INF | > AV_ROUND_PASS_MINMAX); > > + if(ist->framerate.num) > + pts = ist->cfr_next_pts; > + Style is wrong > for (i = 0; i < ist->nb_filters; i++) { > ret = ifilter_send_eof(ist->filters[i], pts); > if (ret < 0) > -- > 2.32.1 (Apple Git-133) > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".