45 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
48 for (i = 0; i < o->nb_ ## name; i++) {\
49 char *spec = o->name[i].specifier;\
50 if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0)\
51 outvar = o->name[i].u.type;\
92 int i, *count = (
int*)(so + 1);
93 for (i = 0; i < *count; i++) {
114 memset(o, 0,
sizeof(*o));
129 p = strchr(arg,
':');
131 x = strtol(arg, &end, 10);
133 y = strtol(end + 1, &end, 10);
135 ar = (double)x / (
double)y;
170 static int opt_map(
void *optctx,
const char *opt,
const char *arg)
174 int i, negative = 0, file_idx;
175 int sync_file_idx = -1, sync_stream_idx;
186 if (sync = strchr(map,
',')) {
188 sync_file_idx = strtol(sync + 1, &sync, 0);
197 input_files[sync_file_idx]->ctx->streams[i], sync) == 1) {
203 "match any streams.\n", arg);
211 const char *c = map + 1;
220 file_idx = strtol(map, &p, 0);
232 *p ==
':' ? p + 1 : p) > 0)
238 *p ==
':' ? p + 1 : p) <= 0)
246 if (sync_file_idx >= 0) {
265 static int opt_attach(
void *optctx,
const char *opt,
const char *arg)
288 if (*(++arg) && *arg !=
':') {
292 *stream_spec = *arg ==
':' ? arg + 1 :
"";
297 *index = strtol(++arg,
NULL, 0);
312 char type_in, type_out;
313 const char *istream_spec =
NULL, *ostream_spec =
NULL;
314 int idx_in = 0, idx_out = 0;
319 if (type_in ==
'g' || type_out ==
'g')
321 if (type_in ==
's' || type_out ==
's')
323 if (type_in ==
'c' || type_out ==
'c')
330 #define METADATA_CHECK_INDEX(index, nb_elems, desc)\
331 if ((index) < 0 || (index) >= (nb_elems)) {\
332 av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\
337 #define SET_DICT(type, meta, context, index)\
340 meta = &context->metadata;\
343 METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\
344 meta = &context->chapters[index]->metadata;\
347 METADATA_CHECK_INDEX(index, context->nb_programs, "program")\
348 meta = &context->programs[index]->metadata;\
352 default: av_assert0(0);\
355 SET_DICT(type_in, meta_in, ic, idx_in);
356 SET_DICT(type_out, meta_out, oc, idx_out);
359 if (type_in ==
's') {
373 if (type_out ==
's') {
390 const char *codec_string = encoder ?
"encoder" :
"decoder";
402 codec_string, codec->
name, desc->
name);
409 if (codec->
type != type) {
418 char *codec_name =
NULL;
439 char *framerate =
NULL;
496 (strchr(filename,
':') ==
NULL || filename[1] ==
':' ||
500 fprintf(stderr,
"File '%s' already exists. Overwrite ? [y/N] ", filename);
503 fprintf(stderr,
"Not overwriting - exiting\n");
508 fprintf(stderr,
"File '%s' already exists. Exiting.\n", filename);
564 if (!strcmp(filename,
"-"))
568 !strcmp(filename,
"/dev/stdin");
584 if (file_iformat && file_iformat->
priv_class &&
587 snprintf(buf,
sizeof(buf),
"%d",
595 if (file_iformat && file_iformat->
priv_class &&
677 for (i = 0; i < orig_nb_streams; i++)
695 while ((c =
avio_r8(s)) && c !=
'\n')
707 const char *base[3] = { getenv(
"AVCONV_DATADIR"),
716 snprintf(filename,
sizeof(filename),
"%s%s/%s-%s.avpreset", base[i],
717 i != 1 ?
"" :
"/.avconv", codec_name, preset_name);
721 snprintf(filename,
sizeof(filename),
"%s%s/%s.avpreset", base[i],
722 i != 1 ?
"" :
"/.avconv", preset_name);
731 char *codec_name =
NULL;
738 }
else if (!strcmp(codec_name,
"copy"))
751 char *bsf =
NULL, *next, *codec_tag =
NULL;
783 if (!buf[0] || buf[0] ==
'#') {
787 if (!(arg = strchr(buf,
'='))) {
799 "Preset %s specified for stream %d:%d, but could not be opened.\n",
813 if (next = strchr(bsf,
','))
820 bsfc_prev->
next = bsfc;
830 uint32_t
tag = strtol(codec_tag, &next, 0);
878 video_enc = st->
codec;
881 const char *p =
NULL;
883 char *frame_aspect_ratio =
NULL, *frame_pix_fmt =
NULL;
884 char *intra_matrix =
NULL, *inter_matrix =
NULL;
885 const char *filters =
"null";
902 if (frame_aspect_ratio)
930 for (i = 0; p; i++) {
932 int e = sscanf(p,
"%d,%d,%d", &start, &end, &q);
998 audio_enc = st->
codec;
1003 const char *filters =
"anull";
1051 subtitle_enc = st->
codec;
1067 p = strchr(idx_str,
':');
1070 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
1101 if (in_ch->
end < ts_off)
1103 if (rt != INT64_MAX && in_ch->
start > rt + ts_off)
1110 out_ch->id = in_ch->
id;
1112 out_ch->start =
FFMAX(0, in_ch->
start - ts_off);
1113 out_ch->end =
FFMIN(rt, in_ch->
end - ts_off);
1145 "which is fed from a complex filtergraph. Filtering and streamcopy "
1181 if (!strcmp(filename,
"-"))
1192 if (!file_oformat) {
1198 if (!file_oformat) {
1230 #define NEW_STREAM(type, index)\
1232 ost = new_ ## type ## _stream(o, oc);\
1233 ost->source_index = index;\
1234 ost->sync_ist = input_streams[index];\
1235 input_streams[index]->discard = 0;\
1236 input_streams[index]->st->discard = AVDISCARD_NONE;\
1241 int area = 0, idx = -1;
1255 int channels = 0, idx = -1;
1301 "in any defined filter graph.\n", map->
linklabel);
1413 av_log(
NULL,
AV_LOG_FATAL,
"Invalid input file index %d while processing metadata maps\n", in_file_index);
1417 in_file_index >= 0 ?
1458 const char *stream_spec;
1459 int index = 0, j, ret;
1501 static int opt_target(
void *optctx,
const char *opt,
const char *arg)
1505 static const char *
const frame_rates[] = {
"25",
"30000/1001",
"24000/1001" };
1507 if (!strncmp(arg,
"pal-", 4)) {
1510 }
else if (!strncmp(arg,
"ntsc-", 5)) {
1513 }
else if (!strncmp(arg,
"film-", 5)) {
1530 }
else if ((fr == 29970) || (fr == 23976)) {
1550 if (!strcmp(arg,
"vcd")) {
1577 }
else if (!strcmp(arg,
"svcd")) {
1599 }
else if (!strcmp(arg,
"dvd")) {
1620 }
else if (!strncmp(arg,
"dv", 2)) {
1625 parse_option(o,
"pix_fmt", !strncmp(arg,
"dv50", 4) ?
"yuv422p" :
1626 norm ==
PAL ?
"yuv420p" :
"yuv411p",
options);
1646 static int opt_vstats(
void *optctx,
const char *opt,
const char *arg)
1649 time_t today2 = time(
NULL);
1650 struct tm *today = localtime(&today2);
1652 snprintf(filename,
sizeof(filename),
"vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
1705 static int opt_vsync(
void *optctx,
const char *opt,
const char *arg)
1737 char layout_str[32];
1740 int ret, channels, ac_str_size;
1748 snprintf(layout_str,
sizeof(layout_str),
"%"PRIu64, layout);
1755 snprintf(layout_str,
sizeof(layout_str),
"%d", channels);
1756 stream_str = strchr(opt,
':');
1757 ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
1790 int show_advanced = 0, show_avoptions = 0;
1793 if (!strcmp(opt,
"long"))
1795 else if (!strcmp(opt,
"full"))
1796 show_advanced = show_avoptions = 1;
1803 printf(
"Getting help:\n"
1804 " -h -- print basic options\n"
1805 " -h long -- print more options\n"
1806 " -h full -- print all options (including all format and codec specific options, very long)\n"
1807 " See man %s for detailed description of the options.\n"
1814 "instead of just one file:",
1842 if (show_avoptions) {
1852 printf(
"Hyper fast Audio and Video encoder\n");
1853 printf(
"usage: %s [options] [[infile options] -i infile]... {[outfile options] outfile}...\n",
program_name);
1882 "%s.\n", inout, g->
arg);
1887 ret = open_file(&o, g->
arg);
1906 memset(&octx, 0,
sizeof(octx));
1946 #define OFFSET(x) offsetof(OptionsContext, x)
1951 "force format",
"fmt" },
1953 "overwrite output files" },
1955 "codec name",
"codec" },
1957 "codec name",
"codec" },
1959 "preset name",
"preset" },
1961 "set input stream mapping",
1962 "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
1964 "set metadata information of outfile from infile",
1965 "outfile[,metadata]:infile[,metadata]" },
1967 "set chapters mapping",
"input_file_index" },
1969 "record or transcode \"duration\" seconds of audio/video",
1972 "set the limit file size in bytes",
"limit_size" },
1974 "set the start time offset",
"time_off" },
1976 "set the input ts offset",
"time_off" },
1978 "set the input ts scale",
"scale" },
1980 "add metadata",
"string=string" },
1982 "set the number of data frames to record",
"number" },
1984 "add timings for benchmarking" },
1986 "set max runtime in seconds",
"limit" },
1988 "dump each input packet" },
1990 "when dumping packets, also dump the payload" },
1992 "read input at native frame rate",
"" },
1994 "specify target file type (\"vcd\", \"svcd\", \"dvd\","
1995 " \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)",
"type" },
1997 "video sync method",
"" },
1999 "audio sync method",
"" },
2001 "audio drift threshold",
"threshold" },
2003 "copy timestamps" },
2005 "copy input stream time base when stream copying" },
2007 "finish encoding within shortest input" },
2009 "timestamp discontinuity delta threshold",
"threshold" },
2011 "exit on error",
"error" },
2013 "copy initial non-keyframes" },
2015 "set the number of frames to record",
"number" },
2017 "force codec tag/fourcc",
"fourcc/tag" },
2019 "use fixed quality scale (VBR)",
"q" },
2021 "use fixed quality scale (VBR)",
"q" },
2023 "set stream filterchain",
"filter_list" },
2025 "create a complex filtergraph",
"graph_description" },
2027 "print progress report during encoding", },
2029 "add an attachment to the output file",
"filename" },
2031 "extract an attachment into a file",
"filename" },
2033 "set CPU flags mask",
"mask" },
2037 "set the number of video frames to record",
"number" },
2039 "set frame rate (Hz value, fraction or abbreviation)",
"rate" },
2041 "set frame size (WxH or abbreviation)",
"size" },
2043 "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)",
"aspect" },
2045 "set pixel format",
"format" },
2049 "discard threshold",
"n" },
2051 "rate control override for specific intervals",
"override" },
2053 "force video codec ('copy' to copy stream)",
"codec" },
2055 "select the pass number (1 or 2)",
"n" },
2057 "select two pass log file name prefix",
"prefix" },
2059 "this option is deprecated, use the yadif filter instead" },
2061 "dump video coding statistics to file" },
2063 "dump video coding statistics to file",
"file" },
2065 "video filters",
"filter list" },
2067 "specify intra matrix coeffs",
"matrix" },
2069 "specify inter matrix coeffs",
"matrix" },
2071 "top=1/bottom=0/auto=-1 field first",
"" },
2073 "intra_dc_precision",
"precision" },
2075 "force video tag/fourcc",
"fourcc/tag" },
2077 "show QP histogram" },
2079 "force the selected framerate, disable the best supported framerate selection" },
2081 "set the value of an outfile streamid",
"streamIndex:value" },
2083 { .off =
OFFSET(forced_key_frames) },
"force key frames at specified timestamps",
"timestamps" },
2087 "set the number of audio frames to record",
"number" },
2089 "set audio quality (codec-specific)",
"quality", },
2091 "set audio sampling rate (in Hz)",
"rate" },
2093 "set number of audio channels",
"channels" },
2097 "force audio codec ('copy' to copy stream)",
"codec" },
2099 "force audio tag/fourcc",
"fourcc/tag" },
2101 "change audio volume (256=normal)" ,
"volume" },
2103 "set sample format",
"format" },
2105 "set channel layout",
"layout" },
2107 "audio filters",
"filter list" },
2111 "disable subtitle" },
2113 "force subtitle codec ('copy' to copy stream)",
"codec" },
2115 ,
"force subtitle tag/fourcc",
"fourcc/tag" },
2122 "set the maximum demux-decode delay",
"seconds" },
2124 "set the initial demux-decode delay",
"seconds" },
2127 "A comma-separated list of bitstream filters",
"bitstream_filters" },
2131 "force data codec ('copy' to copy stream)",
"codec" },
int parse_optgroup(void *optctx, OptionGroup *g)
Parse an options group and write results into optctx.
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static OutputStream * new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type)
static AVCodec * choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
int64_t avio_size(AVIOContext *s)
Get the filesize.
static int file_overwrite
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
static OutputStream * new_audio_stream(OptionsContext *o, AVFormatContext *oc)
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str)
Parse str and put in width_ptr and height_ptr the detected values.
static void init_output_filter(OutputFilter *ofilter, OptionsContext *o, AVFormatContext *oc)
static int opt_audio_tag(void *optctx, const char *opt, const char *arg)
int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
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.
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int index
stream index in AVFormatContext
static int sync(AVFormatContext *s, uint8_t *header)
Read input until we find the next ident.
static int configure_complex_filters(void)
void av_set_cpu_flags_mask(int mask)
Set a mask on flags returned by av_get_cpu_flags().
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
AVBitStreamFilterContext * bitstream_filters
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
float audio_drift_threshold
static int opt_vstats_file(void *optctx, const char *opt, const char *arg)
FilterGraph ** filtergraphs
static int opt_video_filters(void *optctx, const char *opt, const char *arg)
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
const AVClass * sws_get_class(void)
Get the AVClass for swsContext.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
AVDictionary * filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, AVCodec *codec)
Filter out options for given codec.
static OutputStream * new_subtitle_stream(OptionsContext *o, AVFormatContext *oc)
static void choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost)
SpecifierOpt * frame_pix_fmts
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static AVInputFormat * file_iformat
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
void uninit_parse_context(OptionParseContext *octx)
Free all allocated memory in an OptionParseContext.
#define AV_OPT_SEARCH_FAKE_OBJ
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
int avio_check(const char *url, int flags)
Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url...
static const uint8_t frame_sizes[]
AVFilterPad * output_pads
array of output pads
int copy_initial_nonkeyframes
enum AVSampleFormat sample_fmt
audio sample format
Opaque data information usually continuous.
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...
#define VSYNC_PASSTHROUGH
int id
unique ID to identify the chapter
int id
Format-specific stream ID.
static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
#define CODEC_FLAG_QSCALE
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int av_parse_cpu_flags(const char *s)
Parse CPU flags from a string.
double strtod(const char *, char **)
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
static int opt_subtitle_tag(void *optctx, const char *opt, const char *arg)
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
#define AVFMT_GLOBALHEADER
void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags, int alt_flags)
Print help for all options matching specified flags.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
struct AVBitStreamFilterContext * next
static int opt_video_tag(void *optctx, const char *opt, const char *arg)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
struct AVOutputFormat * oformat
AVDictionary ** setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts)
Setup AVCodecContext options for avformat_find_stream_info().
AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
int configure_filtergraph(FilterGraph *fg)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static const uint8_t frame_size[4]
void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)
void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
static int64_t start_time
void show_help_default(const char *opt, const char *arg)
Per-avtool specific help handler.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static int opt_filter_complex(void *optctx, const char *opt, const char *arg)
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
static void dump_attachment(AVStream *st, const char *filename)
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option.
simple assert() macros that are a bit more flexible than ISO C assert().
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
const char * name
Name of the codec implementation.
float dts_delta_threshold
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec)
Parse a metadata specifier passed as 'arg' parameter.
uint64_t channel_layout
Audio channel layout.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
int intra_dc_precision
precision of the intra DC coefficient - 8
const AVOption * av_opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags)
Look for an option in an object.
MetadataMap(* meta_data_maps)[2]
unsigned int nb_streams
A list of all streams in the file.
static int opt_deinterlace(void *optctx, const char *opt, const char *arg)
AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
int rc_override_count
ratecontrol override, see RcOverride
int void avio_flush(AVIOContext *s)
audio channel layout utility functions
const AVIOInterruptCB int_cb
char filename[1024]
input or output filename
SpecifierOpt * audio_channels
static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)
int av_strcasecmp(const char *a, const char *b)
static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
int metadata_chapters_manual
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type)
Guess the codec ID based upon muxer and filename.
struct OutputStream * ost
int width
picture width / height.
AVBitStreamFilterContext * av_bitstream_filter_init(const char *name)
static int intra_dc_precision
SpecifierOpt * audio_sample_rate
static int opt_data_codec(void *optctx, const char *opt, const char *arg)
static int open_output_file(OptionsContext *o, const char *filename)
SpecifierOpt * dump_attachment
A list of option groups that all have the same group type (e.g.
SpecifierOpt * metadata_map
char * specifier
stream/chapter/program/...
AVOutputFormat * av_guess_format(const char *short_name, const char *filename, const char *mime_type)
Return the output format in the list of registered output formats which best matches the provided par...
static int opt_vstats(void *optctx, const char *opt, const char *arg)
static const OptionGroupDef groups[]
const OptionDef options[]
Usually treated as AVMEDIA_TYPE_DATA.
Opaque data information usually sparse.
int opt_timelimit(void *optctx, const char *opt, const char *arg)
Limit the execution time.
SpecifierOpt * frame_sizes
static OutputStream * new_video_stream(OptionsContext *o, AVFormatContext *oc)
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
static void parse_matrix_coeffs(uint16_t *dest, const char *str)
#define AV_OPT_FLAG_ENCODING_PARAM
AVFilterContext * filter_ctx
filter context associated to this input/output
static int opt_audio_filters(void *optctx, const char *opt, const char *arg)
static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
A linked-list of the inputs/outputs of the filter chain.
int64_t end
chapter start/end time in time_base units
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
#define AVSEEK_FLAG_BACKWARD
void avfilter_inout_free(AVFilterInOut **inout)
Free the supplied list of AVFilterInOut and set *inout to NULL.
SpecifierOpt * frame_rates
struct InputStream * sync_ist
OutputFile ** output_files
enum AVMediaType codec_type
static AVCodec * find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
char * av_strdup(const char *s)
Duplicate the string s.
int sample_rate
samples per second
AVIOContext * pb
I/O context.
OutputStream ** output_streams
#define AV_OPT_FLAG_DECODING_PARAM
static double parse_frame_aspect_ratio(const char *arg)
static int opt_data_frames(void *optctx, const char *opt, const char *arg)
void avio_w8(AVIOContext *s, int b)
main external API structure.
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
int metadata_streams_manual
const char * attachment_filename
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
a very simple circular buffer FIFO implementation
static int opt_vsync(void *optctx, const char *opt, const char *arg)
static void uninit_options(OptionsContext *o)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
uint16_t * intra_matrix
custom intra quantization matrix
static int open_input_file(OptionsContext *o, const char *filename)
static int opt_video_frames(void *optctx, const char *opt, const char *arg)
#define FF_ARRAY_ELEMS(a)
int pad_idx
index of the filt_ctx pad to use for linking
const char program_name[]
program name, defined by the program for show_version().
int metadata_global_manual
static int opt_subtitle_codec(void *optctx, const char *opt, const char *arg)
int avconv_parse_options(int argc, char **argv)
static OutputContext octx
void * grow_array(void *array, int elem_size, int *size, int new_size)
Realloc array to hold new_size elements of elem_size.
static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
int avio_open2(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
const char * name
Name of the codec described by this descriptor.
#define CODEC_FLAG_GLOBAL_HEADER
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
uint16_t * inter_matrix
custom inter quantization matrix
This struct describes the properties of a single codec described by an AVCodecID. ...
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
Parse a string and return its corresponding value as a double.
char * name
unique name for this input/output in the list
int global_quality
Global quality for codecs which cannot change it per frame.
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
int64_t start_time
Decoding: position of the first frame of the component, in AV_TIME_BASE fractional seconds...
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Seek to the keyframe at timestamp.
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
static int opt_map(void *optctx, const char *opt, const char *arg)
enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx)
Get the type of an AVFilterPad.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
int guess_input_channel_layout(InputStream *ist)
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...
struct FilterGraph * graph
AVDictionary * format_opts
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
static int opt_attach(void *optctx, const char *opt, const char *arg)
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
InputStream ** input_streams
static int opt_streamid(void *optctx, const char *opt, const char *arg)
const char ** attachments
AVRational time_base
time base in which the start/end timestamps are specified
int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
Set the fields of the given AVCodecContext to default values corresponding to the given codec (defaul...
static int opt_audio_qscale(void *optctx, const char *opt, const char *arg)
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
static uint8_t * get_line(AVIOContext *s)
#define GROW_ARRAY(array, nb_elems)
int eof_reached
true if eof reached
int channels
number of audio channels
#define AVFMT_FLAG_NONBLOCK
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
void show_help_children(const AVClass *class, int flags)
Show help for all options with given flags in class and all its children.
static int opt_audio_frames(void *optctx, const char *opt, const char *arg)
AVDictionary * codec_opts
int64_t duration
Decoding: duration of the stream, in AV_TIME_BASE fractional seconds.
int read_yesno(void)
Return a positive value if a line read from standard input starts with [yY], otherwise return 0...
#define AV_DICT_DONT_OVERWRITE
static int opt_video_codec(void *optctx, const char *opt, const char *arg)
static int open_files(OptionGroupList *l, const char *inout, int(*open_file)(OptionsContext *, const char *))
#define SET_DICT(type, meta, context, index)
static OutputStream * new_attachment_stream(OptionsContext *o, AVFormatContext *oc)
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
int opt_cpuflags(void *optctx, const char *opt, const char *arg)
enum AVPixelFormat pix_fmts[2]
static OutputStream * new_data_stream(OptionsContext *o, AVFormatContext *oc)
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
void assert_avoptions(AVDictionary *m)
struct SwsContext * sws_opts
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int opt_target(void *optctx, const char *opt, const char *arg)
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
static void assert_file_overwrite(const char *filename)
#define NEW_STREAM(type, index)
if(!(ptr_align%ac->ptr_align)&&samples_align >=aligned_len)
static void init_options(OptionsContext *o)