Skip to content

Commit a8bc79c

Browse files
committed
fftools/ffmpeg: deprecate -filter_script
It is equivalent to -/filter.
1 parent c316c4c commit a8bc79c

File tree

7 files changed

+39
-20
lines changed

7 files changed

+39
-20
lines changed

doc/ffmpeg.texi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -977,12 +977,6 @@ syntax.
977977
See the @ref{filter_complex_option,,-filter_complex option} if you
978978
want to create filtergraphs with multiple inputs and/or outputs.
979979

980-
@anchor{filter_script option}
981-
@item -filter_script[:@var{stream_specifier}] @var{filename} (@emph{output,per-stream})
982-
This option is similar to @option{-filter}, the only difference is that its
983-
argument is the name of the file from which a filtergraph description is to be
984-
read.
985-
986980
@item -reinit_filter[:@var{stream_specifier}] @var{integer} (@emph{input,per-stream})
987981
This boolean option determines if the filtergraph(s) to which this stream is fed gets
988982
reinitialized when input frame parameters change mid-stream. This option is enabled by

doc/filters.texi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,6 @@ For example, in case of the @ref{drawtext,,drawtext filter}, you might prefer to
307307
use the @option{textfile} option in place of @option{text} to specify the text
308308
to render.
309309

310-
When using the @command{ffmpeg} tool, you might consider to use the
311-
@ref{filter_script option,,-filter_script option,ffmpeg}.
312-
313310
@chapter Timeline editing
314311

315312
Some filters support a generic @option{enable} option. For the filters

