History

ffmpeg: add -guess_layout_max option.

Nicolas George committed 13 years ago

Commit fccd8c21 parent 9648e144 files · +15 −0Browse files

Unified · Split

4 files
  1. doc/ffmpeg.texi +6 −0
  2. ffmpeg.c +2 −0
  3. ffmpeg.h +3 −0
  4. ffmpeg_opt.c +4 −0
doc/ffmpeg.texi+6−0
@@ -611,6 +611,12 @@ This is an alias for @code{-filter:a}, see the @ref{filter_option,,-filter optio · 610 unmodified lines
611Force audio tag/fourcc. This is an alias for @code{-tag:a}.611Force audio tag/fourcc. This is an alias for @code{-tag:a}.
612@item -absf @var{bitstream_filter}612@item -absf @var{bitstream_filter}
613Deprecated, see -bsf613Deprecated, see -bsf
614@item -guess_layout_max @var{channels} (@emph{input,per-stream})
615If some input channel layout is not known, try to guess only if it
616corresponds to at most the specified number of channels. For example, 2
617tells to @command{ffmpeg} to recognize 1 channel as mono and 2 channels as
618stereo but not 6 channels as 5.1. The default is to always try to guess. Use
6190 to disable all guessing.
614@end table620@end table
615 621
616@section Subtitle options:622@section Subtitle options:
ffmpeg.c+2−0
@@ -1443,6 +1443,8 @@ int guess_input_channel_layout(InputStream *ist) · 1442 unmodified lines
1443 if (!dec->channel_layout) {1443 if (!dec->channel_layout) {
1444 char layout_name[256];1444 char layout_name[256];
1445 1445
1446 if (dec->channels > ist->guess_layout_max)
1447 return 0;
1446 dec->channel_layout = av_get_default_channel_layout(dec->channels);1448 dec->channel_layout = av_get_default_channel_layout(dec->channels);
1447 if (!dec->channel_layout)1449 if (!dec->channel_layout)
1448 return 0;1450 return 0;
ffmpeg.h+3−0
@@ -171,6 +171,8 @@ typedef struct OptionsContext { · 170 unmodified lines
171 int nb_pass;171 int nb_pass;
172 SpecifierOpt *passlogfiles;172 SpecifierOpt *passlogfiles;
173 int nb_passlogfiles;173 int nb_passlogfiles;
174 SpecifierOpt *guess_layout_max;
175 int nb_guess_layout_max;
174} OptionsContext;176} OptionsContext;
175 177
176typedef struct InputFilter {178typedef struct InputFilter {
@@ -229,6 +231,7 @@ typedef struct InputStream { · 52 unmodified lines
229 AVDictionary *opts;231 AVDictionary *opts;
230 AVRational framerate; /* framerate forced with -r */232 AVRational framerate; /* framerate forced with -r */
231 int top_field_first;233 int top_field_first;
234 int guess_layout_max;
232 235
233 int resample_height;236 int resample_height;
234 int resample_width;237 int resample_width;
ffmpeg_opt.c+4−0
@@ -616,6 +616,8 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) · 615 unmodified lines
616 616
617 break;617 break;
618 case AVMEDIA_TYPE_AUDIO:618 case AVMEDIA_TYPE_AUDIO:
619 ist->guess_layout_max = INT_MAX;
620 MATCH_PER_STREAM_OPT(guess_layout_max, i, ist->guess_layout_max, ic, st);
619 guess_input_channel_layout(ist);621 guess_input_channel_layout(ist);
620 622
621 ist->resample_sample_fmt = dec->sample_fmt;623 ist->resample_sample_fmt = dec->sample_fmt;
@@ -2581,6 +2583,8 @@ const OptionDef options[] = { · 1959 unmodified lines
2581 "set channel layout", "layout" },2583 "set channel layout", "layout" },
2582 { "af", OPT_AUDIO | HAS_ARG | OPT_PERFILE, { .func_arg = opt_audio_filters },2584 { "af", OPT_AUDIO | HAS_ARG | OPT_PERFILE, { .func_arg = opt_audio_filters },
2583 "set audio filters", "filter_graph" },2585 "set audio filters", "filter_graph" },
2586 { "guess_layout_max", OPT_AUDIO | HAS_ARG | OPT_INT | OPT_SPEC | OPT_EXPERT, { .off = OFFSET(guess_layout_max) },
2587 "set the maximum number of channels to try to guess the channel layout" },
2584 2588
2585 /* subtitle options */2589 /* subtitle options */
2586 { "sn", OPT_SUBTITLE | OPT_BOOL | OPT_OFFSET, { .off = OFFSET(subtitle_disable) },2590 { "sn", OPT_SUBTITLE | OPT_BOOL | OPT_OFFSET, { .off = OFFSET(subtitle_disable) },

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t