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 7439F421C7 for ; Thu, 24 Feb 2022 22:19:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ED6B868B378; Fri, 25 Feb 2022 00:19:53 +0200 (EET) Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2333768A0E7; Fri, 25 Feb 2022 00:19:42 +0200 (EET) Received: by mail-vs1-f46.google.com with SMTP id j3so3687508vsi.7; Thu, 24 Feb 2022 14:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Zmkwsn+Y2CN2y/Eig8pWUSM1q3xaWwOHnnBJMqdf8xo=; b=p0ah/8Zn7QSegYqnEtsYpAtC4xQRkHx7NG8gNCMQwknonkU0uPOUCsGh+mN6huCp0r G2/K5iYN0vcF6GEdMmRTEq5uJEWu9oVDuSAFsSfN6laj6+vHSaleZb3fFR80vMMavj4e VM+q2MIUK/5RTsYhrlVKuPgJn/RLL7oh9AD9YVs7LK3xDdpStt/xfANvxDetTEM1ZB9G QH2zRdS320xO50Rt7RQFI2iPZNXIUNCYHGaasW849n6jCKVIluez/2BvF9wohOY52wgi mNjrCpTHBbwkJ3mUfESslYlvIRPmLceBFVIKFUXuLuk5oNaFsGoUF59g0Bsi6OWfnkKp 45xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Zmkwsn+Y2CN2y/Eig8pWUSM1q3xaWwOHnnBJMqdf8xo=; b=cjRbiKTyhqcX2R3T1yjAKQV4Bb0+I0U1VTDiKKucqmcR9D8zy2pFLPITdZkIPcR3Vu p38UX4Wr7AB6bI983MrQ43UXBvtVEkHsxQ5/RbWFl96S25YuY9VW+B2eaDLn7CMWAPdR cK8dCkT+aKedL4mU63vDv+HB4TEdGx2KrABFYCsOn3fRFUWsNj5MFD0LanCbi+zSWfhm 6+IATBKrrItS3cnMinXRpNgpVQjzSL3p8d5Lbd+1msD44QGljv9T+w/PaSBremzQ1Tdr UVPWmBE+wJZDBnEcM/ImN5H4CkCk53SdbqmPEtF2qz8AUYVpI7FhiJs/yU0EgFVR00OF 51bg== X-Gm-Message-State: AOAM533JcUM83kjLvXP1/Th9qR12qplmujMViOk27NdOLHxNJ6hDTHMU 4xiJ7RMrE8/2yqXqZTUTmaXQHg+cmNsKx5ZHstVKEInbrx8= X-Google-Smtp-Source: ABdhPJwG4a01Ph22BH65h4v4PxD3uIy4M8M+KsD5/LIE7BgYvmvwEU7f3tW4Q710PQ8BPdr3vosCcIIQ2Hh1ZtASlkc= X-Received: by 2002:a67:e14d:0:b0:31b:9356:40ff with SMTP id o13-20020a67e14d000000b0031b935640ffmr2265724vsl.51.1645741180406; Thu, 24 Feb 2022 14:19:40 -0800 (PST) MIME-Version: 1.0 References: <20220224203039.CD4BB41059B@natalya.videolan.org> In-Reply-To: From: Thierry Foucu Date: Thu, 24 Feb 2022 14:19:03 -0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vf_tpad: if there is no frame to clone return early 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: FFmpeg git commit log and discussion 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 Thu, Feb 24, 2022 at 1:50 PM Paul B Mahol wrote: > On Thu, Feb 24, 2022 at 10:36 PM Thierry Foucu wrote: > > > On Thu, Feb 24, 2022 at 1:28 PM Paul B Mahol wrote: > > > > > On Thu, Feb 24, 2022 at 10:12 PM Thierry Foucu > wrote: > > > > > > > On Thu, Feb 24, 2022 at 12:30 PM Paul B Mahol > > wrote: > > > > > > > > > ffmpeg | branch: master | Paul B Mahol | Thu > Feb > > 24 > > > > > 20:32:41 2022 +0100| [3715f2f8643695940582ce040b7a052cccfb9db2] | > > > > > committer: Paul B Mahol > > > > > > > > > > avfilter/vf_tpad: if there is no frame to clone return early > > > > > > > > > > > > > > > > > > > > > > > > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3715f2f8643695940582ce040b7a052cccfb9db2 > > > > > --- > > > > > > > > > > libavfilter/vf_tpad.c | 5 +++++ > > > > > 1 file changed, 5 insertions(+) > > > > > > > > > > diff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c > > > > > index e5acece1e4..120dbcb4d3 100644 > > > > > --- a/libavfilter/vf_tpad.c > > > > > +++ b/libavfilter/vf_tpad.c > > > > > @@ -148,6 +148,11 @@ static int activate(AVFilterContext *ctx) > > > > > frame->data, frame->linesize, > > > > > 0, 0, frame->width, frame->height); > > > > > } else if (s->stop_mode == 1) { > > > > > + if (!s->cache_stop) { > > > > > + s->pad_stop = 0; > > > > > + ff_outlink_set_status(outlink, AVERROR_EOF, > s->pts); > > > > > + return 0; > > > > > + } > > > > > frame = av_frame_clone(s->cache_stop); > > > > > if (!frame) > > > > > return AVERROR(ENOMEM); > > > > > > > > > > > > > > The problem with this solution is that the tpad will then not do what > > we > > > > are expecting, which is padding video track, and the output file will > > not > > > > have the desired duration. > > > > Will it not be better to just output black frame (aka stop_mode == > 0) , > > > > something like that? > > > > > > > > > > I doubt that, clone is clone, there is no point in padding stream that > > have > > > no frames at all. > > > > > > > > > > > The sample I forwarded to JB has video frames. The problem was that there > > was a re-init of the filter chain after a resolution change and after the > > re-init, there were no frames but got frames before the re-init. > > I will understand for a media file which has NEVER received a video frame > > and in this case, this is the correct solution. > > > > Hmm, so you encode output with resolution change, why not use scale filter > as first filter and then no resolution ever change for rest of graph? > Adding support for resolution changes to all filters is very time consuming > task and I see no real benefit in doing that now. > We do have the scale filter in front of the tpad filter. Here is the filter chain we are using idet=1.04:1.5,yadif=0:-1:1,scale=+528:+864:flags=bicubic,setsar=1,fps=fps=16.601,tpad=stop_mode=clone:stop_duration=2808ms And it does crash. Even just fps=fps=16.601,tpad=stop_mode=clone:stop_duration=2808ms reproduce the problem. > > > > > > > > > > > > > > iff --git a/libavfilter/vf_tpad.c b/libavfilter/vf_tpad.c > > > > index e5acece1e4..5e4062e9f2 100644 > > > > --- a/libavfilter/vf_tpad.c > > > > +++ b/libavfilter/vf_tpad.c > > > > @@ -140,7 +140,7 @@ static int activate(AVFilterContext *ctx) > > > > ff_outlink_set_status(outlink, AVERROR_EOF, s->pts); > > > > return 0; > > > > } > > > > - if (s->stop_mode == 0) { > > > > + if (s->stop_mode == 0 || !s->cache_stop) { > > > > frame = ff_get_video_buffer(outlink, outlink->w, > > > outlink->h); > > > > if (!frame) > > > > return AVERROR(ENOMEM); > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > ffmpeg-cvslog mailing list > > > > > ffmpeg-cvslog@ffmpeg.org > > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog > > > > > > > > > > To unsubscribe, visit link above, or email > > > > > ffmpeg-cvslog-request@ffmpeg.org with subject "unsubscribe". > > > > > > > > > > > > > > > > > -- > > > > > > > > Thierry Foucu > > > > _______________________________________________ > > > > 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". > > > > > > > > > -- > > > > Thierry Foucu > > _______________________________________________ > > 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". > -- Thierry Foucu _______________________________________________ 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".