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
b63f7b3a
Commit
b63f7b3a
authored
Apr 19, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/afade: use AV_OPT_TYPE_DURATION
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
7e57adb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
filters.texi
doc/filters.texi
+16
-5
af_afade.c
libavfilter/af_afade.c
+8
-8
No files found.
doc/filters.texi
View file @
b63f7b3a
...
...
@@ -612,15 +612,26 @@ volume as the input audio, at the end of the fade-out transition
the output audio will be silence. Default is 44100.
@item start_time, st
Specify time in seconds for starting to apply the fade
effect. Default is 0.
Specify time for starting to apply the fade effect. Default is 0.
The accepted syntax is:
@example
[-]HH[:MM[:SS[.m...]]]
[-]S+[.m...]
@end example
See also the function @code{av_parse_time()}.
If set this option is used instead of @var{start_sample} one.
@item duration, d
Specify the number of seconds for which the fade effect has to last. At
the end of the fade-in effect the output audio will have the same
Specify the duration for which the fade effect has to last. Default is 0.
The accepted syntax is:
@example
[-]HH[:MM[:SS[.m...]]]
[-]S+[.m...]
@end example
See also the function @code{av_parse_time()}.
At the end of the fade-in effect the output audio will have the same
volume as the input audio, at the end of the fade-out transition
the output audio will be silence.
Default is 0.
the output audio will be silence.
If set this option is used instead of @var{nb_samples} one.
@item curve
...
...
libavfilter/af_afade.c
View file @
b63f7b3a
...
...
@@ -34,8 +34,8 @@ typedef struct {
int
curve
;
int
nb_samples
;
int64_t
start_sample
;
double
duration
;
double
start_time
;
int64_t
duration
;
int64_t
start_time
;
void
(
*
fade_samples
)(
uint8_t
**
dst
,
uint8_t
*
const
*
src
,
int
nb_samples
,
int
channels
,
int
direction
,
...
...
@@ -56,10 +56,10 @@ static const AVOption afade_options[] = {
{
"ss"
,
"set expression of sample to start fading"
,
OFFSET
(
start_sample
),
AV_OPT_TYPE_INT64
,
{.
i64
=
0
},
0
,
INT64_MAX
,
FLAGS
},
{
"nb_samples"
,
"set expression for fade duration in samples"
,
OFFSET
(
nb_samples
),
AV_OPT_TYPE_INT
,
{.
i64
=
44100
},
1
,
INT32_MAX
,
FLAGS
},
{
"ns"
,
"set expression for fade duration in samples"
,
OFFSET
(
nb_samples
),
AV_OPT_TYPE_INT
,
{.
i64
=
44100
},
1
,
INT32_MAX
,
FLAGS
},
{
"start_time"
,
"set expression of
second to start fading"
,
OFFSET
(
start_time
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
0
.
},
0
,
7
*
24
*
60
*
60
,
FLAGS
},
{
"st"
,
"set expression of
second to start fading"
,
OFFSET
(
start_time
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
0
.
},
0
,
7
*
24
*
60
*
60
,
FLAGS
},
{
"duration"
,
"set expression for fade duration
in seconds"
,
OFFSET
(
duration
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
0
.
},
0
,
24
*
60
*
60
,
FLAGS
},
{
"d"
,
"set expression for fade duration
in seconds"
,
OFFSET
(
duration
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
0
.
},
0
,
24
*
60
*
60
,
FLAGS
},
{
"start_time"
,
"set expression of
time to start fading"
,
OFFSET
(
start_time
),
AV_OPT_TYPE_DURATION
,
{.
i64
=
0
.
},
0
,
INT32_MAX
,
FLAGS
},
{
"st"
,
"set expression of
time to start fading"
,
OFFSET
(
start_time
),
AV_OPT_TYPE_DURATION
,
{.
i64
=
0
.
},
0
,
INT32_MAX
,
FLAGS
},
{
"duration"
,
"set expression for fade duration
"
,
OFFSET
(
duration
),
AV_OPT_TYPE_DURATION
,
{.
i64
=
0
.
},
0
,
INT32_MAX
,
FLAGS
},
{
"d"
,
"set expression for fade duration
"
,
OFFSET
(
duration
),
AV_OPT_TYPE_DURATION
,
{.
i64
=
0
.
},
0
,
INT32_MAX
,
FLAGS
},
{
"curve"
,
"set expression for fade curve"
,
OFFSET
(
curve
),
AV_OPT_TYPE_INT
,
{.
i64
=
TRI
},
TRI
,
CBR
,
FLAGS
,
"curve"
},
{
"c"
,
"set expression for fade curve"
,
OFFSET
(
curve
),
AV_OPT_TYPE_INT
,
{.
i64
=
TRI
},
TRI
,
CBR
,
FLAGS
,
"curve"
},
{
"tri"
,
"linear slope"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TRI
},
0
,
0
,
FLAGS
,
"curve"
},
...
...
@@ -218,9 +218,9 @@ static int config_output(AVFilterLink *outlink)
}
if
(
afade
->
duration
)
afade
->
nb_samples
=
afade
->
duration
*
inlink
->
sample_rate
;
afade
->
nb_samples
=
afade
->
duration
*
inlink
->
sample_rate
/
AV_TIME_BASE
;
if
(
afade
->
start_time
)
afade
->
start_sample
=
afade
->
start_time
*
inlink
->
sample_rate
;
afade
->
start_sample
=
afade
->
start_time
*
inlink
->
sample_rate
/
AV_TIME_BASE
;
return
0
;
}
...
...
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