diff --git a/ffmpeg.c b/ffmpeg.c index 189d7270fa..96a73fd0a1 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -82,9 +82,6 @@ typedef struct AVMetaDataMap { extern const OptionDef options[]; -static void show_help(void); -static int opt_default(const char *opt, const char *arg); - #define MAX_FILES 20 static AVFormatContext *input_files[MAX_FILES]; @@ -2129,6 +2126,52 @@ static void opt_format(const char *arg) } } +#if defined(CONFIG_FFM_DEMUXER) || defined(CONFIG_FFM_MUXER) +extern int ffm_nopts; +#endif + +static int opt_default(const char *opt, const char *arg){ + int type; + const AVOption *o= NULL; + int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0}; + + for(type=0; typename; + +#if defined(CONFIG_FFM_DEMUXER) || defined(CONFIG_FFM_MUXER) + /* disable generate of real time pts in ffm (need to be supressed anyway) */ + if(avctx_opts[0]->flags & CODEC_FLAG_BITEXACT) + ffm_nopts = 1; +#endif + + if(avctx_opts[0]->debug) + av_log_level = AV_LOG_DEBUG; + return 0; +} + static void opt_video_rc_eq(char *arg) { video_rc_eq = arg; @@ -3271,10 +3314,6 @@ static int64_t getutime(void) #endif } -#if defined(CONFIG_FFM_DEMUXER) || defined(CONFIG_FFM_MUXER) -extern int ffm_nopts; -#endif - static void opt_show_formats(void) { AVInputFormat *ifmt; @@ -3421,6 +3460,49 @@ static void opt_intra_matrix(const char *arg) parse_matrix_coeffs(intra_matrix, arg); } +/** + * Trivial log callback. + * Only suitable for show_help and similar since it lacks prefix handling. + */ +static void log_callback_help(void* ptr, int level, const char* fmt, va_list vl) +{ + vfprintf(stdout, fmt, vl); +} + +static void show_help(void) +{ + av_log_set_callback(log_callback_help); + printf("usage: ffmpeg [[infile options] -i infile]... {[outfile options] outfile}...\n" + "Hyper fast Audio and Video encoder\n"); + printf("\n"); + show_help_options(options, "Main options:\n", + OPT_EXPERT | OPT_AUDIO | OPT_VIDEO, 0); + show_help_options(options, "\nVideo options:\n", + OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, + OPT_VIDEO); + show_help_options(options, "\nAdvanced Video options:\n", + OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, + OPT_VIDEO | OPT_EXPERT); + show_help_options(options, "\nAudio options:\n", + OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, + OPT_AUDIO); + show_help_options(options, "\nAdvanced Audio options:\n", + OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, + OPT_AUDIO | OPT_EXPERT); + show_help_options(options, "\nSubtitle options:\n", + OPT_SUBTITLE | OPT_GRAB, + OPT_SUBTITLE); + show_help_options(options, "\nAudio/Video grab options:\n", + OPT_GRAB, + OPT_GRAB); + show_help_options(options, "\nAdvanced options:\n", + OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, + OPT_EXPERT); + av_opt_show(avctx_opts[0], NULL); + av_opt_show(avformat_opts, NULL); + av_opt_show(sws_opts, NULL); +} + static void opt_show_help(void) { show_help(); @@ -3618,48 +3700,6 @@ static void opt_show_version(void) exit(0); } -static int opt_default(const char *opt, const char *arg){ - int type; - const AVOption *o= NULL; - int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0}; - - for(type=0; typename; - -#if defined(CONFIG_FFM_DEMUXER) || defined(CONFIG_FFM_MUXER) - /* disable generate of real time pts in ffm (need to be supressed anyway) */ - if(avctx_opts[0]->flags & CODEC_FLAG_BITEXACT) - ffm_nopts = 1; -#endif - - if(avctx_opts[0]->debug) - av_log_level = AV_LOG_DEBUG; - return 0; -} - const OptionDef options[] = { /* main options */ { "L", 0, {(void*)opt_show_license}, "show license" }, @@ -3785,49 +3825,6 @@ const OptionDef options[] = { { NULL, }, }; -/** - * Trivial log callback. - * Only suitable for show_help and similar since it lacks prefix handling. - */ -static void log_callback_help(void* ptr, int level, const char* fmt, va_list vl) -{ - vfprintf(stdout, fmt, vl); -} - -static void show_help(void) -{ - av_log_set_callback(log_callback_help); - printf("usage: ffmpeg [[infile options] -i infile]... {[outfile options] outfile}...\n" - "Hyper fast Audio and Video encoder\n"); - printf("\n"); - show_help_options(options, "Main options:\n", - OPT_EXPERT | OPT_AUDIO | OPT_VIDEO, 0); - show_help_options(options, "\nVideo options:\n", - OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, - OPT_VIDEO); - show_help_options(options, "\nAdvanced Video options:\n", - OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, - OPT_VIDEO | OPT_EXPERT); - show_help_options(options, "\nAudio options:\n", - OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, - OPT_AUDIO); - show_help_options(options, "\nAdvanced Audio options:\n", - OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, - OPT_AUDIO | OPT_EXPERT); - show_help_options(options, "\nSubtitle options:\n", - OPT_SUBTITLE | OPT_GRAB, - OPT_SUBTITLE); - show_help_options(options, "\nAudio/Video grab options:\n", - OPT_GRAB, - OPT_GRAB); - show_help_options(options, "\nAdvanced options:\n", - OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_GRAB, - OPT_EXPERT); - av_opt_show(avctx_opts[0], NULL); - av_opt_show(avformat_opts, NULL); - av_opt_show(sws_opts, NULL); -} - static int av_exit() { int i;