Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
95f1f56a
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,发现更多精彩内容 >>
提交
95f1f56a
编写于
2月 25, 2013
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vf_select: switch to an AVOptions-based system.
上级
40c885c5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
34 addition
and
8 deletion
+34
-8
doc/filters.texi
doc/filters.texi
+13
-6
libavfilter/vf_select.c
libavfilter/vf_select.c
+21
-2
未找到文件。
doc/filters.texi
浏览文件 @
95f1f56a
...
...
@@ -1742,9 +1742,16 @@ scale=w='min(500\, iw*3/2):h=-1'
@section select
Select frames to pass in output.
It accepts in input an expression, which is evaluated for each input
frame. If the expression is evaluated to a non-zero value, the frame
is selected and passed to the output, otherwise it is discarded.
This filter accepts the following options:
@table @option
@item expr
An expression, which is evaluated for each input frame. If the expression is
evaluated to a non-zero value, the frame is selected and passed to the output,
otherwise it is discarded.
@end table
The expression can contain the following constants:
...
...
@@ -1831,13 +1838,13 @@ Some examples follow:
select
# the above is the same as:
select=1
select=
expr=
1
# skip all frames:
select=0
select=
expr=
0
# select only I-frames
select='eq(pict_type\,I)'
select='e
xpr=e
q(pict_type\,I)'
# select one frame every 100
select='not(mod(n\,100))'
...
...
libavfilter/vf_select.c
浏览文件 @
95f1f56a
...
...
@@ -27,6 +27,7 @@
#include "libavutil/fifo.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"
...
...
@@ -115,6 +116,8 @@ enum var_name {
#define FIFO_SIZE 8
typedef
struct
{
const
AVClass
*
class
;
char
*
expr_str
;
AVExpr
*
expr
;
double
var_values
[
VAR_VARS_NB
];
double
select
;
...
...
@@ -127,9 +130,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
SelectContext
*
select
=
ctx
->
priv
;
int
ret
;
if
((
ret
=
av_expr_parse
(
&
select
->
expr
,
args
?
args
:
"1"
,
if
((
ret
=
av_expr_parse
(
&
select
->
expr
,
select
->
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
"
,
select
->
expr_str
);
return
ret
;
}
...
...
@@ -309,6 +313,20 @@ static av_cold void uninit(AVFilterContext *ctx)
select
->
pending_frames
=
NULL
;
}
#define OFFSET(x) offsetof(SelectContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"expr"
,
"An expression to use for selecting frames"
,
OFFSET
(
expr_str
),
AV_OPT_TYPE_STRING
,
{
.
str
=
"1"
},
.
flags
=
FLAGS
},
{
NULL
},
};
static
const
AVClass
select_class
=
{
.
class_name
=
"select"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVFilterPad
avfilter_vf_select_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -337,6 +355,7 @@ AVFilter avfilter_vf_select = {
.
uninit
=
uninit
,
.
priv_size
=
sizeof
(
SelectContext
),
.
priv_class
=
&
select_class
,
.
inputs
=
avfilter_vf_select_inputs
,
.
outputs
=
avfilter_vf_select_outputs
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录