Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
2852bd70
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2852bd70
编写于
1月 18, 2013
作者:
S
Stefano Sabatini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lavfi/fade: accept shorthand syntax
上级
44d5a28b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
21 addition
and
58 deletion
+21
-58
doc/filters.texi
doc/filters.texi
+13
-19
libavfilter/version.h
libavfilter/version.h
+1
-1
libavfilter/vf_fade.c
libavfilter/vf_fade.c
+7
-38
未找到文件。
doc/filters.texi
浏览文件 @
2852bd70
...
...
@@ -2276,33 +2276,27 @@ edgedetect=low=0.1:high=0.4
Apply fade-in/out effect to input video.
It accepts the parameters:
@var{type}:@var{start_frame}:@var{nb_frames}[:@var{options}]
@var{type} specifies if the effect type, can be either "in" for
fade-in, or "out" for a fade-out effect.
@var{start_frame} specifies the number of the start frame for starting
to apply the fade effect.
@var{nb_frames} specifies the number of frames for which the fade
effect has to last. At the end of the fade-in effect the output video
will have the same intensity as the input video, at the end of the
fade-out transition the output video will be completely black.
The filter accepts parameters as a list of @var{key}=@var{value}
pairs, separated by ":". If the key of the first options is omitted,
the arguments are interpreted according to the syntax
@var{type}:@var{start_frame}:@var{nb_frames}.
@var{options} is an optional sequence of @var{key}=@var{value} pairs,
separated by ":". The description of the accepted options follows.
A description of the accepted parameters follows.
@table @option
@item type, t
See @var{type}.
Specify if the effect type, can be either @code{in} for fade-in, or
@code{out} for a fade-out effect. Default is @code{in}.
@item start_frame, s
See @var{start_frame}.
Specify the number of the start frame for starting to apply the fade
effect. Default is 0.
@item nb_frames, n
See @var{nb_frames}.
Specify the number of frames for which the fade effect has to last. At
the end of the fade-in effect the output video will have the same
intensity as the input video, at the end of the fade-out transition
the output video will be completely black. Default is 25.
@item alpha
If set to 1, fade only alpha channel, if one exists on the input.
...
...
libavfilter/version.h
浏览文件 @
2852bd70
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 32
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_fade.c
浏览文件 @
2852bd70
...
...
@@ -78,41 +78,14 @@ AVFILTER_DEFINE_CLASS(fade);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
FadeContext
*
fade
=
ctx
->
priv
;
int
ret
=
0
;
char
*
args1
,
*
expr
,
*
bufptr
=
NULL
;
static
const
char
*
shorthand
[]
=
{
"type"
,
"start_frame"
,
"nb_frames"
,
NULL
}
;
int
ret
;
fade
->
class
=
&
fade_class
;
av_opt_set_defaults
(
fade
);
if
(
!
(
args1
=
av_strdup
(
args
)))
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
if
(
expr
=
av_strtok
(
args1
,
":"
,
&
bufptr
))
{
av_free
(
fade
->
type
);
if
(
!
(
fade
->
type
=
av_strdup
(
expr
)))
{
ret
=
AVERROR
(
ENOMEM
);
goto
end
;
}
}
if
(
expr
=
av_strtok
(
NULL
,
":"
,
&
bufptr
))
{
if
((
ret
=
av_opt_set
(
fade
,
"start_frame"
,
expr
,
0
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid value '%s' for start_frame option
\n
"
,
expr
);
goto
end
;
}
}
if
(
expr
=
av_strtok
(
NULL
,
":"
,
&
bufptr
))
{
if
((
ret
=
av_opt_set
(
fade
,
"nb_frames"
,
expr
,
0
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid value '%s' for nb_frames option
\n
"
,
expr
);
goto
end
;
}
}
if
(
bufptr
&&
(
ret
=
av_set_options_string
(
fade
,
bufptr
,
"="
,
":"
))
<
0
)
goto
end
;
if
((
ret
=
av_opt_set_from_string
(
fade
,
args
,
shorthand
,
"="
,
":"
))
<
0
)
return
ret
;
fade
->
fade_per_frame
=
(
1
<<
16
)
/
fade
->
nb_frames
;
if
(
!
strcmp
(
fade
->
type
,
"in"
))
...
...
@@ -123,25 +96,21 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
}
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Type argument must be 'in' or 'out' but '%s' was specified
\n
"
,
fade
->
type
);
ret
=
AVERROR
(
EINVAL
);
goto
end
;
return
AVERROR
(
EINVAL
);
}
fade
->
stop_frame
=
fade
->
start_frame
+
fade
->
nb_frames
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"type:%s start_frame:%d nb_frames:%d alpha:%d
\n
"
,
fade
->
type
,
fade
->
start_frame
,
fade
->
nb_frames
,
fade
->
alpha
);
end:
av_free
(
args1
);
return
ret
;
return
0
;
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
FadeContext
*
fade
=
ctx
->
priv
;
av_
freep
(
&
fade
->
typ
e
);
av_
opt_free
(
fad
e
);
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录