Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Stefan Breunig via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Stefan Breunig <stefan-ffmpeg-devel@breunig.xyz>
Subject: [FFmpeg-devel] [PATCH] avfilter/vf_frei0r: fix time not being passed in seconds
Date: Sun,  6 Jul 2025 08:57:57 +0200
Message-ID: <mailman.5357.1751785113.1384.ffmpeg-devel@ffmpeg.org> (raw)

[-- Attachment #1: Type: message/rfc822, Size: 4908 bytes --]

From: Stefan Breunig <stefan-ffmpeg-devel@breunig.xyz>
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>

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>
---
 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


[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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".

                 reply	other threads:[~2025-07-06  6:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mailman.5357.1751785113.1384.ffmpeg-devel@ffmpeg.org \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=stefan-ffmpeg-devel@breunig.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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