fftools/ffmpeg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ typedef struct OptionsContext {
221221
SpecifierOptList copy_initial_nonkeyframes;
222222
SpecifierOptList copy_prior_start;
223223
SpecifierOptList filters;
224+
#if FFMPEG_OPT_FILTER_SCRIPT
224225
SpecifierOptList filter_scripts;
226+
#endif
225227
SpecifierOptList reinit_filters;
226228
SpecifierOptList fix_sub_duration;
227229
SpecifierOptList fix_sub_duration_heartbeat;

fftools/ffmpeg_mux_init.c

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,44 +415,68 @@ static MuxStream *mux_stream_alloc(Muxer *mux, enum AVMediaType type)
415415
static int ost_get_filters(const OptionsContext *o, AVFormatContext *oc,
416416
OutputStream *ost, char **dst)
417417
{
418-
const char *filters = NULL, *filters_script = NULL;
418+
const char *filters = NULL;
419+
#if FFMPEG_OPT_FILTER_SCRIPT
420+
const char *filters_script = NULL;
419421

420422
MATCH_PER_STREAM_OPT(filter_scripts, str, filters_script, oc, ost->st);
423+
#endif
421424
MATCH_PER_STREAM_OPT(filters, str, filters, oc, ost->st);
422425

423426
if (!ost->enc) {
424-
if (filters_script || filters) {
427+
if (
428+
#if FFMPEG_OPT_FILTER_SCRIPT
429+
filters_script ||
430+
#endif
431+
filters) {
425432
av_log(ost, AV_LOG_ERROR,
426433
"%s '%s' was specified, but codec copy was selected. "
427434
"Filtering and streamcopy cannot be used together.\n",
435+
#if FFMPEG_OPT_FILTER_SCRIPT
428436
filters ? "Filtergraph" : "Filtergraph script",
429-
filters ? filters : filters_script);
437+
filters ? filters : filters_script
438+
#else
439+
"Filtergraph", filters
440+
#endif
441+
);
430442
return AVERROR(ENOSYS);
431443
}
432444
return 0;
433445
}
434446

435447
if (!ost->ist) {
436-
if (filters_script || filters) {
448+
if (
449+
#if FFMPEG_OPT_FILTER_SCRIPT
450+
filters_script ||
451+
#endif
452+
filters) {
437453
av_log(ost, AV_LOG_ERROR,
438454
"%s '%s' was specified for a stream fed from a complex "
439455
"filtergraph. Simple and complex filtering cannot be used "
440456
"together for the same stream.\n",
457+
#if FFMPEG_OPT_FILTER_SCRIPT
441458
filters ? "Filtergraph" : "Filtergraph script",
442-
filters ? filters : filters_script);
459+
filters ? filters : filters_script
460+
#else
461+
"Filtergraph", filters
462+
#endif
463+
);
443464
return AVERROR(EINVAL);
444465
}
445466
return 0;
446467
}
447468

469+
#if FFMPEG_OPT_FILTER_SCRIPT
448470
if (filters_script && filters) {
449471
av_log(ost, AV_LOG_ERROR, "Both -filter and -filter_script set\n");
450472
return AVERROR(EINVAL);
451473
}
452474

453475
if (filters_script)
454476
*dst = file_read(filters_script);
455-
else if (filters)
477+
else
478+
#endif
479+
if (filters)
456480
*dst = av_strdup(filters);
457481
else
458482
*dst = av_strdup(ost->type == AVMEDIA_TYPE_VIDEO ? "null" : "anull");

fftools/ffmpeg_opt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,9 +1625,11 @@ const OptionDef options[] = {
16251625
{ "filter_threads", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT,
16261626
{ .func_arg = opt_filter_threads },
16271627
"number of non-complex filter threads" },
1628+
#if FFMPEG_OPT_FILTER_SCRIPT
16281629
{ "filter_script", OPT_TYPE_STRING, OPT_SPEC | OPT_EXPERT | OPT_OUTPUT,
16291630
{ .off = OFFSET(filter_scripts) },
1630-
"read stream filtergraph description from a file", "filename" },
1631+
"deprecated, use -/filter", "filename" },
1632+
#endif
16311633
{ "reinit_filter", OPT_TYPE_INT, OPT_SPEC | OPT_INPUT | OPT_EXPERT,
16321634
{ .off = OFFSET(reinit_filters) },
16331635
"reinit filtergraph on input parameter changes", "" },

tests/fate/filter-audio.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ FATE_AFILTER-$(call FILTERDEMDECENCMUX, FIREQUALIZER ATRIM VOLUME, WAV, PCM_S16L
128128
fate-filter-firequalizer: tests/data/asynth-44100-2.wav
129129
fate-filter-firequalizer: tests/data/filtergraphs/firequalizer
130130
fate-filter-firequalizer: REF = tests/data/asynth-44100-2.wav
131-
fate-filter-firequalizer: CMD = ffmpeg -auto_conversion_filters -i $(TARGET_PATH)/tests/data/asynth-44100-2.wav -filter_script $(TARGET_PATH)/tests/data/filtergraphs/firequalizer -f wav -c:a pcm_s16le -
131+
fate-filter-firequalizer: CMD = ffmpeg -auto_conversion_filters -i $(TARGET_PATH)/tests/data/asynth-44100-2.wav -/filter $(TARGET_PATH)/tests/data/filtergraphs/firequalizer -f wav -c:a pcm_s16le -
132132
fate-filter-firequalizer: CMP = oneoff
133133
fate-filter-firequalizer: CMP_UNIT = s16
134134
fate-filter-firequalizer: SIZE_TOLERANCE = 1058400 - 1097208

tests/fate/filter-video.mak

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ fate-filter-weave: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf weave=bottom
269269

270270
FATE_FILTER_VSYNTH_PGMYUV-$(CONFIG_SELECT_FILTER) += fate-filter-select-alternate
271271
fate-filter-select-alternate: tests/data/filtergraphs/select-alternate
272-
fate-filter-select-alternate: CMD = framecrc -c:v pgmyuv -i $(SRC) -filter_script $(TARGET_PATH)/tests/data/filtergraphs/select-alternate
272+
fate-filter-select-alternate: CMD = framecrc -c:v pgmyuv -i $(SRC) -/filter $(TARGET_PATH)/tests/data/filtergraphs/select-alternate
273273

274274
FATE_FILTER_VSYNTH_PGMYUV-$(call ALLYES, SETPTS_FILTER SETTB_FILTER) += fate-filter-setpts
275275
fate-filter-setpts: tests/data/filtergraphs/setpts
276-
fate-filter-setpts: CMD = framecrc -c:v pgmyuv -i $(SRC) -filter_script $(TARGET_PATH)/tests/data/filtergraphs/setpts
276+
fate-filter-setpts: CMD = framecrc -c:v pgmyuv -i $(SRC) -/filter $(TARGET_PATH)/tests/data/filtergraphs/setpts
277277

278278
FATE_SHUFFLEFRAMES += fate-filter-shuffleframes
279279
fate-filter-shuffleframes: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf shuffleframes="2|1|0"
@@ -362,7 +362,7 @@ fate-filter-curves: CMD = framecrc -i $(TARGET_SAMPLES)/utvideo/utvideo_rgb_medi
362362

363363
FATE_FILTER_SAMPLES-$(call FILTERDEMDEC, FORMAT PERMS GRADFUN SCALE, VMD, VMDVIDEO) += fate-filter-gradfun-sample
364364
fate-filter-gradfun-sample: tests/data/filtergraphs/gradfun
365-
fate-filter-gradfun-sample: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/vmd/12.vmd -filter_script $(TARGET_PATH)/tests/data/filtergraphs/gradfun -an -frames:v 20
365+
fate-filter-gradfun-sample: CMD = framecrc -auto_conversion_filters -i $(TARGET_SAMPLES)/vmd/12.vmd -/filter $(TARGET_PATH)/tests/data/filtergraphs/gradfun -an -frames:v 20
366366

367367
FATE_FILTER-$(call FILTERFRAMECRC, TESTSRC SINE CONCAT, FILE_PROTOCOL) += fate-filter-concat fate-filter-concat-vfr
368368
fate-filter-concat: tests/data/filtergraphs/concat

0 commit comments

Comments
 (0)