[FFmpeg-cvslog] avfilter/vf_waveform: add input option
Paul B Mahol
git at videolan.org
Sun May 14 01:22:56 EEST 2023
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun May 14 00:10:57 2023 +0200| [28a73506df9c6bcfc6f1ba5b750709f15e4c5ea0] | committer: Paul B Mahol
avfilter/vf_waveform: add input option
For finer control of selected formats for filtering.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=28a73506df9c6bcfc6f1ba5b750709f15e4c5ea0
---
doc/filters.texi | 6 ++++++
libavfilter/vf_waveform.c | 6 +++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/doc/filters.texi b/doc/filters.texi
index 7e0c87d0fa..c3cf8b470b 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -24950,6 +24950,12 @@ Set sample aspect ration to 1/1.
Set sample aspect ratio to match input size of video
@end table
Default is @samp{none}.
+
+ at item input
+Set input formats for filter to pick from.
+Can be @samp{all}, for selecting from all available formats,
+or @samp{first}, for selecting first available format.
+Default is @samp{first}.
@end table
@section weave, doubleweave
diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index 8872c43aeb..a6a8ec78e7 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -120,6 +120,7 @@ typedef struct WaveformContext {
float ftint[2];
int tint[2];
int fitmode;
+ int input;
int (*waveform_slice)(AVFilterContext *ctx, void *arg,
int jobnr, int nb_jobs);
@@ -196,6 +197,9 @@ static const AVOption waveform_options[] = {
{ "fm", "set fit mode", OFFSET(fitmode), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_FITMODES-1, FLAGS, "fitmode" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FM_NONE}, 0, 0, FLAGS, "fitmode" },
{ "size", NULL, 0, AV_OPT_TYPE_CONST, {.i64=FM_SIZE}, 0, 0, FLAGS, "fitmode" },
+ { "input", "set input formats selection", OFFSET(input), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "input" },
+ { "all", "try to select from all available formats", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "input" },
+ { "first", "pick first available format", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "input" },
{ NULL }
};
@@ -356,7 +360,7 @@ static int query_formats(AVFilterContext *ctx)
depth2 = desc2->comp[0].depth;
if (ncomp != ncomp2 || depth != depth2)
return AVERROR(EAGAIN);
- for (i = 1; i < avff->nb_formats; i++) {
+ for (i = 1; i < avff->nb_formats && !s->input; i++) {
desc = av_pix_fmt_desc_get(avff->formats[i]);
if (rgb != (desc->flags & AV_PIX_FMT_FLAG_RGB) ||
depth != desc->comp[0].depth)
More information about the ffmpeg-cvslog
mailing list