Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
41f025df
Commit
41f025df
authored
Dec 26, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: support filtering of unknown channel layouts.
parent
699b286a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
ffmpeg.c
ffmpeg.c
+1
-1
ffmpeg_filter.c
ffmpeg_filter.c
+17
-8
No files found.
ffmpeg.c
View file @
41f025df
...
...
@@ -2240,7 +2240,7 @@ static int transcode_init(void)
codec
->
sample_fmt
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
format
;
codec
->
sample_rate
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
sample_rate
;
codec
->
channel_layout
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
channel_layout
;
codec
->
channels
=
av
_get_channel_layout_nb_channels
(
codec
->
channel_layout
);
codec
->
channels
=
av
filter_link_get_channels
(
ost
->
filter
->
filter
->
inputs
[
0
]
);
codec
->
time_base
=
(
AVRational
){
1
,
codec
->
sample_rate
};
break
;
case
AVMEDIA_TYPE_VIDEO
:
...
...
ffmpeg_filter.c
View file @
41f025df
...
...
@@ -367,12 +367,16 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
char
*
sample_fmts
,
*
sample_rates
,
*
channel_layouts
;
char
name
[
255
];
int
ret
;
AVABufferSinkParams
*
params
=
av_abuffersink_params_alloc
();
if
(
!
params
)
return
AVERROR
(
ENOMEM
);
params
->
all_channel_counts
=
1
;
snprintf
(
name
,
sizeof
(
name
),
"output stream %d:%d"
,
ost
->
file_index
,
ost
->
index
);
ret
=
avfilter_graph_create_filter
(
&
ofilter
->
filter
,
avfilter_get_by_name
(
"ffabuffersink"
),
name
,
NULL
,
NULL
,
fg
->
graph
);
name
,
NULL
,
params
,
fg
->
graph
);
av_freep
(
&
params
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -620,20 +624,25 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilter
*
filter
=
avfilter_get_by_name
(
"abuffer"
);
InputStream
*
ist
=
ifilter
->
ist
;
int
pad_idx
=
in
->
pad_idx
;
char
args
[
255
],
name
[
255
];
AVBPrint
args
;
char
name
[
255
];
int
ret
;
snprintf
(
args
,
sizeof
(
args
),
"time_base=%d/%d:sample_rate=%d:sample_fmt=%s"
":channel_layout=0x%"
PRIx64
,
av_bprint_init
(
&
args
,
0
,
AV_BPRINT_SIZE_AUTOMATIC
);
av_bprintf
(
&
args
,
"time_base=%d/%d:sample_rate=%d:sample_fmt=%s"
,
1
,
ist
->
st
->
codec
->
sample_rate
,
ist
->
st
->
codec
->
sample_rate
,
av_get_sample_fmt_name
(
ist
->
st
->
codec
->
sample_fmt
),
ist
->
st
->
codec
->
channel_layout
);
av_get_sample_fmt_name
(
ist
->
st
->
codec
->
sample_fmt
));
if
(
ist
->
st
->
codec
->
channel_layout
)
av_bprintf
(
&
args
,
":channel_layout=0x%"
PRIx64
,
ist
->
st
->
codec
->
channel_layout
);
else
av_bprintf
(
&
args
,
":channels=%d"
,
ist
->
st
->
codec
->
channels
);
snprintf
(
name
,
sizeof
(
name
),
"graph %d input from stream %d:%d"
,
fg
->
index
,
ist
->
file_index
,
ist
->
st
->
index
);
if
((
ret
=
avfilter_graph_create_filter
(
&
ifilter
->
filter
,
filter
,
name
,
args
,
NULL
,
name
,
args
.
str
,
NULL
,
fg
->
graph
))
<
0
)
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment