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
c0f2abcc
Commit
c0f2abcc
authored
Apr 29, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_mix: make setting weights more user friendly
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
6e95d80e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
filters.texi
doc/filters.texi
+6
-2
vf_mix.c
libavfilter/vf_mix.c
+6
-1
No files found.
doc/filters.texi
View file @
c0f2abcc
...
...
@@ -11177,7 +11177,9 @@ The number of inputs. If unspecified, it defaults to 2.
@item weights
Specify weight of each input video stream as sequence.
Each weight is separated by space.
Each weight is separated by space. If number of weights
is smaller than number of @var{frames} last specified
weight will be used for all remaining unset weights.
@item scale
Specify scale, if it is set it will be multiplied with sum
...
...
@@ -15603,7 +15605,9 @@ The number of successive frames to mix. If unspecified, it defaults to 3.
@item weights
Specify weight of each input video frame.
Each weight is separated by space.
Each weight is separated by space. If number of weights is smaller than
number of @var{frames} last specified weight will be used for all remaining
unset weights.
@item scale
Specify scale, if it is set it will be multiplied with sum
...
...
libavfilter/vf_mix.c
View file @
c0f2abcc
...
...
@@ -74,7 +74,7 @@ static av_cold int init(AVFilterContext *ctx)
{
MixContext
*
s
=
ctx
->
priv
;
char
*
p
,
*
arg
,
*
saveptr
=
NULL
;
int
i
,
ret
;
int
i
,
ret
,
last
;
s
->
tmix
=
!
strcmp
(
ctx
->
filter
->
name
,
"tmix"
);
...
...
@@ -110,6 +110,11 @@ static av_cold int init(AVFilterContext *ctx)
p
=
NULL
;
sscanf
(
arg
,
"%f"
,
&
s
->
weights
[
i
]);
s
->
wfactor
+=
s
->
weights
[
i
];
last
=
i
;
}
for
(;
i
<
s
->
nb_inputs
;
i
++
)
{
s
->
weights
[
i
]
=
s
->
weights
[
last
];
s
->
wfactor
+=
s
->
weights
[
i
];
}
if
(
s
->
scale
==
0
)
{
s
->
wfactor
=
1
/
s
->
wfactor
;
...
...
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