Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
ba8efac9
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,发现更多精彩内容 >>
提交
ba8efac9
编写于
2月 25, 2013
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
af_channelmap: switch to an AVOptions-based system.
上级
b2b25b06
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
27 deletion
+22
-27
doc/filters.texi
doc/filters.texi
+3
-3
libavfilter/af_channelmap.c
libavfilter/af_channelmap.c
+18
-23
tests/filtergraphs/channelmap
tests/filtergraphs/channelmap
+1
-1
未找到文件。
doc/filters.texi
浏览文件 @
ba8efac9
...
...
@@ -310,7 +310,7 @@ This filter accepts the following named parameters:
Channel layout of the output stream.
@item map
Map channels from input to output. The argument is a
comma
-separated list of
Map channels from input to output. The argument is a
'|'
-separated list of
mappings, each in the @code{@var{in_channel}-@var{out_channel}} or
@var{in_channel} form. @var{in_channel} can be either the name of the input
channel (e.g. FL for front left) or its index in the input channel layout.
...
...
@@ -324,14 +324,14 @@ output channels preserving index.
For example, assuming a 5.1+downmix input MOV file
@example
avconv -i in.mov -filter 'channelmap=map=DL-FL
\,
DR-FR' out.wav
avconv -i in.mov -filter 'channelmap=map=DL-FL
|
DR-FR' out.wav
@end example
will create an output WAV file tagged as stereo from the downmix channels of
the input.
To fix a 5.1 WAV improperly encoded in AAC's native channel order
@example
avconv -i in.wav -filter 'channelmap=1
\,2\,0\,5\,3\,
4:channel_layout=5.1' out.wav
avconv -i in.wav -filter 'channelmap=1
|2|0|5|3|
4:channel_layout=5.1' out.wav
@end example
@section join
...
...
libavfilter/af_channelmap.c
浏览文件 @
ba8efac9
...
...
@@ -123,26 +123,13 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
{
ChannelMapContext
*
s
=
ctx
->
priv
;
int
ret
;
char
*
mapping
;
char
*
mapping
,
separator
=
'|'
;
int
map_entries
=
0
;
char
buf
[
256
];
enum
MappingMode
mode
;
uint64_t
out_ch_mask
=
0
;
int
i
;
if
(
!
args
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"No parameters supplied.
\n
"
);
return
AVERROR
(
EINVAL
);
}
s
->
class
=
&
channelmap_class
;
av_opt_set_defaults
(
s
);
if
((
ret
=
av_set_options_string
(
s
,
args
,
"="
,
":"
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Error parsing options string '%s'.
\n
"
,
args
);
return
ret
;
}
mapping
=
s
->
mapping_str
;
if
(
!
mapping
)
{
...
...
@@ -165,13 +152,20 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
else
mode
=
MAP_PAIR_STR_STR
;
}
#if FF_API_OLD_FILTER_OPTS
if
(
strchr
(
mapping
,
','
))
{
av_log
(
ctx
,
AV_LOG_WARNING
,
"This syntax is deprecated, use "
"'|' to separate the mappings.
\n
"
);
separator
=
','
;
}
#endif
}
if
(
mode
!=
MAP_NONE
)
{
char
*
comma
=
mapping
;
char
*
sep
=
mapping
;
map_entries
=
1
;
while
((
comma
=
strchr
(
comma
,
','
)))
{
if
(
*++
comma
)
// Allow trailing comma
while
((
sep
=
strchr
(
sep
,
separator
)))
{
if
(
*++
sep
)
// Allow trailing comma
map_entries
++
;
}
}
...
...
@@ -188,7 +182,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
static
const
char
err
[]
=
"Failed to parse channel map
\n
"
;
switch
(
mode
)
{
case
MAP_ONE_INT
:
if
(
get_channel_idx
(
&
mapping
,
&
in_ch_idx
,
','
,
MAX_CH
)
<
0
)
{
if
(
get_channel_idx
(
&
mapping
,
&
in_ch_idx
,
separator
,
MAX_CH
)
<
0
)
{
ret
=
AVERROR
(
EINVAL
);
av_log
(
ctx
,
AV_LOG_ERROR
,
err
);
goto
fail
;
...
...
@@ -197,7 +191,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
s
->
map
[
i
].
out_channel_idx
=
i
;
break
;
case
MAP_ONE_STR
:
if
(
!
get_channel
(
&
mapping
,
&
in_ch
,
','
))
{
if
(
!
get_channel
(
&
mapping
,
&
in_ch
,
separator
))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
err
);
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
...
...
@@ -207,7 +201,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
break
;
case
MAP_PAIR_INT_INT
:
if
(
get_channel_idx
(
&
mapping
,
&
in_ch_idx
,
'-'
,
MAX_CH
)
<
0
||
get_channel_idx
(
&
mapping
,
&
out_ch_idx
,
','
,
MAX_CH
)
<
0
)
{
get_channel_idx
(
&
mapping
,
&
out_ch_idx
,
separator
,
MAX_CH
)
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
err
);
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
...
...
@@ -217,7 +211,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
break
;
case
MAP_PAIR_INT_STR
:
if
(
get_channel_idx
(
&
mapping
,
&
in_ch_idx
,
'-'
,
MAX_CH
)
<
0
||
get_channel
(
&
mapping
,
&
out_ch
,
','
)
<
0
||
get_channel
(
&
mapping
,
&
out_ch
,
separator
)
<
0
||
out_ch
&
out_ch_mask
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
err
);
ret
=
AVERROR
(
EINVAL
);
...
...
@@ -229,7 +223,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
break
;
case
MAP_PAIR_STR_INT
:
if
(
get_channel
(
&
mapping
,
&
in_ch
,
'-'
)
<
0
||
get_channel_idx
(
&
mapping
,
&
out_ch_idx
,
','
,
MAX_CH
)
<
0
)
{
get_channel_idx
(
&
mapping
,
&
out_ch_idx
,
separator
,
MAX_CH
)
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
err
);
ret
=
AVERROR
(
EINVAL
);
goto
fail
;
...
...
@@ -239,7 +233,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
break
;
case
MAP_PAIR_STR_STR
:
if
(
get_channel
(
&
mapping
,
&
in_ch
,
'-'
)
<
0
||
get_channel
(
&
mapping
,
&
out_ch
,
','
)
<
0
||
get_channel
(
&
mapping
,
&
out_ch
,
separator
)
<
0
||
out_ch
&
out_ch_mask
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
err
);
ret
=
AVERROR
(
EINVAL
);
...
...
@@ -409,6 +403,7 @@ AVFilter avfilter_af_channelmap = {
.
init
=
channelmap_init
,
.
query_formats
=
channelmap_query_formats
,
.
priv_size
=
sizeof
(
ChannelMapContext
),
.
priv_class
=
&
channelmap_class
,
.
inputs
=
avfilter_af_channelmap_inputs
,
.
outputs
=
avfilter_af_channelmap_outputs
,
...
...
tests/filtergraphs/channelmap
浏览文件 @
ba8efac9
channelmap=map=1
\,2\,0\,5\,3\,
4:channel_layout=5.1
channelmap=map=1
|2|0|5|3|
4:channel_layout=5.1
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录