Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
33b97faa
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,发现更多精彩内容 >>
提交
33b97faa
编写于
2月 25, 2013
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vf_setpts: switch to an AVOptions-based system.
上级
95f1f56a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
6 deletion
+33
-6
doc/filters.texi
doc/filters.texi
+13
-4
libavfilter/vf_setpts.c
libavfilter/vf_setpts.c
+20
-2
未找到文件。
doc/filters.texi
浏览文件 @
33b97faa
...
...
@@ -1895,8 +1895,17 @@ See also the @ref{setsar} filter documentation.
Change the PTS (presentation timestamp) of the input video frames.
Accept in input an expression evaluated through the eval API, which
can contain the following constants:
This filter accepts the following options:
@table @option
@item expr
The expression which is evaluated for each frame to construct its timestamp.
@end table
The expression is evaluated through the eval API and can contain the following
constants:
@table @option
@item PTS
...
...
@@ -1938,10 +1947,10 @@ Some examples follow:
@example
# start counting PTS from zero
setpts=PTS-STARTPTS
setpts=
expr=
PTS-STARTPTS
# fast motion
setpts=0.5*PTS
setpts=
expr=
0.5*PTS
# slow motion
setpts=2.0*PTS
...
...
libavfilter/vf_setpts.c
浏览文件 @
33b97faa
...
...
@@ -29,6 +29,7 @@
#include "libavutil/eval.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "avfilter.h"
#include "internal.h"
...
...
@@ -67,6 +68,8 @@ enum var_name {
};
typedef
struct
{
const
AVClass
*
class
;
char
*
expr_str
;
AVExpr
*
expr
;
double
var_values
[
VAR_VARS_NB
];
}
SetPTSContext
;
...
...
@@ -76,9 +79,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
SetPTSContext
*
setpts
=
ctx
->
priv
;
int
ret
;
if
((
ret
=
av_expr_parse
(
&
setpts
->
expr
,
args
?
args
:
"PTS"
,
if
((
ret
=
av_expr_parse
(
&
setpts
->
expr
,
setpts
->
expr_str
,
var_names
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
ctx
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error while parsing expression '%s'
\n
"
,
args
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error while parsing expression '%s'
\n
"
,
setpts
->
expr_str
);
return
ret
;
}
...
...
@@ -145,6 +148,20 @@ static av_cold void uninit(AVFilterContext *ctx)
setpts
->
expr
=
NULL
;
}
#define OFFSET(x) offsetof(SetPTSContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"expr"
,
"Expression determining the frame timestamp"
,
OFFSET
(
expr_str
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"PTS"
},
.
flags
=
FLAGS
},
{
NULL
},
};
static
const
AVClass
setpts_class
=
{
.
class_name
=
"setpts"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVFilterPad
avfilter_vf_setpts_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -171,6 +188,7 @@ AVFilter avfilter_vf_setpts = {
.
uninit
=
uninit
,
.
priv_size
=
sizeof
(
SetPTSContext
),
.
priv_class
=
&
setpts_class
,
.
inputs
=
avfilter_vf_setpts_inputs
,
.
outputs
=
avfilter_vf_setpts_outputs
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录