* [FFmpeg-devel] [PATCH] avfilter/vf_frei0r: fix time not being passed in seconds (PR #20379)
@ 2025-08-31 14:22 breunigs via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: breunigs via ffmpeg-devel @ 2025-08-31 14:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: breunigs
PR #20379 opened by breunigs
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20379
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20379.patch
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
>From 08c6099b30b22e4d016c782b01ecd080f05818df Mon Sep 17 00:00:00 2001
From: Stefan Breunig <stefan-ffmpeg-devel@breunig.xyz>
Date: Sun, 6 Jul 2025 08:35:11 +0200
Subject: [PATCH] avfilter/vf_frei0r: fix time not being passed in seconds
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 <stefan-ffmpeg-devel@breunig.xyz>
---
Changelog | 1 +
libavfilter/vf_frei0r.c | 2 +-
tests/fate/filter-video.mak | 5 +++++
tests/ref/fate/filter-frei0r-filter | 10 ++++++++++
4 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 tests/ref/fate/filter-frei0r-filter
diff --git a/Changelog b/Changelog
index 96d616991d..2f36caf2b7 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
version <next>:
- ffprobe -codec option
- EXIF Metadata Parsing
+- vf_frei0r: properly pass time to filters in seconds
version 8.0:
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 2b41574df2..0b430fed16 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -705,6 +705,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.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-31 14:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-31 14:22 [FFmpeg-devel] [PATCH] avfilter/vf_frei0r: fix time not being passed in seconds (PR #20379) breunigs via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git