diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-08-14 07:57:56 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-08-19 19:22:41 +0200 |
commit | 1136bd362a873156d9eb99f38a3edd09ae553eee (patch) | |
tree | 0bc2893715d5af4ee62ac8c64699a87108cce1b3 /cmdutils.c | |
parent | a3ad68d36c0bff87c525035b3f745bb274b00d41 (diff) | |
download | ffmpeg-1136bd362a873156d9eb99f38a3edd09ae553eee.tar.gz |
avtools: add -h demuxer/muxer
Diffstat (limited to 'cmdutils.c')
-rw-r--r-- | cmdutils.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c index 55cf3f082a..50076c231d 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -936,6 +936,57 @@ static void show_help_codec(const char *name, int encoder) } } +static void show_help_demuxer(const char *name) +{ + const AVInputFormat *fmt = av_find_input_format(name); + + if (!fmt) { + av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name); + return; + } + + printf("Demuxer %s [%s]:\n", fmt->name, fmt->long_name); + + if (fmt->extensions) + printf(" Common extensions: %s.\n", fmt->extensions); + + if (fmt->priv_class) + show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM); +} + +static void show_help_muxer(const char *name) +{ + const AVCodecDescriptor *desc; + const AVOutputFormat *fmt = av_guess_format(name, NULL, NULL); + + if (!fmt) { + av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name); + return; + } + + printf("Muxer %s [%s]:\n", fmt->name, fmt->long_name); + + if (fmt->extensions) + printf(" Common extensions: %s.\n", fmt->extensions); + if (fmt->mime_type) + printf(" Mime type: %s.\n", fmt->mime_type); + if (fmt->video_codec != AV_CODEC_ID_NONE && + (desc = avcodec_descriptor_get(fmt->video_codec))) { + printf(" Default video codec: %s.\n", desc->name); + } + if (fmt->audio_codec != AV_CODEC_ID_NONE && + (desc = avcodec_descriptor_get(fmt->audio_codec))) { + printf(" Default audio codec: %s.\n", desc->name); + } + if (fmt->subtitle_codec != AV_CODEC_ID_NONE && + (desc = avcodec_descriptor_get(fmt->subtitle_codec))) { + printf(" Default subtitle codec: %s.\n", desc->name); + } + + if (fmt->priv_class) + show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM); +} + int show_help(const char *opt, const char *arg) { char *topic, *par; @@ -952,6 +1003,10 @@ int show_help(const char *opt, const char *arg) show_help_codec(par, 0); } else if (!strcmp(topic, "encoder")) { show_help_codec(par, 1); + } else if (!strcmp(topic, "demuxer")) { + show_help_demuxer(par); + } else if (!strcmp(topic, "muxer")) { + show_help_muxer(par); } else { show_help_default(topic, par); } |