Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
fe447c06
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,体验更适合开发者的 AI 搜索 >>
提交
fe447c06
编写于
10月 05, 2018
作者:
P
Paul B Mahol
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avfilter/avf_showspectrum: add zoom mode to showspectrumpic
上级
3e687be4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
17 addition
and
2 deletion
+17
-2
doc/filters.texi
doc/filters.texi
+6
-0
libavfilter/avf_showspectrum.c
libavfilter/avf_showspectrum.c
+11
-2
未找到文件。
doc/filters.texi
浏览文件 @
fe447c06
...
...
@@ -20872,6 +20872,12 @@ Draw time and frequency axes and legends. Default is enabled.
@item rotation
Set color rotation, must be in [-1.0, 1.0] range.
Default value is @code{0}.
@item start
Set start frequency from which to display spectrogram. Default is @code{0}.
@item stop
Set stop frequency to which to display spectrogram. Default is @code{0}.
@end table
@subsection Examples
...
...
libavfilter/avf_showspectrum.c
浏览文件 @
fe447c06
...
...
@@ -1128,6 +1128,8 @@ static const AVOption showspectrumpic_options[] = {
{
"gain"
,
"set scale gain"
,
OFFSET
(
gain
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
128
,
FLAGS
},
{
"legend"
,
"draw legend"
,
OFFSET
(
legend
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
1
},
0
,
1
,
FLAGS
},
{
"rotation"
,
"color rotation"
,
OFFSET
(
rotation
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
},
-
1
,
1
,
FLAGS
},
{
"start"
,
"start frequency"
,
OFFSET
(
start
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT32_MAX
,
FLAGS
},
{
"stop"
,
"stop frequency"
,
OFFSET
(
stop
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT32_MAX
,
FLAGS
},
{
NULL
}
};
...
...
@@ -1240,6 +1242,11 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
drawtext
(
s
->
outpicref
,
2
,
outlink
->
h
-
10
,
"CREATED BY LIBAVFILTER"
,
0
);
drawtext
(
s
->
outpicref
,
outlink
->
w
-
2
-
strlen
(
text
)
*
10
,
outlink
->
h
-
10
,
text
,
0
);
if
(
s
->
stop
)
{
char
*
text
=
av_asprintf
(
"Zoom: %d Hz - %d Hz"
,
s
->
start
,
s
->
stop
);
drawtext
(
s
->
outpicref
,
outlink
->
w
-
2
-
strlen
(
text
)
*
10
,
3
,
text
,
0
);
av_freep
(
&
text
);
}
av_freep
(
&
text
);
...
...
@@ -1283,7 +1290,8 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
dst
[
x
]
=
200
;
}
for
(
y
=
0
;
y
<
h
;
y
+=
40
)
{
float
hertz
=
y
*
(
inlink
->
sample_rate
/
2
)
/
(
float
)(
1
<<
(
int
)
ceil
(
log2
(
h
)));
float
range
=
s
->
stop
?
s
->
stop
-
s
->
start
:
inlink
->
sample_rate
/
2
;
float
hertz
=
s
->
start
+
y
*
range
/
(
float
)(
1
<<
(
int
)
ceil
(
log2
(
h
)));
char
*
units
;
if
(
hertz
==
0
)
...
...
@@ -1348,7 +1356,8 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
dst
[
x
]
=
200
;
}
for
(
x
=
0
;
x
<
w
-
79
;
x
+=
80
)
{
float
hertz
=
x
*
(
inlink
->
sample_rate
/
2
)
/
(
float
)(
1
<<
(
int
)
ceil
(
log2
(
w
)));
float
range
=
s
->
stop
?
s
->
stop
-
s
->
start
:
inlink
->
sample_rate
/
2
;
float
hertz
=
s
->
start
+
x
*
range
/
(
float
)(
1
<<
(
int
)
ceil
(
log2
(
w
)));
char
*
units
;
if
(
hertz
==
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录