31
31
#include "config.h"
32
32
#include "libavformat/avformat.h"
33
#ifdef CONFIG_AVFILTER
34
33
#include "libavfilter/avfilter.h"
36
34
#include "libavdevice/avdevice.h"
37
35
#include "libswscale/swscale.h"
38
#ifdef CONFIG_POSTPROC
39
36
#include "libpostproc/postprocess.h"
41
37
#include "libavutil/avstring.h"
42
38
#include "libavcodec/opt.h"
43
39
#include "cmdutils.h"
44
40
#include "version.h"
46
41
#include "libavformat/network.h"
54
48
AVFormatContext *avformat_opts;
55
49
struct SwsContext *sws_opts;
51
const int this_year = 2009;
57
53
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
127
123
opt = argv[optindex++];
129
125
if (handleoptions && opt[0] == '-' && opt[1] != '\0') {
130
if (opt[1] == '-' && opt[2] == '\0') {
126
if (opt[1] == '-' && opt[2] == '\0') {
134
130
po= find_option(options, opt + 1);
136
132
po= find_option(options, "default");
177
173
int opt_default(const char *opt, const char *arg){
179
176
const AVOption *o= NULL;
180
177
int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
182
for(type=0; type<CODEC_TYPE_NB; type++){
179
for(type=0; type<CODEC_TYPE_NB && ret>= 0; type++){
183
180
const AVOption *o2 = av_find_opt(avctx_opts[0], opt, NULL, opt_types[type], opt_types[type]);
185
o = av_set_string2(avctx_opts[type], opt, arg, 1);
182
ret = av_set_string3(avctx_opts[type], opt, arg, 1, &o);
188
o = av_set_string2(avformat_opts, opt, arg, 1);
185
ret = av_set_string3(avformat_opts, opt, arg, 1, &o);
190
o = av_set_string2(sws_opts, opt, arg, 1);
187
ret = av_set_string3(sws_opts, opt, arg, 1, &o);
192
189
if(opt[0] == 'a')
193
o = av_set_string2(avctx_opts[CODEC_TYPE_AUDIO], opt+1, arg, 1);
190
ret = av_set_string3(avctx_opts[CODEC_TYPE_AUDIO], opt+1, arg, 1, &o);
194
191
else if(opt[0] == 'v')
195
o = av_set_string2(avctx_opts[CODEC_TYPE_VIDEO], opt+1, arg, 1);
192
ret = av_set_string3(avctx_opts[CODEC_TYPE_VIDEO], opt+1, arg, 1, &o);
196
193
else if(opt[0] == 's')
197
o = av_set_string2(avctx_opts[CODEC_TYPE_SUBTITLE], opt+1, arg, 1);
194
ret = av_set_string3(avctx_opts[CODEC_TYPE_SUBTITLE], opt+1, arg, 1, &o);
197
fprintf(stderr, "Invalid value '%s' for option '%s'\n", arg, opt);
219
220
const char *str= av_get_string(opts_ctx, opt_names[i], &opt, buf, sizeof(buf));
220
221
/* if an option with name opt_names[i] is present in opts_ctx then str is non-NULL */
221
222
if(str && ((opt->flags & flags) == flags))
222
av_set_string2(ctx, opt_names[i], str, 1);
223
av_set_string3(ctx, opt_names[i], str, 1, NULL);
274
275
PRINT_LIB_VERSION(outstream, avcodec, AVCODEC, indent);
275
276
PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, indent);
276
277
PRINT_LIB_VERSION(outstream, avdevice, AVDEVICE, indent);
277
#ifdef CONFIG_AVFILTER
278
279
PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, indent);
280
#ifdef CONFIG_SWSCALE
281
282
PRINT_LIB_VERSION(outstream, swscale, SWSCALE, indent);
283
#ifdef CONFIG_POSTPROC
284
285
PRINT_LIB_VERSION(outstream, postproc, POSTPROC, indent);
288
289
void show_banner(void)
290
fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-2008 Fabrice Bellard, et al.\n",
291
program_name, program_birth_year);
291
fprintf(stderr, "%s version " FFMPEG_VERSION ", Copyright (c) %d-%d Fabrice Bellard, et al.\n",
292
program_name, program_birth_year, this_year);
292
293
fprintf(stderr, " configuration: " FFMPEG_CONFIGURATION "\n");
293
294
print_all_lib_versions(stderr, 1);
294
295
fprintf(stderr, " built on " __DATE__ " " __TIME__);