Skip to content

Commit

Permalink
ffmpeg: support dump bit stream filter options.
Browse files Browse the repository at this point in the history
Support dump bit stream filter option in ffmpeg -h full and
ffmpeg -h bsf=FooBar.

Signed-off-by: Jun Zhao <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
mypopydev authored and michaelni committed Mar 16, 2018
1 parent 7b5cf0a commit a675eed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions fftools/cmdutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,21 @@ static void show_help_filter(const char *name)
}
#endif

static void show_help_bsf(const char *name)
{
const AVBitStreamFilter *bsf = av_bsf_get_by_name(name);

if (!bsf) {
av_log(NULL, AV_LOG_ERROR, "Unknown bit stream filter '%s'.\n", name);
return;
}

printf("Bit stream filter %s\n", bsf->name);
if (bsf->priv_class)
show_help_children(bsf->priv_class, AV_OPT_FLAG_BSF_PARAM);
printf("\n");
}

int show_help(void *optctx, const char *opt, const char *arg)
{
char *topic, *par;
Expand All @@ -1923,6 +1938,8 @@ int show_help(void *optctx, const char *opt, const char *arg)
} else if (!strcmp(topic, "filter")) {
show_help_filter(par);
#endif
} else if (!strcmp(topic, "bsf")) {
show_help_bsf(par);
} else {
show_help_default(topic, par);
}
Expand Down
3 changes: 2 additions & 1 deletion fftools/ffmpeg_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3114,7 +3114,7 @@ void show_help_default(const char *opt, const char *arg)
" -h -- print basic options\n"
" -h long -- print more options\n"
" -h full -- print all options (including all format and codec specific options, very long)\n"
" -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter\n"
" -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf\n"
" See man %s for detailed description of the options.\n"
"\n", program_name);

Expand Down Expand Up @@ -3159,6 +3159,7 @@ void show_help_default(const char *opt, const char *arg)
#endif
show_help_children(swr_get_class(), AV_OPT_FLAG_AUDIO_PARAM);
show_help_children(avfilter_get_class(), AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM);
show_help_children(av_bsf_get_class(), AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_BSF_PARAM);
}
}

Expand Down

0 comments on commit a675eed

Please sign in to comment.