Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
9e406326
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,发现更多精彩内容 >>
提交
9e406326
编写于
12月 20, 2017
作者:
P
Paul B Mahol
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avfilter: add vfrdet filter
Signed-off-by:
N
Paul B Mahol
<
onemda@gmail.com
>
上级
8d381b57
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
126 addition
and
1 deletion
+126
-1
Changelog
Changelog
+1
-0
doc/filters.texi
doc/filters.texi
+11
-0
libavfilter/Makefile
libavfilter/Makefile
+1
-0
libavfilter/allfilters.c
libavfilter/allfilters.c
+1
-0
libavfilter/version.h
libavfilter/version.h
+1
-1
libavfilter/vf_vfrdet.c
libavfilter/vf_vfrdet.c
+111
-0
未找到文件。
Changelog
浏览文件 @
9e406326
...
...
@@ -53,6 +53,7 @@ version <next>:
- bitstream filter for extracting E-AC-3 core
- Haivision SRT protocol via libsrt
- segafilm muxer
- vfrdet filter
version 3.4:
...
...
doc/filters.texi
浏览文件 @
9e406326
...
...
@@ -16248,6 +16248,17 @@ For example, to vertically flip a video with @command{ffmpeg}:
ffmpeg -i in.avi -vf "vflip" out.avi
@end example
@section vfrdet
Detect variable frame rate video.
This filter tries to detect if the input is variable or constant frame rate.
At end it will output number of frames detected as having variable delta pts,
and ones with constant delta pts.
If there was frames with variable delta, than it will also show min and max delta
encountered.
@anchor{vignette}
@section vignette
...
...
libavfilter/Makefile
浏览文件 @
9e406326
...
...
@@ -353,6 +353,7 @@ OBJS-$(CONFIG_USPP_FILTER) += vf_uspp.o
OBJS-$(CONFIG_VAGUEDENOISER_FILTER)
+=
vf_vaguedenoiser.o
OBJS-$(CONFIG_VECTORSCOPE_FILTER)
+=
vf_vectorscope.o
OBJS-$(CONFIG_VFLIP_FILTER)
+=
vf_vflip.o
OBJS-$(CONFIG_VFRDET_FILTER)
+=
vf_vfrdet.o
OBJS-$(CONFIG_VIDSTABDETECT_FILTER)
+=
vidstabutils.o vf_vidstabdetect.o
OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER)
+=
vidstabutils.o vf_vidstabtransform.o
OBJS-$(CONFIG_VIGNETTE_FILTER)
+=
vf_vignette.o
...
...
libavfilter/allfilters.c
浏览文件 @
9e406326
...
...
@@ -343,6 +343,7 @@ extern AVFilter ff_vf_uspp;
extern
AVFilter
ff_vf_vaguedenoiser
;
extern
AVFilter
ff_vf_vectorscope
;
extern
AVFilter
ff_vf_vflip
;
extern
AVFilter
ff_vf_vfrdet
;
extern
AVFilter
ff_vf_vidstabdetect
;
extern
AVFilter
ff_vf_vidstabtransform
;
extern
AVFilter
ff_vf_vignette
;
...
...
libavfilter/version.h
浏览文件 @
9e406326
...
...
@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 7
#define LIBAVFILTER_VERSION_MINOR 1
4
#define LIBAVFILTER_VERSION_MINOR 1
5
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...
...
libavfilter/vf_vfrdet.c
0 → 100644
浏览文件 @
9e406326
/*
* Copyright (C) 2017 Paul B Mahol
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "internal.h"
typedef
struct
VFRDETContext
{
const
AVClass
*
class
;
int64_t
prev_pts
;
int64_t
delta
;
int64_t
min_delta
;
int64_t
max_delta
;
uint64_t
vfr
;
uint64_t
cfr
;
}
VFRDETContext
;
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
in
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
VFRDETContext
*
s
=
ctx
->
priv
;
if
(
s
->
prev_pts
!=
AV_NOPTS_VALUE
)
{
int64_t
delta
=
in
->
pts
-
s
->
prev_pts
;
if
(
s
->
delta
==
AV_NOPTS_VALUE
)
{
s
->
delta
=
delta
;
}
if
(
s
->
delta
!=
delta
)
{
s
->
vfr
++
;
s
->
delta
=
delta
;
s
->
min_delta
=
FFMIN
(
delta
,
s
->
min_delta
);
s
->
max_delta
=
FFMAX
(
delta
,
s
->
max_delta
);
}
else
{
s
->
cfr
++
;
}
}
s
->
prev_pts
=
in
->
pts
;
return
ff_filter_frame
(
ctx
->
outputs
[
0
],
in
);
}
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
VFRDETContext
*
s
=
ctx
->
priv
;
s
->
prev_pts
=
AV_NOPTS_VALUE
;
s
->
delta
=
AV_NOPTS_VALUE
;
s
->
min_delta
=
INT64_MAX
;
s
->
max_delta
=
INT64_MIN
;
return
0
;
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
VFRDETContext
*
s
=
ctx
->
priv
;
av_log
(
ctx
,
AV_LOG_INFO
,
"VFR:%f (%"
PRIu64
"/%"
PRIu64
")"
,
s
->
vfr
/
(
float
)(
s
->
vfr
+
s
->
cfr
),
s
->
vfr
,
s
->
cfr
);
if
(
s
->
vfr
)
av_log
(
ctx
,
AV_LOG_INFO
,
" min: %"
PRId64
" max: %"
PRId64
")"
,
s
->
min_delta
,
s
->
max_delta
);
av_log
(
ctx
,
AV_LOG_INFO
,
"
\n
"
);
}
static
const
AVFilterPad
vfrdet_inputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
filter_frame
=
filter_frame
,
},
{
NULL
}
};
static
const
AVFilterPad
vfrdet_outputs
[]
=
{
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
},
{
NULL
}
};
AVFilter
ff_vf_vfrdet
=
{
.
name
=
"vfrdet"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Variable frame rate detect filter."
),
.
priv_size
=
sizeof
(
VFRDETContext
),
.
init
=
init
,
.
uninit
=
uninit
,
.
inputs
=
vfrdet_inputs
,
.
outputs
=
vfrdet_outputs
,
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录