FFmpeg
cmdutils.h
Go to the documentation of this file.
1 /*
2  * Various utilities for command line tools
3  * copyright (c) 2003 Fabrice Bellard
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef FFTOOLS_CMDUTILS_H
23 #define FFTOOLS_CMDUTILS_H
24 
25 #include <stdint.h>
26 
27 #include "config.h"
28 #include "libavcodec/avcodec.h"
29 #include "libavfilter/avfilter.h"
30 #include "libavformat/avformat.h"
31 #include "libswscale/swscale.h"
32 
33 #ifdef _WIN32
34 #undef main /* We don't want SDL to override our main() */
35 #endif
36 
37 /**
38  * program name, defined by the program for show_version().
39  */
40 extern const char program_name[];
41 
42 /**
43  * program birth year, defined by the program for show_banner()
44  */
45 extern const int program_birth_year;
46 
47 extern AVDictionary *sws_dict;
48 extern AVDictionary *swr_opts;
50 extern int hide_banner;
51 
52 /**
53  * Initialize dynamic library loading
54  */
55 void init_dynload(void);
56 
57 /**
58  * Uninitialize the cmdutils option system, in particular
59  * free the *_opts contexts and their contents.
60  */
61 void uninit_opts(void);
62 
63 /**
64  * Trivial log callback.
65  * Only suitable for opt_help and similar since it lacks prefix handling.
66  */
67 void log_callback_help(void* ptr, int level, const char* fmt, va_list vl);
68 
69 /**
70  * Fallback for options that are not explicitly handled, these will be
71  * parsed through AVOptions.
72  */
73 int opt_default(void *optctx, const char *opt, const char *arg);
74 
75 /**
76  * Limit the execution time.
77  */
78 int opt_timelimit(void *optctx, const char *opt, const char *arg);
79 
80 enum OptionType {
89 };
90 
91 /**
92  * Parse a string and return its corresponding value as a double.
93  *
94  * @param context the context of the value to be set (e.g. the
95  * corresponding command line option name)
96  * @param numstr the string to be parsed
97  * @param type the type (OPT_INT64 or OPT_FLOAT) as which the
98  * string should be parsed
99  * @param min the minimum valid accepted value
100  * @param max the maximum valid accepted value
101  */
102 int parse_number(const char *context, const char *numstr, enum OptionType type,
103  double min, double max, double *dst);
104 
105 typedef struct SpecifierOpt {
106  char *specifier; /**< stream/chapter/program/... specifier */
107  union {
108  uint8_t *str;
109  int i;
110  int64_t i64;
111  uint64_t ui64;
112  float f;
113  double dbl;
114  } u;
115 } SpecifierOpt;
116 
117 typedef struct SpecifierOptList {
119  int nb_opt;
120 
121  /* Canonical option definition that was parsed into this list. */
122  const struct OptionDef *opt_canon;
125 
126 typedef struct OptionDef {
127  const char *name;
129  int flags;
130 
131 /* The OPT_TYPE_FUNC option takes an argument.
132  * Must not be used with other option types, as for those it holds:
133  * - OPT_TYPE_BOOL do not take an argument
134  * - all other types do
135  */
136 #define OPT_FUNC_ARG (1 << 0)
137 /* Program will immediately exit after processing this option */
138 #define OPT_EXIT (1 << 1)
139 /* Option is intended for advanced users. Only affects
140  * help output.
141  */
142 #define OPT_EXPERT (1 << 2)
143 #define OPT_VIDEO (1 << 3)
144 #define OPT_AUDIO (1 << 4)
145 #define OPT_SUBTITLE (1 << 5)
146 #define OPT_DATA (1 << 6)
147 /* The option is per-file (currently ffmpeg-only). At least one of OPT_INPUT or
148  * OPT_OUTPUT must be set when this flag is in use.
149  */
150 #define OPT_PERFILE (1 << 7)
151 
152 /* Option is specified as an offset in a passed optctx.
153  * Always use as OPT_OFFSET in option definitions. */
154 #define OPT_FLAG_OFFSET (1 << 8)
155 #define OPT_OFFSET (OPT_FLAG_OFFSET | OPT_PERFILE)
156 
157 /* Option is to be stored in a SpecifierOptList.
158  Always use as OPT_SPEC in option definitions. */
159 #define OPT_FLAG_SPEC (1 << 9)
160 #define OPT_SPEC (OPT_FLAG_SPEC | OPT_OFFSET)
161 
162 /* Option applies per-stream (implies OPT_SPEC). */
163 #define OPT_FLAG_PERSTREAM (1 << 10)
164 #define OPT_PERSTREAM (OPT_FLAG_PERSTREAM | OPT_SPEC)
165 
166 /* ffmpeg-only - specifies whether an OPT_PERFILE option applies to input,
167  * output, or both. */
168 #define OPT_INPUT (1 << 11)
169 #define OPT_OUTPUT (1 << 12)
170 
171 /* This option is a "canonical" form, to which one or more alternatives
172  * exist. These alternatives are listed in u1.names_alt. */
173 #define OPT_HAS_ALT (1 << 13)
174 /* This option is an alternative form of some other option, whose
175  * name is stored in u1.name_canon */
176 #define OPT_HAS_CANON (1 << 14)
177 
178  union {
179  void *dst_ptr;
180  int (*func_arg)(void *, const char *, const char *);
181  size_t off;
182  } u;
183  const char *help;
184  const char *argname;
185 
186  union {
187  /* Name of the canonical form of this option.
188  * Is valid when OPT_HAS_CANON is set. */
189  const char *name_canon;
190  /* A NULL-terminated list of alternate forms of this option.
191  * Is valid when OPT_HAS_ALT is set. */
192  const char * const *names_alt;
193  } u1;
194 } OptionDef;
195 
196 /**
197  * Print help for all options matching specified flags.
198  *
199  * @param options a list of options
200  * @param msg title of this group. Only printed if at least one option matches.
201  * @param req_flags print only options which have all those flags set.
202  * @param rej_flags don't print options which have any of those flags set.
203  */
204 void show_help_options(const OptionDef *options, const char *msg, int req_flags,
205  int rej_flags);
206 
207 /**
208  * Show help for all options with given flags in class and all its
209  * children.
210  */
211 void show_help_children(const AVClass *class, int flags);
212 
213 /**
214  * Per-fftool specific help handler. Implemented in each
215  * fftool, called by show_help().
216  */
217 void show_help_default(const char *opt, const char *arg);
218 
219 /**
220  * Parse the command line arguments.
221  *
222  * @param optctx an opaque options context
223  * @param argc number of command line arguments
224  * @param argv values of command line arguments
225  * @param options Array with the definitions required to interpret every
226  * option of the form: -option_name [argument]
227  * @param parse_arg_function Name of the function called to process every
228  * argument without a leading option name flag. NULL if such arguments do
229  * not have to be processed.
230  */
231 int parse_options(void *optctx, int argc, char **argv, const OptionDef *options,
232  int (* parse_arg_function)(void *optctx, const char*));
233 
234 /**
235  * Parse one given option.
236  *
237  * @return on success 1 if arg was consumed, 0 otherwise; negative number on error
238  */
239 int parse_option(void *optctx, const char *opt, const char *arg,
240  const OptionDef *options);
241 
242 /**
243  * An option extracted from the commandline.
244  * Cannot use AVDictionary because of options like -map which can be
245  * used multiple times.
246  */
247 typedef struct Option {
248  const OptionDef *opt;
249  const char *key;
250  const char *val;
251 } Option;
252 
253 typedef struct OptionGroupDef {
254  /**< group name */
255  const char *name;
256  /**
257  * Option to be used as group separator. Can be NULL for groups which
258  * are terminated by a non-option argument (e.g. ffmpeg output files)
259  */
260  const char *sep;
261  /**
262  * Option flags that must be set on each option that is
263  * applied to this group
264  */
265  int flags;
267 
268 typedef struct OptionGroup {
270  const char *arg;
271 
273  int nb_opts;
274 
279 } OptionGroup;
280 
281 /**
282  * A list of option groups that all have the same group type
283  * (e.g. input files or output files)
284  */
285 typedef struct OptionGroupList {
287 
291 
292 typedef struct OptionParseContext {
294 
297 
298  /* parsing state */
301 
302 /**
303  * Parse an options group and write results into optctx.
304  *
305  * @param optctx an app-specific options context. NULL for global options group
306  */
307 int parse_optgroup(void *optctx, OptionGroup *g, const OptionDef *defs);
308 
309 /**
310  * Split the commandline into an intermediate form convenient for further
311  * processing.
312  *
313  * The commandline is assumed to be composed of options which either belong to a
314  * group (those with OPT_SPEC, OPT_OFFSET or OPT_PERFILE) or are global
315  * (everything else).
316  *
317  * A group (defined by an OptionGroupDef struct) is a sequence of options
318  * terminated by either a group separator option (e.g. -i) or a parameter that
319  * is not an option (doesn't start with -). A group without a separator option
320  * must always be first in the supplied groups list.
321  *
322  * All options within the same group are stored in one OptionGroup struct in an
323  * OptionGroupList, all groups with the same group definition are stored in one
324  * OptionGroupList in OptionParseContext.groups. The order of group lists is the
325  * same as the order of group definitions.
326  */
327 int split_commandline(OptionParseContext *octx, int argc, char *argv[],
328  const OptionDef *options,
329  const OptionGroupDef *groups, int nb_groups);
330 
331 /**
332  * Free all allocated memory in an OptionParseContext.
333  */
335 
336 /**
337  * Find the '-loglevel' option in the command line args and apply it.
338  */
339 void parse_loglevel(int argc, char **argv, const OptionDef *options);
340 
341 /**
342  * Return index of option opt in argv or 0 if not found.
343  */
344 int locate_option(int argc, char **argv, const OptionDef *options,
345  const char *optname);
346 
347 /**
348  * Check if the given stream matches a stream specifier.
349  *
350  * @param s Corresponding format context.
351  * @param st Stream from s to be checked.
352  * @param spec A stream specifier of the [v|a|s|d]:[<stream index>] form.
353  *
354  * @return 1 if the stream matches, 0 if it doesn't, <0 on error
355  */
356 int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
357 
358 /**
359  * Filter out options for given codec.
360  *
361  * Create a new options dictionary containing only the options from
362  * opts which apply to the codec with ID codec_id.
363  *
364  * @param opts dictionary to place options in
365  * @param codec_id ID of the codec that should be filtered for
366  * @param s Corresponding format context.
367  * @param st A stream from s for which the options should be filtered.
368  * @param codec The particular codec for which the options should be filtered.
369  * If null, the default one is looked up according to the codec id.
370  * @param dst a pointer to the created dictionary
371  * @return a non-negative number on success, a negative error code on failure
372  */
374  AVFormatContext *s, AVStream *st, const AVCodec *codec,
375  AVDictionary **dst);
376 
377 /**
378  * Setup AVCodecContext options for avformat_find_stream_info().
379  *
380  * Create an array of dictionaries, one dictionary for each stream
381  * contained in s.
382  * Each dictionary will contain the options from codec_opts which can
383  * be applied to the corresponding stream codec context.
384  */
387  AVDictionary ***dst);
388 
389 /**
390  * Print an error message to stderr, indicating filename and a human
391  * readable description of the error code err.
392  *
393  * If strerror_r() is not available the use of this function in a
394  * multithreaded application may be unsafe.
395  *
396  * @see av_strerror()
397  */
398 void print_error(const char *filename, int err);
399 
400 /**
401  * Print the program banner to stderr. The banner contents depend on the
402  * current version of the repository and of the libav* libraries used by
403  * the program.
404  */
405 void show_banner(int argc, char **argv, const OptionDef *options);
406 
407 /**
408  * Return a positive value if a line read from standard input
409  * starts with [yY], otherwise return 0.
410  */
411 int read_yesno(void);
412 
413 /**
414  * Get a file corresponding to a preset file.
415  *
416  * If is_path is non-zero, look for the file in the path preset_name.
417  * Otherwise search for a file named arg.ffpreset in the directories
418  * $FFMPEG_DATADIR (if set), $HOME/.ffmpeg, and in the datadir defined
419  * at configuration time or in a "ffpresets" folder along the executable
420  * on win32, in that order. If no such file is found and
421  * codec_name is defined, then search for a file named
422  * codec_name-preset_name.avpreset in the above-mentioned directories.
423  *
424  * @param filename buffer where the name of the found filename is written
425  * @param filename_size size in bytes of the filename buffer
426  * @param preset_name name of the preset to search
427  * @param is_path tell if preset_name is a filename path
428  * @param codec_name name of the codec for which to look for the
429  * preset, may be NULL
430  */
431 FILE *get_preset_file(char *filename, size_t filename_size,
432  const char *preset_name, int is_path, const char *codec_name);
433 
434 /**
435  * Realloc array to hold new_size elements of elem_size.
436  *
437  * @param array pointer to the array to reallocate, will be updated
438  * with a new pointer on success
439  * @param elem_size size in bytes of each element
440  * @param size new element count will be written here
441  * @param new_size number of elements to place in reallocated array
442  * @return a non-negative number on success, a negative error code on failure
443  */
444 int grow_array(void **array, int elem_size, int *size, int new_size);
445 
446 /**
447  * Atomically add a new element to an array of pointers, i.e. allocate
448  * a new entry, reallocate the array of pointers and make the new last
449  * member of this array point to the newly allocated buffer.
450  *
451  * @param array array of pointers to reallocate
452  * @param elem_size size of the new element to allocate
453  * @param nb_elems pointer to the number of elements of the array array;
454  * *nb_elems will be incremented by one by this function.
455  * @return pointer to the newly allocated entry or NULL on failure
456  */
457 void *allocate_array_elem(void *array, size_t elem_size, int *nb_elems);
458 
459 #define GROW_ARRAY(array, nb_elems)\
460  grow_array((void**)&array, sizeof(*array), &nb_elems, nb_elems + 1)
461 
462 #define GET_PIX_FMT_NAME(pix_fmt)\
463  const char *name = av_get_pix_fmt_name(pix_fmt);
464 
465 #define GET_CODEC_NAME(id)\
466  const char *name = avcodec_descriptor_get(id)->name;
467 
468 #define GET_SAMPLE_FMT_NAME(sample_fmt)\
469  const char *name = av_get_sample_fmt_name(sample_fmt)
470 
471 #define GET_SAMPLE_RATE_NAME(rate)\
472  char name[16];\
473  snprintf(name, sizeof(name), "%d", rate);
474 
475 double get_rotation(const int32_t *displaymatrix);
476 
477 /* read file contents into a string */
478 char *file_read(const char *filename);
479 
480 #endif /* FFTOOLS_CMDUTILS_H */
AVCodec
AVCodec.
Definition: codec.h:187
OptionGroup::group_def
const OptionGroupDef * group_def
Definition: cmdutils.h:269
show_help_default
void show_help_default(const char *opt, const char *arg)
Per-fftool specific help handler.
Definition: ffmpeg_opt.c:1177
level
uint8_t level
Definition: svq3.c:204
OptionDef::off
size_t off
Definition: cmdutils.h:181
SpecifierOpt::ui64
uint64_t ui64
Definition: cmdutils.h:111
program_name
const char program_name[]
program name, defined by the program for show_version().
Definition: ffmpeg.c:106
file_read
char * file_read(const char *filename)
Definition: cmdutils.c:1136
sws_dict
AVDictionary * sws_dict
Definition: cmdutils.c:59
OptionGroupList::groups
OptionGroup * groups
Definition: cmdutils.h:288
OptionDef::dst_ptr
void * dst_ptr
Definition: cmdutils.h:179
OptionGroupList::nb_groups
int nb_groups
Definition: cmdutils.h:289
codec_opts
AVDictionary * codec_opts
Definition: cmdutils.h:49
opt_timelimit
int opt_timelimit(void *optctx, const char *opt, const char *arg)
Limit the execution time.
OptionDef::type
enum OptionType type
Definition: cmdutils.h:128
OptionGroup::swr_opts
AVDictionary * swr_opts
Definition: cmdutils.h:278
max
#define max(a, b)
Definition: cuda_runtime.h:33
AVDictionary
Definition: dict.c:34
get_preset_file
FILE * get_preset_file(char *filename, size_t filename_size, const char *preset_name, int is_path, const char *codec_name)
Get a file corresponding to a preset file.
Definition: cmdutils.c:914
filter_codec_opts
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec, AVDictionary **dst)
Filter out options for given codec.
Definition: cmdutils.c:994
OptionDef
Definition: cmdutils.h:126
SpecifierOpt::i
int i
Definition: cmdutils.h:109
OptionGroupList
A list of option groups that all have the same group type (e.g.
Definition: cmdutils.h:285
OptionParseContext
Definition: cmdutils.h:292
Option
An option extracted from the commandline.
Definition: cmdutils.h:247
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
OPT_TYPE_FLOAT
@ OPT_TYPE_FLOAT
Definition: cmdutils.h:86
OptionGroup::nb_opts
int nb_opts
Definition: cmdutils.h:273
OptionGroupList::group_def
const OptionGroupDef * group_def
Definition: cmdutils.h:286
OptionDef::help
const char * help
Definition: cmdutils.h:183
OptionGroupDef
Definition: cmdutils.h:253
OptionGroup::codec_opts
AVDictionary * codec_opts
Definition: cmdutils.h:275
SpecifierOptList::nb_opt
int nb_opt
Definition: cmdutils.h:119
OptionGroupDef::flags
int flags
Option flags that must be set on each option that is applied to this group.
Definition: cmdutils.h:265
setup_find_stream_info_opts
int setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts, AVDictionary ***dst)
Setup AVCodecContext options for avformat_find_stream_info().
Definition: cmdutils.c:1059
SpecifierOpt::specifier
char * specifier
stream/chapter/program/...
Definition: cmdutils.h:106
SpecifierOptList::type
enum OptionType type
Definition: cmdutils.h:123
s
#define s(width, name)
Definition: cbs_vp9.c:198
OptionDef::argname
const char * argname
Definition: cmdutils.h:184
parse_number
int parse_number(const char *context, const char *numstr, enum OptionType type, double min, double max, double *dst)
Parse a string and return its corresponding value as a double.
Definition: cmdutils.c:87
uninit_opts
void uninit_opts(void)
Uninitialize the cmdutils option system, in particular free the *_opts contexts and their contents.
Definition: cmdutils.c:65
g
const char * g
Definition: vf_curves.c:127
Option::key
const char * key
Definition: cmdutils.h:249
print_error
void print_error(const char *filename, int err)
Print an error message to stderr, indicating filename and a human readable description of the error c...
Definition: cmdutils.c:898
allocate_array_elem
void * allocate_array_elem(void *array, size_t elem_size, int *nb_elems)
Atomically add a new element to an array of pointers, i.e.
Definition: cmdutils.c:1108
OPT_TYPE_DOUBLE
@ OPT_TYPE_DOUBLE
Definition: cmdutils.h:87
init_dynload
void init_dynload(void)
Initialize dynamic library loading.
Definition: cmdutils.c:78
show_help_children
void show_help_children(const AVClass *class, int flags)
Show help for all options with given flags in class and all its children.
Definition: cmdutils.c:143
codec_id
enum AVCodecID codec_id
Definition: vaapi_decode.c:389
arg
const char * arg
Definition: jacosubdec.c:67
show_help_options
void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags)
Print help for all options matching specified flags.
Definition: cmdutils.c:110
OptionGroupDef::name
const char * name
< group name
Definition: cmdutils.h:255
context
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your context
Definition: writing_filters.txt:91
AVFormatContext
Format I/O context.
Definition: avformat.h:1202
opts
AVDictionary * opts
Definition: movenc.c:50
OptionGroup::format_opts
AVDictionary * format_opts
Definition: cmdutils.h:276
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
OptionParseContext::global_opts
OptionGroup global_opts
Definition: cmdutils.h:293
Option::opt
const OptionDef * opt
Definition: cmdutils.h:248
swr_opts
AVDictionary * swr_opts
Definition: cmdutils.c:60
OptionGroup::opts
Option * opts
Definition: cmdutils.h:272
OptionGroup
Definition: cmdutils.h:268
AVCodecID
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: codec_id.h:49
check_stream_specifier
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
Definition: cmdutils.c:986
read_yesno
int read_yesno(void)
Return a positive value if a line read from standard input starts with [yY], otherwise return 0.
Definition: cmdutils.c:903
options
const OptionDef options[]
OPT_TYPE_INT
@ OPT_TYPE_INT
Definition: cmdutils.h:84
grow_array
int grow_array(void **array, int elem_size, int *size, int new_size)
Realloc array to hold new_size elements of elem_size.
Definition: cmdutils.c:1090
SpecifierOptList
Definition: cmdutils.h:117
size
int size
Definition: twinvq_data.h:10344
OPT_TYPE_INT64
@ OPT_TYPE_INT64
Definition: cmdutils.h:85
OptionType
OptionType
Definition: cmdutils.h:80
show_banner
void show_banner(int argc, char **argv, const OptionDef *options)
Print the program banner to stderr.
Definition: opt_common.c:237
SpecifierOptList::opt
SpecifierOpt * opt
Definition: cmdutils.h:118
uninit_parse_context
void uninit_parse_context(OptionParseContext *octx)
Free all allocated memory in an OptionParseContext.
Definition: cmdutils.c:751
OPT_TYPE_FUNC
@ OPT_TYPE_FUNC
Definition: cmdutils.h:81
OPT_TYPE_BOOL
@ OPT_TYPE_BOOL
Definition: cmdutils.h:82
OptionDef::u1
union OptionDef::@2 u1
OPT_TYPE_TIME
@ OPT_TYPE_TIME
Definition: cmdutils.h:88
parse_loglevel
void parse_loglevel(int argc, char **argv, const OptionDef *options)
Find the '-loglevel' option in the command line args and apply it.
Definition: cmdutils.c:543
parse_optgroup
int parse_optgroup(void *optctx, OptionGroup *g, const OptionDef *defs)
Parse an options group and write results into optctx.
Definition: cmdutils.c:444
opt_default
int opt_default(void *optctx, const char *opt, const char *arg)
Fallback for options that are not explicitly handled, these will be parsed through AVOptions.
Definition: cmdutils.c:585
format_opts
AVDictionary * format_opts
Definition: cmdutils.c:61
OptionParseContext::groups
OptionGroupList * groups
Definition: cmdutils.h:295
OptionDef::u
union OptionDef::@1 u
avcodec.h
SpecifierOpt::i64
int64_t i64
Definition: cmdutils.h:110
OptionGroup::sws_dict
AVDictionary * sws_dict
Definition: cmdutils.h:277
SpecifierOptList::opt_canon
const struct OptionDef * opt_canon
Definition: cmdutils.h:122
SpecifierOpt
Definition: cmdutils.h:105
split_commandline
int split_commandline(OptionParseContext *octx, int argc, char *argv[], const OptionDef *options, const OptionGroupDef *groups, int nb_groups)
Split the commandline into an intermediate form convenient for further processing.
Definition: cmdutils.c:776
array
static int array[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:111
AVStream
Stream structure.
Definition: avformat.h:841
hide_banner
int hide_banner
Definition: cmdutils.c:63
OptionGroup::arg
const char * arg
Definition: cmdutils.h:270
avformat.h
parse_options
int parse_options(void *optctx, int argc, char **argv, const OptionDef *options, int(*parse_arg_function)(void *optctx, const char *))
Parse the command line arguments.
OptionDef::names_alt
const char *const * names_alt
Definition: cmdutils.h:192
SpecifierOpt::str
uint8_t * str
Definition: cmdutils.h:108
avfilter.h
Option::val
const char * val
Definition: cmdutils.h:250
OptionDef::name_canon
const char * name_canon
Definition: cmdutils.h:189
SpecifierOpt::u
union SpecifierOpt::@0 u
OptionDef::name
const char * name
Definition: cmdutils.h:127
SpecifierOpt::dbl
double dbl
Definition: cmdutils.h:113
OPT_TYPE_STRING
@ OPT_TYPE_STRING
Definition: cmdutils.h:83
OptionGroupDef::sep
const char * sep
Option to be used as group separator.
Definition: cmdutils.h:260
log_callback_help
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
Trivial log callback.
Definition: cmdutils.c:73
get_rotation
double get_rotation(const int32_t *displaymatrix)
Definition: cmdutils.c:1118
int32_t
int32_t
Definition: audioconvert.c:56
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
OptionParseContext::nb_groups
int nb_groups
Definition: cmdutils.h:296
parse_option
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option.
Definition: cmdutils.c:368
locate_option
int locate_option(int argc, char **argv, const OptionDef *options, const char *optname)
Return index of option opt in argv or 0 if not found.
Definition: cmdutils.c:477
int
int
Definition: ffmpeg_filter.c:424
OptionParseContext::cur_group
OptionGroup cur_group
Definition: cmdutils.h:299
SpecifierOpt::f
float f
Definition: cmdutils.h:112
swscale.h
OptionDef::func_arg
int(* func_arg)(void *, const char *, const char *)
Definition: cmdutils.h:180
program_birth_year
const int program_birth_year
program birth year, defined by the program for show_banner()
Definition: ffmpeg.c:107
min
float min
Definition: vorbis_enc_data.h:429
OptionDef::flags
int flags
Definition: cmdutils.h:129