* [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration
@ 2022-09-28 9:21 Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 2/8] lavfi/setpts: unset frame durations Anton Khirnov
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
---
libavfilter/vf_fps.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 0e5a1fec35..051d278f54 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -291,6 +291,7 @@ static int write_frame(AVFilterContext *ctx, FPSContext *s, AVFilterLink *outlin
// Make sure Closed Captions will not be duplicated
av_frame_remove_side_data(s->frames[0], AV_FRAME_DATA_A53_CC);
frame->pts = s->next_pts++;
+ frame->duration = 1;
av_log(ctx, AV_LOG_DEBUG, "Writing frame with pts %"PRId64" to pts %"PRId64"\n",
s->frames[0]->pts, frame->pts);
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 2/8] lavfi/setpts: unset frame durations
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
@ 2022-09-28 9:21 ` Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 3/8] lavfi/avf_ahistogram: set " Anton Khirnov
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
This filter cannot know frame durations.
---
libavfilter/setpts.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c
index 171fae88c0..ba653df4ae 100644
--- a/libavfilter/setpts.c
+++ b/libavfilter/setpts.c
@@ -185,6 +185,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 POS:%s",
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 3/8] lavfi/avf_ahistogram: set frame durations
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 2/8] lavfi/setpts: unset frame durations Anton Khirnov
@ 2022-09-28 9:21 ` Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 4/8] lavfi/avf_aphasemeter: " Anton Khirnov
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
The filter is supposed to produce CFR output.
---
libavfilter/avf_ahistogram.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/avf_ahistogram.c b/libavfilter/avf_ahistogram.c
index d14e0bcfac..c45493730d 100644
--- a/libavfilter/avf_ahistogram.c
+++ b/libavfilter/avf_ahistogram.c
@@ -245,6 +245,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
memset(s->out->data[3] + n * s->out->linesize[0], 0, w);
}
s->out->pts = av_rescale_q(in->pts, inlink->time_base, outlink->time_base);
+ s->out->duration = 1;
s->first = s->frame_count;
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 4/8] lavfi/avf_aphasemeter: set frame durations
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 2/8] lavfi/setpts: unset frame durations Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 3/8] lavfi/avf_ahistogram: set " Anton Khirnov
@ 2022-09-28 9:21 ` Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 5/8] lavfi/avf_avectorscope: " Anton Khirnov
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
The filter is supposed to produce CFR output.
---
libavfilter/avf_aphasemeter.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
index 3501e62825..0f7692982c 100644
--- a/libavfilter/avf_aphasemeter.c
+++ b/libavfilter/avf_aphasemeter.c
@@ -327,6 +327,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame *clone;
s->out->pts = in->pts;
+ s->out->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base);
+
clone = av_frame_clone(s->out);
if (!clone)
return AVERROR(ENOMEM);
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 5/8] lavfi/avf_avectorscope: set frame durations
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
` (2 preceding siblings ...)
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 4/8] lavfi/avf_aphasemeter: " Anton Khirnov
@ 2022-09-28 9:21 ` Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 6/8] lavfi/avf_showcqt: " Anton Khirnov
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
The filter is supposed to produce CFR output.
---
libavfilter/avf_avectorscope.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index fe381a631d..2ed85f56e5 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -275,6 +275,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
memset(s->outpicref->data[0] + i * s->outpicref->linesize[0], 0, outlink->w * 4);
}
s->outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base);
+ s->outpicref->duration = 1;
av_frame_make_writable(s->outpicref);
ff_filter_execute(ctx, fade, NULL, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 6/8] lavfi/avf_showcqt: set frame durations
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
` (3 preceding siblings ...)
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 5/8] lavfi/avf_avectorscope: " Anton Khirnov
@ 2022-09-28 9:21 ` Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 7/8] lavfi/avf_showfreqs: " Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 8/8] lavfi/avf_showspatial: add framerate option Anton Khirnov
6 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
The filter is supposed to produce CFR output.
---
libavfilter/avf_showcqt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
index 33c482bd42..c019dc2564 100644
--- a/libavfilter/avf_showcqt.c
+++ b/libavfilter/avf_showcqt.c
@@ -1187,6 +1187,7 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout)
UPDATE_TIME(s->sono_time);
}
out->pts = s->next_pts;
+ out->duration = PTS_STEP;
s->next_pts += PTS_STEP;
}
s->sono_count = (s->sono_count + 1) % s->count;
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 7/8] lavfi/avf_showfreqs: set frame durations
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
` (4 preceding siblings ...)
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 6/8] lavfi/avf_showcqt: " Anton Khirnov
@ 2022-09-28 9:21 ` Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 8/8] lavfi/avf_showspatial: add framerate option Anton Khirnov
6 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
The filter is supposed to produce CFR output.
---
libavfilter/avf_showfreqs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index 86a67c7328..cc7d6204b4 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -469,6 +469,7 @@ static int plot_freqs(AVFilterLink *inlink, int64_t pts)
av_free(colors);
out->pts = s->pts;
+ out->duration = 1;
out->sample_aspect_ratio = (AVRational){1,1};
return ff_filter_frame(outlink, out);
}
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 8/8] lavfi/avf_showspatial: add framerate option
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
` (5 preceding siblings ...)
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 7/8] lavfi/avf_showfreqs: " Anton Khirnov
@ 2022-09-28 9:21 ` Anton Khirnov
6 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2022-09-28 9:21 UTC (permalink / raw)
To: ffmpeg-devel
Apparently this option was intended (the context contains a
currently-unused frame_rate field), but was never added. This results in
the output timebase being unset after config_output(), so the input
audio timebase ends up being used for video output, which is clearly
wrong.
Add an option for setting output video framerate. Also set output frame
durations.
---
doc/filters.texi | 3 +++
libavfilter/avf_showspatial.c | 4 ++++
libavfilter/version.h | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/doc/filters.texi b/doc/filters.texi
index d0f718678c..7e516a43ba 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -29337,6 +29337,9 @@ Default value is @code{hann}.
Set ratio of overlap window. Default value is @code{0.5}.
When value is @code{1} overlap is set to recommended size for specific
window function currently used.
+
+@item rate, r
+Set output framerate.
@end table
@anchor{showspectrum}
diff --git a/libavfilter/avf_showspatial.c b/libavfilter/avf_showspatial.c
index 7807628540..3db4db9af0 100644
--- a/libavfilter/avf_showspatial.c
+++ b/libavfilter/avf_showspatial.c
@@ -62,6 +62,8 @@ static const AVOption showspatial_options[] = {
{ "win_size", "set window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64 = 4096}, 1024, 65536, FLAGS },
WIN_FUNC_OPTION("win_func", OFFSET(win_func), FLAGS, WFUNC_HANNING),
{ "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, FLAGS },
+ { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
+ { "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
{ NULL }
};
@@ -187,6 +189,7 @@ static int config_output(AVFilterLink *outlink)
}
}
+ outlink->frame_rate = s->frame_rate;
outlink->time_base = av_inv_q(outlink->frame_rate);
av_audio_fifo_free(s->fifo);
@@ -253,6 +256,7 @@ static int draw_spatial(AVFilterLink *inlink, AVFrame *insamples)
}
outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base);
+ outpicref->duration = 1;
return ff_filter_frame(outlink, outpicref);
}
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 5aac9c513a..4ccbf5641c 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -32,7 +32,7 @@
#include "version_major.h"
#define LIBAVFILTER_VERSION_MINOR 49
-#define LIBAVFILTER_VERSION_MICRO 100
+#define LIBAVFILTER_VERSION_MICRO 101
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
--
2.35.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-09-28 9:22 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 9:21 [FFmpeg-devel] [PATCH 1/8] lavfi/vf_fps: set frame duration Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 2/8] lavfi/setpts: unset frame durations Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 3/8] lavfi/avf_ahistogram: set " Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 4/8] lavfi/avf_aphasemeter: " Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 5/8] lavfi/avf_avectorscope: " Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 6/8] lavfi/avf_showcqt: " Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 7/8] lavfi/avf_showfreqs: " Anton Khirnov
2022-09-28 9:21 ` [FFmpeg-devel] [PATCH 8/8] lavfi/avf_showspatial: add framerate option Anton Khirnov
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