From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 0C6704DEFA for ; Sun, 6 Jul 2025 06:58:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id B369E68F68D; Sun, 6 Jul 2025 09:58:34 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Sun, 6 Jul 2025 08:57:57 +0200 MIME-Version: 1.0 Message-ID: List-Id: FFmpeg development discussions and patches List-Post: From: Stefan Breunig via ffmpeg-devel Precedence: list Cc: Stefan Breunig X-Mailman-Version: 2.1.29 X-BeenThere: ffmpeg-devel@ffmpeg.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: FFmpeg development discussions and patches List-Help: Subject: [FFmpeg-devel] [PATCH] avfilter/vf_frei0r: fix time not being passed in seconds Content-Type: multipart/mixed; boundary="===============7838532049761857355==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7838532049761857355== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from outbound.mr.icloud.com (p-west2-cluster1-host4-snip4-3.eps.apple.com [57.103.68.76]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 2777B68F68D for ; Sun, 6 Jul 2025 09:58:28 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breunig.xyz; s=sig1; bh=YFpXK17MaOnAFz5OTsO+nRiTU79Wr814Kpz5TGvGPAs=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=oKl1rbSnjjtLWGPXDWIF/pXH06ILL6bCmsJUQ6cIoWr8rMTXmQ3iV6XsbTtvqpqmy Gf8e7B4lBvWmJ8/HKXHN7yd0sZ/4fcJpubqMJNrjAI1YFKMRncXRq5M6GsFSfZl5bt L3F8+Dufkhxb+oO9goUI462/SLaNFyDjdqB7J65dQc9iC8Fj8RImuyS56Smz4FsTPy hnfYxfTvZtAMnNZIFp7QMBffAYYTeNp9LpWqGgjMaQ1GpXZNblPRupcApQNSWNo2aE g+lhMH9qrAFOilnDY7GaixoQs0jRQZO6NI64hqrZsjAUAmeJ7q2u46hatWFY50THhl 57HbV6D7rbT6Q== Received: from outbound.mr.icloud.com (unknown [127.0.0.2]) by outbound.mr.icloud.com (Postfix) with ESMTPS id 0C4D118000B1; Sun, 6 Jul 2025 06:58:25 +0000 (UTC) Received: from igni.taile89d0.ts.net (mr-asmtp-me-k8s.p00.prod.me.com [17.57.152.38]) by outbound.mr.icloud.com (Postfix) with ESMTPSA id 069C01800094; Sun, 6 Jul 2025 06:58:24 +0000 (UTC) From: Stefan Breunig To: ffmpeg-devel@ffmpeg.org Subject: [PATCH] avfilter/vf_frei0r: fix time not being passed in seconds Date: Sun, 6 Jul 2025 08:57:57 +0200 Message-ID: <20250706065757.656194-1-stefan-ffmpeg-devel@breunig.xyz> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: 0YIBVsLRxDpPYguzrnA744UDZYNtIeTy X-Proofpoint-ORIG-GUID: 0YIBVsLRxDpPYguzrnA744UDZYNtIeTy X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNzA2MDA0MiBTYWx0ZWRfX9dXJh6lqre7A 3PT07p6zmmVHNTpYH5pCAU5Wu+RJFjMsT8MGid8UOgOm7axFWTPzLRvE+uYLwul7FHWEGMCMUY9 Gp8/yC7FbNvV2eHxYXGVbyDgLVnHutthbagGlCT4Uxt8cIeJ8UcYTLS0nv4PpzOBPeQKD3DRIe9 m3e03BBQAOk045WNZDDMcoyB5xl+8FXf9GzUNm+KUIR8g93x5qkRszw83HNh99FS3b5O+RgZHDK 5a+DfBPDuIwdfBmREwxRleJlFPqeSO3OQ+mGhSx1FgWcu3T+NqxbEcbn4CewxdxNLvODTlaJo= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-07-04_07,2025-07-04_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 adultscore=0 phishscore=0 clxscore=1030 suspectscore=0 malwarescore=0 mlxlogscore=320 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2507060042 The frei0r API expects the time in seconds, but was given it in milliseconds. The bug might exist since 41f1d3a (~14 years ago), but plugins depending on the time are unwatchable without this patch. For example: ffmpeg -filter_complex "testsrc2=d=5,frei0r=distort0r" out.mp4 Signed-off-by: Stefan Breunig --- libavfilter/vf_frei0r.c | 2 +- tests/fate/filter-video.mak | 5 +++++ tests/ref/fate/filter-frei0r-filter | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/ref/fate/filter-frei0r-filter diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index 1284e27310..50d81d220f 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -379,7 +379,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) in = in2; } - s->update(s->instance, in->pts * av_q2d(inlink->time_base) * 1000, + s->update(s->instance, in->pts * av_q2d(inlink->time_base), (const uint32_t *)in->data[0], (uint32_t *)out->data[0]); diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 34cf7afa83..775febfde4 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -701,6 +701,11 @@ $(FATE_FILTER_VSYNTH-yes): SRC = $(TARGET_PATH)/tests/vsynth1/%02d.pgm FATE_FFMPEG += $(FATE_FILTER_VSYNTH-yes) +FATE_FILTER_FREI0R-$(call ALLYES, TESTSRC2_FILTER FREI0R_FILTER) = fate-filter-frei0r-filter +fate-filter-frei0r-filter: SRC = testsrc2=r=1:d=5 +fate-filter-frei0r-filter: CMD = framecrc -lavfi "$(SRC),frei0r=enable=gte(n\,3):filter_name=distort0r" +FATE_FFMPEG += $(FATE_FILTER_FREI0R-yes) + # # Metadata tests # diff --git a/tests/ref/fate/filter-frei0r-filter b/tests/ref/fate/filter-frei0r-filter new file mode 100644 index 0000000000..4b1588785d --- /dev/null +++ b/tests/ref/fate/filter-frei0r-filter @@ -0,0 +1,10 @@ +#tb 0: 1/1 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 320x240 +#sar 0: 1/1 +0, 0, 0, 1, 307200, 0x30630897 +0, 1, 1, 1, 307200, 0xd08784dd +0, 2, 2, 1, 307200, 0xe94387a0 +0, 3, 3, 1, 307200, 0x5df7a70e +0, 4, 4, 1, 307200, 0x9c203210 -- 2.47.2 --===============7838532049761857355== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============7838532049761857355==--