From patchwork Wed Mar 27 15:08:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 47542 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f96:b0:1a3:b6bb:3029 with SMTP id mm22csp691032pzb; Wed, 27 Mar 2024 08:09:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXXKDFFnDH1nzoxchwphQZBfolIf7EMwO/9CDIl9dDGCG0aOSnB2lQ0P2SCdUreZz9AuK7ePTi1glFwAVyF72ypWdq2VeKeuZQN6w== X-Google-Smtp-Source: AGHT+IFTHeG7u2Lbj8eik+AVDoAl/f+ePHvhm0OlXY1K9nG1O5OERHra7ERlLwXDeos/5B55yUyx X-Received: by 2002:a17:906:6a07:b0:a47:5104:c39 with SMTP id qw7-20020a1709066a0700b00a4751040c39mr8748251ejc.0.1711552151105; Wed, 27 Mar 2024 08:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711552151; cv=none; d=google.com; s=arc-20160816; b=UCW5ivTjd8YCrf16De7FTq1gEkiEzSPJ0rrqK6EWbBT4NHOozqbpXum67ZGnUj0T74 WEr7BzY0qpfN5JDzcd5iS5roahUvhA2mSToBOnYVGAKZUAu97EWWVmgqftgL8YBFAd7z 4uU07tRZ0ug54qnWxZLNOKdtEwEMReIxLlQML3YxUywjMePzThtYi2TR7k57AFJjX3/o 2cRTY1T3QlPz/SzbjyIMf9FFzybbKV/GerF02SYwY3b44+Q08uUZ1RkbjIiliE0Q2qbi mNKBC/bT/skFSt6v+8Zhc6/Z/F9BsW6c4wAqXnhMjeEkiJROQMXxhkaYRvSnD4H9nPHg kFWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=6VQ5NImEB4FEiSr8GpmwgKKagTb7TUzPXpOBXBKRZTY=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=SB+mTWekl+YudSpVBy37c3ya7AaYhJHAGL6LPwi9XyBm7Sxvg/ORxc0wDmKLc8oADn QnllYMjfycrRsdge3PhamL8mS0BnwcgTBfXBENPqEFP579HqluuB99fxepdvmBDSYKkz o/9YEh9ytLqwgr378Tx52EDey5rE99c3GPZ0pKtw4JXy7ZSqcjHJ+zFlrq/QQRxqJ20b yEmIcHCcv/2MNHc+Wc6ZgxvifSrXTNLHpI83nAiOrJFmGf4+1y9te6/GJ0Yl3sDVp4jX Fj4aZ9xxS3AWn8DK/ZjkUlXBORFifsdAtnJw+8WDabqgUhJEH80jVOrvG6XIAM1iUHPP 28QA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=bH3G3qFK; 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 ky25-20020a170907779900b00a46d75a522esi4609950ejc.792.2024.03.27.08.09.10; Wed, 27 Mar 2024 08:09:11 -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; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=bH3G3qFK; 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 3272C68D6A4; Wed, 27 Mar 2024 17:08:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 70BF368D66C for ; Wed, 27 Mar 2024 17:08:46 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=bH3G3qFK; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id B45A24D61 for ; Wed, 27 Mar 2024 16:08:45 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id KJPsYWocN1UZ for ; Wed, 27 Mar 2024 16:08:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1711552123; bh=DCTycVfltcFkm72uhZZv+VlwY+ZHH0sxjfPKNt6ePgc=; h=From:To:Subject:Date:From; b=bH3G3qFKXlgFsJb9E0qKQyI1RtPTzcKptcYtoX/YuxZAIhc3g40HCZmgvB8nY7YCL y7ajT6Enn18AJOrdBaSwhOajizmHQDeelX9PdMVNfuI8pkdRwUmgexqc9dhZ11JbkX aqZJUTdxDPuxlCH7uyKqRf3XyHRxVnBaSauYmJ60aLHUaVLiNpZzdFzi95wzzmHykW GOUrAVzDu8W6RFm3l6GI/uh5N9LWevqORKE8kkhXz4JaCEucWCW9IIHSZVU8yocpvn zkE8OXObe37tVS+ruojfBCcIO7NkL4nT9852SKy+l0K4hc/F4uResPUjtqu5qJl6e4 zztg03kUUOtbA== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 481A34462 for ; Wed, 27 Mar 2024 16:08:43 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 24B8A3A0357 for ; Wed, 27 Mar 2024 16:08:43 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Mar 2024 16:08:40 +0100 Message-ID: <20240327150841.8311-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavf/vf_setpts: unset output framerate 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 41Z1ADvpTc59 This filter produces VFR output in general. Avoids dropping frames in the setpts test. --- libavfilter/setpts.c | 17 ++++++- tests/ref/fate/filter-setpts | 89 +++++++++++++++++++++--------------- 2 files changed, 67 insertions(+), 39 deletions(-) diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c index 88a8d6af86..4f02a9a617 100644 --- a/libavfilter/setpts.c +++ b/libavfilter/setpts.c @@ -150,6 +150,13 @@ static int config_input(AVFilterLink *inlink) return 0; } +static int config_output_video(AVFilterLink *outlink) +{ + outlink->frame_rate = (AVRational){ 1, 0 }; + + return 0; +} + #define BUF_SIZE 64 static inline char *double2int64str(char *buf, double v) @@ -322,6 +329,14 @@ static const AVFilterPad avfilter_vf_setpts_inputs[] = { }, }; +static const AVFilterPad outputs_video[] = { + { + .name = "default", + .type = AVMEDIA_TYPE_VIDEO, + .config_props = config_output_video, + }, +}; + const AVFilter ff_vf_setpts = { .name = "setpts", .description = NULL_IF_CONFIG_SMALL("Set PTS for the output video frame."), @@ -335,7 +350,7 @@ const AVFilter ff_vf_setpts = { .priv_class = &setpts_class, FILTER_INPUTS(avfilter_vf_setpts_inputs), - FILTER_OUTPUTS(ff_video_default_filterpad), + FILTER_OUTPUTS(outputs_video), }; #endif /* CONFIG_SETPTS_FILTER */ diff --git a/tests/ref/fate/filter-setpts b/tests/ref/fate/filter-setpts index efdcf6a16e..8aa7a1e6a0 100644 --- a/tests/ref/fate/filter-setpts +++ b/tests/ref/fate/filter-setpts @@ -1,42 +1,55 @@ -#tb 0: 1/25 +#tb 0: 1/1000 #media_type 0: video #codec_id 0: rawvideo #dimensions 0: 352x288 #sar 0: 0/1 -0, 0, 0, 1, 152064, 0x05b789ef -0, 1, 1, 1, 152064, 0x4bb46551 -0, 2, 2, 1, 152064, 0x9dddf64a -0, 3, 3, 1, 152064, 0x2a8380b0 -0, 4, 4, 1, 152064, 0x4de3b652 -0, 5, 5, 1, 152064, 0xedb5a8e6 -0, 6, 6, 1, 152064, 0x5ab58bac -0, 7, 7, 1, 152064, 0x1f1b8026 -0, 8, 8, 1, 152064, 0x91373915 -0, 9, 9, 1, 152064, 0x30f5fcd5 -0, 10, 10, 1, 152064, 0xc711ad61 -0, 11, 11, 1, 152064, 0x52a48ddd -0, 12, 12, 1, 152064, 0xa91c0f05 -0, 13, 13, 1, 152064, 0x8e364e18 -0, 14, 14, 1, 152064, 0xf25f6acc -0, 15, 15, 1, 152064, 0xf34ddbff -0, 16, 16, 1, 152064, 0x9dc72412 -0, 17, 17, 1, 152064, 0x445d1d59 -0, 18, 18, 1, 152064, 0x2f2768ef -0, 19, 19, 1, 152064, 0x95579936 -0, 20, 20, 1, 152064, 0x43d796b5 -0, 21, 21, 1, 152064, 0x76d2a455 -0, 22, 22, 1, 152064, 0x6dc3650e -0, 23, 23, 1, 152064, 0x0f9d6aca -0, 24, 24, 1, 152064, 0xd766fc8d -0, 25, 25, 1, 152064, 0xe22f7a30 -0, 26, 26, 1, 152064, 0xfa8d94fb -0, 27, 27, 1, 152064, 0x4c9737ab -0, 28, 28, 1, 152064, 0xa50d01f8 -0, 29, 29, 1, 152064, 0x88734edd -0, 30, 30, 1, 152064, 0xd2735925 -0, 31, 31, 1, 152064, 0x20cebfa9 -0, 32, 32, 1, 152064, 0x575c20ec -0, 33, 33, 1, 152064, 0x61b47e73 -0, 34, 34, 1, 152064, 0x09ef53ff -0, 35, 35, 1, 152064, 0x6e88c5c2 -0, 36, 36, 1, 152064, 0x4bbad8ea +0, 0, 0, 40, 152064, 0x05b789ef +0, 28, 28, 40, 152064, 0x4bb46551 +0, 57, 57, 40, 152064, 0x9dddf64a +0, 86, 86, 40, 152064, 0x2a8380b0 +0, 115, 115, 40, 152064, 0x4de3b652 +0, 144, 144, 40, 152064, 0xedb5a8e6 +0, 172, 172, 40, 152064, 0xe20f7c23 +0, 201, 201, 40, 152064, 0x5ab58bac +0, 229, 229, 40, 152064, 0x1f1b8026 +0, 258, 258, 40, 152064, 0x91373915 +0, 286, 286, 40, 152064, 0x02344760 +0, 314, 314, 40, 152064, 0x30f5fcd5 +0, 343, 343, 40, 152064, 0xc711ad61 +0, 371, 371, 40, 152064, 0x24eca223 +0, 399, 399, 40, 152064, 0x52a48ddd +0, 427, 427, 40, 152064, 0xa91c0f05 +0, 456, 456, 40, 152064, 0x8e364e18 +0, 484, 484, 40, 152064, 0xb15d38c8 +0, 512, 512, 40, 152064, 0xf25f6acc +0, 541, 541, 40, 152064, 0xf34ddbff +0, 570, 570, 40, 152064, 0xfc7bf570 +0, 598, 598, 40, 152064, 0x9dc72412 +0, 627, 627, 40, 152064, 0x445d1d59 +0, 656, 656, 40, 152064, 0x2f2768ef +0, 685, 685, 40, 152064, 0xce09f9d6 +0, 714, 714, 40, 152064, 0x95579936 +0, 743, 743, 40, 152064, 0x43d796b5 +0, 772, 772, 40, 152064, 0xd780d887 +0, 800, 800, 40, 152064, 0x76d2a455 +0, 829, 829, 40, 152064, 0x6dc3650e +0, 858, 858, 40, 152064, 0x0f9d6aca +0, 887, 887, 40, 152064, 0xe295c51e +0, 915, 915, 40, 152064, 0xd766fc8d +0, 944, 944, 40, 152064, 0xe22f7a30 +0, 972, 972, 40, 152064, 0x7fea4378 +0, 1000, 1000, 40, 152064, 0xfa8d94fb +0, 1029, 1029, 40, 152064, 0x4c9737ab +0, 1057, 1057, 40, 152064, 0xa50d01f8 +0, 1085, 1085, 40, 152064, 0x0b07594c +0, 1113, 1113, 40, 152064, 0x88734edd +0, 1142, 1142, 40, 152064, 0xd2735925 +0, 1170, 1170, 40, 152064, 0xd4e49e08 +0, 1198, 1198, 40, 152064, 0x20cebfa9 +0, 1227, 1227, 40, 152064, 0x575c20ec +0, 1255, 1255, 40, 152064, 0xfd500471 +0, 1284, 1284, 40, 152064, 0x61b47e73 +0, 1313, 1313, 40, 152064, 0x09ef53ff +0, 1341, 1341, 40, 152064, 0x6e88c5c2 +0, 1370, 1370, 40, 152064, 0xbb87b483 +0, 1399, 1399, 40, 152064, 0x4bbad8ea From patchwork Wed Mar 27 15:08:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 47541 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f96:b0:1a3:b6bb:3029 with SMTP id mm22csp690851pzb; Wed, 27 Mar 2024 08:08:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWNb9mNtwr4nJYv6wKqvZ0ENdEyMaLKx6qUKsKBdYIXPn/UyZdY2sI1FkRJ/J/zcC60XLLhw83MX35XhZCPcpeQ2CmuCK/1bXBVgQ== X-Google-Smtp-Source: AGHT+IGye4/lRpumycSu10qNR+1r90Zr5QGs3DvqBA/ozILDD3BBURuBgHEKaQB0wrY7QpWG9Z5h X-Received: by 2002:ac2:5b43:0:b0:512:bd32:ed55 with SMTP id i3-20020ac25b43000000b00512bd32ed55mr8938801lfp.4.1711552138058; Wed, 27 Mar 2024 08:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711552138; cv=none; d=google.com; s=arc-20160816; b=rpP/chGSdp8JQpBAkfB8KxbuxkR2H+s4Wu1W+35wSZZlBnzX+filzQfcZZvg5rRKN1 FmClhN1LPX0MKqi/zK3ZOYLRp1R4TcJzUQ8qquCnp3+8sEY8c6jSDDzTHa2oLk5D2j75 blRFayVDkxzqaRKSkfGFl65Yua810yJHHCXhNyJ3JT3LlRJIYKNU68uRGzcLBtyQ1eNq tSFqNY/qgMvbO5v8xzlxP9jGDZppMHt4f952oJjG7KRbsF5NqyA2e0JJCiItYD2RHNnp O8lxCsOWpI/Qcm5SU8ez7R9QNtifJq4CJAhSWbDkxD0RRbEJYkC3R/tbMOVa/5csFJiu 2HBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:dkim-signature:delivered-to; bh=iqNNB7EFJRLJbD3DvWKnmXvqdJ1VDAU5k1ejUvRQFAM=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Q5O9bw7X1uHrvVHj/xG1wRjKWrtftq7LHb6CTYBYCaU1W0zBsBhJ/HOSsqRHEHvXF2 8BzG1Mm49K6gFm15XgP4C2PgiFgSbTM5EKtajm7DEMGLnQWpne2/Ivb6J4dzQCb+P0er Rndtk0wq58MLCbeoA1k9JAxicB0x7GDRu7X2aJG7GwvWo66/v5EsVUu5HvKLQuVIVluh oJ9nQEcOJz2RGAniJg/xyJuWeD5KeUeuk3zhaAqCOf+tAlEyldNyhLwH/UBOfqBNana4 mJjbZRfRanBsdarF6AXFhhB7RqtEAq9fGDhXI5/IvnMuTMDrMwI1Eqe3FLGqSXWdezVZ uYCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b="mGb1Nu/f"; 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 hv21-20020a17090760d500b00a4743caccf0si4751941ejc.997.2024.03.27.08.08.57; Wed, 27 Mar 2024 08:08:58 -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; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b="mGb1Nu/f"; 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 08D0568D695; Wed, 27 Mar 2024 17:08:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6DEF168D5AD for ; Wed, 27 Mar 2024 17:08:46 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=mGb1Nu/f; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 9F2154D5C for ; Wed, 27 Mar 2024 16:08:45 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id q9KWmcC7Uv9K for ; Wed, 27 Mar 2024 16:08:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1711552123; bh=VwPRZovzR0wqWMxgU6RxxCEkshUMDYHlILLxEt2mQ6Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mGb1Nu/fl4qqc4Q+FjppiBVBajjpNPIn52aiv9RB8JR8gswMbREvdVeicxGqdRSk5 ZTFo7HA2l4G6nnVEaF9h5liuxfcYzCXG9aLq6fXfokIYCBPloIpbFnoEAbHJyFRY3x cdfFOVTBCpPb8qhCJLYuNUUE70UyUtavkkt54aG2/pISP4ESCDeIDypRmXzD9lP6pU po61QzNBBvmryOJGnZ9ee8IqxpMAQMwZPShfi0Aipt9XAd30cpz9JsGpBmkgJseT6g dvSiGpjAXD1ClW03+AJ1Eqgy/n6fXe3l/8PvVWIOqpKm+Orlf6DrihxXIH7W1tHYfN T3Z5x1hpLuKNw== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 4A86D4D51 for ; Wed, 27 Mar 2024 16:08:43 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 321A83A0582 for ; Wed, 27 Mar 2024 16:08:43 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Mar 2024 16:08:41 +0100 Message-ID: <20240327150841.8311-2-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240327150841.8311-1-anton@khirnov.net> References: <20240327150841.8311-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavfi/setpts: unset frame durations 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: wxxbC65jlt7t Actual frame durations are, in general, not computable without buffering a frame. --- libavfilter/setpts.c | 1 + tests/ref/fate/filter-setpts | 100 +++++++++++++++++------------------ 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c index 4f02a9a617..60cf2b642e 100644 --- a/libavfilter/setpts.c +++ b/libavfilter/setpts.c @@ -205,6 +205,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) d = eval_pts(setpts, inlink, frame, frame->pts); frame->pts = D2TS(d); + frame->duration = 0; av_log(inlink->dst, AV_LOG_TRACE, "N:%"PRId64" PTS:%s T:%f", diff --git a/tests/ref/fate/filter-setpts b/tests/ref/fate/filter-setpts index 8aa7a1e6a0..08e0203831 100644 --- a/tests/ref/fate/filter-setpts +++ b/tests/ref/fate/filter-setpts @@ -3,53 +3,53 @@ #codec_id 0: rawvideo #dimensions 0: 352x288 #sar 0: 0/1 -0, 0, 0, 40, 152064, 0x05b789ef -0, 28, 28, 40, 152064, 0x4bb46551 -0, 57, 57, 40, 152064, 0x9dddf64a -0, 86, 86, 40, 152064, 0x2a8380b0 -0, 115, 115, 40, 152064, 0x4de3b652 -0, 144, 144, 40, 152064, 0xedb5a8e6 -0, 172, 172, 40, 152064, 0xe20f7c23 -0, 201, 201, 40, 152064, 0x5ab58bac -0, 229, 229, 40, 152064, 0x1f1b8026 -0, 258, 258, 40, 152064, 0x91373915 -0, 286, 286, 40, 152064, 0x02344760 -0, 314, 314, 40, 152064, 0x30f5fcd5 -0, 343, 343, 40, 152064, 0xc711ad61 -0, 371, 371, 40, 152064, 0x24eca223 -0, 399, 399, 40, 152064, 0x52a48ddd -0, 427, 427, 40, 152064, 0xa91c0f05 -0, 456, 456, 40, 152064, 0x8e364e18 -0, 484, 484, 40, 152064, 0xb15d38c8 -0, 512, 512, 40, 152064, 0xf25f6acc -0, 541, 541, 40, 152064, 0xf34ddbff -0, 570, 570, 40, 152064, 0xfc7bf570 -0, 598, 598, 40, 152064, 0x9dc72412 -0, 627, 627, 40, 152064, 0x445d1d59 -0, 656, 656, 40, 152064, 0x2f2768ef -0, 685, 685, 40, 152064, 0xce09f9d6 -0, 714, 714, 40, 152064, 0x95579936 -0, 743, 743, 40, 152064, 0x43d796b5 -0, 772, 772, 40, 152064, 0xd780d887 -0, 800, 800, 40, 152064, 0x76d2a455 -0, 829, 829, 40, 152064, 0x6dc3650e -0, 858, 858, 40, 152064, 0x0f9d6aca -0, 887, 887, 40, 152064, 0xe295c51e -0, 915, 915, 40, 152064, 0xd766fc8d -0, 944, 944, 40, 152064, 0xe22f7a30 -0, 972, 972, 40, 152064, 0x7fea4378 -0, 1000, 1000, 40, 152064, 0xfa8d94fb -0, 1029, 1029, 40, 152064, 0x4c9737ab -0, 1057, 1057, 40, 152064, 0xa50d01f8 -0, 1085, 1085, 40, 152064, 0x0b07594c -0, 1113, 1113, 40, 152064, 0x88734edd -0, 1142, 1142, 40, 152064, 0xd2735925 -0, 1170, 1170, 40, 152064, 0xd4e49e08 -0, 1198, 1198, 40, 152064, 0x20cebfa9 -0, 1227, 1227, 40, 152064, 0x575c20ec -0, 1255, 1255, 40, 152064, 0xfd500471 -0, 1284, 1284, 40, 152064, 0x61b47e73 -0, 1313, 1313, 40, 152064, 0x09ef53ff -0, 1341, 1341, 40, 152064, 0x6e88c5c2 -0, 1370, 1370, 40, 152064, 0xbb87b483 -0, 1399, 1399, 40, 152064, 0x4bbad8ea +0, 0, 0, 0, 152064, 0x05b789ef +0, 28, 28, 0, 152064, 0x4bb46551 +0, 57, 57, 0, 152064, 0x9dddf64a +0, 86, 86, 0, 152064, 0x2a8380b0 +0, 115, 115, 0, 152064, 0x4de3b652 +0, 144, 144, 0, 152064, 0xedb5a8e6 +0, 172, 172, 0, 152064, 0xe20f7c23 +0, 201, 201, 0, 152064, 0x5ab58bac +0, 229, 229, 0, 152064, 0x1f1b8026 +0, 258, 258, 0, 152064, 0x91373915 +0, 286, 286, 0, 152064, 0x02344760 +0, 314, 314, 0, 152064, 0x30f5fcd5 +0, 343, 343, 0, 152064, 0xc711ad61 +0, 371, 371, 0, 152064, 0x24eca223 +0, 399, 399, 0, 152064, 0x52a48ddd +0, 427, 427, 0, 152064, 0xa91c0f05 +0, 456, 456, 0, 152064, 0x8e364e18 +0, 484, 484, 0, 152064, 0xb15d38c8 +0, 512, 512, 0, 152064, 0xf25f6acc +0, 541, 541, 0, 152064, 0xf34ddbff +0, 570, 570, 0, 152064, 0xfc7bf570 +0, 598, 598, 0, 152064, 0x9dc72412 +0, 627, 627, 0, 152064, 0x445d1d59 +0, 656, 656, 0, 152064, 0x2f2768ef +0, 685, 685, 0, 152064, 0xce09f9d6 +0, 714, 714, 0, 152064, 0x95579936 +0, 743, 743, 0, 152064, 0x43d796b5 +0, 772, 772, 0, 152064, 0xd780d887 +0, 800, 800, 0, 152064, 0x76d2a455 +0, 829, 829, 0, 152064, 0x6dc3650e +0, 858, 858, 0, 152064, 0x0f9d6aca +0, 887, 887, 0, 152064, 0xe295c51e +0, 915, 915, 0, 152064, 0xd766fc8d +0, 944, 944, 0, 152064, 0xe22f7a30 +0, 972, 972, 0, 152064, 0x7fea4378 +0, 1000, 1000, 0, 152064, 0xfa8d94fb +0, 1029, 1029, 0, 152064, 0x4c9737ab +0, 1057, 1057, 0, 152064, 0xa50d01f8 +0, 1085, 1085, 0, 152064, 0x0b07594c +0, 1113, 1113, 0, 152064, 0x88734edd +0, 1142, 1142, 0, 152064, 0xd2735925 +0, 1170, 1170, 0, 152064, 0xd4e49e08 +0, 1198, 1198, 0, 152064, 0x20cebfa9 +0, 1227, 1227, 0, 152064, 0x575c20ec +0, 1255, 1255, 0, 152064, 0xfd500471 +0, 1284, 1284, 0, 152064, 0x61b47e73 +0, 1313, 1313, 0, 152064, 0x09ef53ff +0, 1341, 1341, 0, 152064, 0x6e88c5c2 +0, 1370, 1370, 0, 152064, 0xbb87b483 +0, 1399, 1399, 0, 152064, 0x4bbad8ea