Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
94c0b273
Commit
94c0b273
authored
Nov 21, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_chromakey: add support for commands
parent
ae6c4168
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
filters.texi
doc/filters.texi
+14
-0
vf_chromakey.c
libavfilter/vf_chromakey.c
+15
-1
No files found.
doc/filters.texi
View file @
94c0b273
...
...
@@ -6863,6 +6863,13 @@ Literal colors like "green" or "red" don't make sense with this enabled anymore.
This can be used to pass exact YUV values as hexadecimal numbers.
@end table
@subsection Commands
This filter supports same @ref{commands} as options.
The command accepts the same syntax of the corresponding option.
If the specified expression is not valid, it is kept at its current
value.
@section chromakey
YUV colorspace color/chroma keying.
...
...
@@ -6892,6 +6899,13 @@ Literal colors like "green" or "red" don't make sense with this enabled anymore.
This
can
be
used
to
pass
exact
YUV
values
as
hexadecimal
numbers
.
@
end
table
@
subsection
Commands
This
filter
supports
same
@
ref
{
commands
}
as
options
.
The
command
accepts
the
same
syntax
of
the
corresponding
option
.
If
the
specified
expression
is
not
valid
,
it
is
kept
at
its
current
value
.
@
subsection
Examples
@
itemize
...
...
libavfilter/vf_chromakey.c
View file @
94c0b273
...
...
@@ -353,6 +353,18 @@ static av_cold int config_input(AVFilterLink *inlink)
return
0
;
}
static
int
process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
int
ret
;
ret
=
ff_filter_process_command
(
ctx
,
cmd
,
args
,
res
,
res_len
,
flags
);
if
(
ret
<
0
)
return
ret
;
return
config_output
(
ctx
->
outputs
[
0
]);
}
static
const
AVFilterPad
chromakey_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -374,7 +386,7 @@ static const AVFilterPad chromakey_outputs[] = {
};
#define OFFSET(x) offsetof(ChromakeyContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
|AV_OPT_FLAG_RUNTIME_PARAM
static
const
AVOption
chromakey_options
[]
=
{
{
"color"
,
"set the chromakey key color"
,
OFFSET
(
chromakey_rgba
),
AV_OPT_TYPE_COLOR
,
{
.
str
=
"black"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
...
...
@@ -395,6 +407,7 @@ AVFilter ff_vf_chromakey = {
.
inputs
=
chromakey_inputs
,
.
outputs
=
chromakey_outputs
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
|
AVFILTER_FLAG_SLICE_THREADS
,
.
process_command
=
process_command
,
};
static
const
AVOption
chromahold_options
[]
=
{
...
...
@@ -436,4 +449,5 @@ AVFilter ff_vf_chromahold = {
.
inputs
=
chromahold_inputs
,
.
outputs
=
chromahold_outputs
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
|
AVFILTER_FLAG_SLICE_THREADS
,
.
process_command
=
process_command
,
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment