You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
ffprobe: add -(no)find_stream_info expert option
This commit is contained in:
committed by
Clément Bœsch
parent
af50fbaaeb
commit
8e0d5b354e
15
ffprobe.c
15
ffprobe.c
@@ -130,6 +130,8 @@ typedef struct ReadInterval {
|
|||||||
static ReadInterval *read_intervals;
|
static ReadInterval *read_intervals;
|
||||||
static int read_intervals_nb = 0;
|
static int read_intervals_nb = 0;
|
||||||
|
|
||||||
|
static int find_stream_info = 1;
|
||||||
|
|
||||||
/* section structure definition */
|
/* section structure definition */
|
||||||
|
|
||||||
#define SECTION_MAX_NB_CHILDREN 10
|
#define SECTION_MAX_NB_CHILDREN 10
|
||||||
@@ -2771,10 +2773,9 @@ static void show_error(WriterContext *w, int err)
|
|||||||
|
|
||||||
static int open_input_file(InputFile *ifile, const char *filename)
|
static int open_input_file(InputFile *ifile, const char *filename)
|
||||||
{
|
{
|
||||||
int err, i, orig_nb_streams;
|
int err, i;
|
||||||
AVFormatContext *fmt_ctx = NULL;
|
AVFormatContext *fmt_ctx = NULL;
|
||||||
AVDictionaryEntry *t;
|
AVDictionaryEntry *t;
|
||||||
AVDictionary **opts;
|
|
||||||
int scan_all_pmts_set = 0;
|
int scan_all_pmts_set = 0;
|
||||||
|
|
||||||
fmt_ctx = avformat_alloc_context();
|
fmt_ctx = avformat_alloc_context();
|
||||||
@@ -2802,10 +2803,11 @@ static int open_input_file(InputFile *ifile, const char *filename)
|
|||||||
return AVERROR_OPTION_NOT_FOUND;
|
return AVERROR_OPTION_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill the streams in the format context */
|
if (find_stream_info) {
|
||||||
opts = setup_find_stream_info_opts(fmt_ctx, codec_opts);
|
AVDictionary **opts = setup_find_stream_info_opts(fmt_ctx, codec_opts);
|
||||||
orig_nb_streams = fmt_ctx->nb_streams;
|
int orig_nb_streams = fmt_ctx->nb_streams;
|
||||||
|
|
||||||
|
// TODO: reindent
|
||||||
err = avformat_find_stream_info(fmt_ctx, opts);
|
err = avformat_find_stream_info(fmt_ctx, opts);
|
||||||
|
|
||||||
for (i = 0; i < orig_nb_streams; i++)
|
for (i = 0; i < orig_nb_streams; i++)
|
||||||
@@ -2816,6 +2818,7 @@ static int open_input_file(InputFile *ifile, const char *filename)
|
|||||||
print_error(filename, err);
|
print_error(filename, err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
av_dump_format(fmt_ctx, 0, filename, 0);
|
av_dump_format(fmt_ctx, 0, filename, 0);
|
||||||
|
|
||||||
@@ -3472,6 +3475,8 @@ static const OptionDef real_options[] = {
|
|||||||
{ "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" },
|
{ "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" },
|
||||||
{ "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default}, "generic catch all option", "" },
|
{ "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default}, "generic catch all option", "" },
|
||||||
{ "i", HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"},
|
{ "i", HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"},
|
||||||
|
{ "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info },
|
||||||
|
"read and decode the streams to fill missing information with heuristics" },
|
||||||
{ NULL, },
|
{ NULL, },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user