Skip to content

Commit 52cd7a6

Browse files
committed
avfilter/vf_colorkey: add support for commands
1 parent e8cbdb9 commit 52cd7a6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

doc/filters.texi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7378,6 +7378,13 @@ ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.
73787378
@end example
73797379
@end itemize
73807380

7381+
@subsection Commands
7382+
This filter supports same @ref{commands} as options.
7383+
The command accepts the same syntax of the corresponding option.
7384+
7385+
If the specified expression is not valid, it is kept at its current
7386+
value.
7387+
73817388
@section colorhold
73827389
Remove all color information for all RGB colors except for certain one.
73837390

@@ -7396,6 +7403,13 @@ Blend percentage. 0.0 makes pixels fully gray.
73967403
Higher values result in more preserved color.
73977404
@end table
73987405

7406+
@subsection Commands
7407+
This filter supports same @ref{commands} as options.
7408+
The command accepts the same syntax of the corresponding option.
7409+
7410+
If the specified expression is not valid, it is kept at its current
7411+
value.
7412+
73997413
@section colorlevels
74007414

74017415
Adjust video input frames using levels.

libavfilter/vf_colorkey.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static const AVFilterPad colorkey_outputs[] = {
199199
};
200200

201201
#define OFFSET(x) offsetof(ColorkeyContext, x)
202-
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
202+
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
203203

204204
#if CONFIG_COLORKEY_FILTER
205205

@@ -222,6 +222,7 @@ AVFilter ff_vf_colorkey = {
222222
.inputs = colorkey_inputs,
223223
.outputs = colorkey_outputs,
224224
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
225+
.process_command = ff_filter_process_command,
225226
};
226227

227228
#endif /* CONFIG_COLORKEY_FILTER */
@@ -246,6 +247,7 @@ AVFilter ff_vf_colorhold = {
246247
.inputs = colorkey_inputs,
247248
.outputs = colorkey_outputs,
248249
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
250+
.process_command = ff_filter_process_command,
249251
};
250252

251253
#endif /* CONFIG_COLORHOLD_FILTER */

0 commit comments

Comments
 (0)