44 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\ 
   47     for (i = 0; i < o->nb_ ## name; i++) {\ 
   48         char *spec = o->name[i].specifier;\ 
   49         if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0)\ 
   50             outvar = o->name[i].u.type;\ 
   56 #define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\ 
   59     for (i = 0; i < o->nb_ ## name; i++) {\ 
   60         char *spec = o->name[i].specifier;\ 
   61         if (!strcmp(spec, mediatype))\ 
   62             outvar = o->name[i].u.type;\ 
  128             int i, *
count = (
int*)(so + 1);
 
  129             for (i = 0; i < *
count; i++) {
 
  151     memset(o, 0, 
sizeof(*o));
 
  169         char *p = strchr(e->
key, 
':');
 
  183            "If you are looking for an option to preserve the quality (which is not " 
  184            "what -%s was for), use -qscale 0 or an equivalent quality factor option.\n",
 
  225 static int opt_map(
void *optctx, 
const char *opt, 
const char *
arg)
 
  229     int i, negative = 0, file_idx;
 
  230     int sync_file_idx = -1, sync_stream_idx = 0;
 
  243     if (sync = strchr(map, 
',')) {
 
  245         sync_file_idx = strtol(sync + 1, &sync, 0);
 
  254                                        input_files[sync_file_idx]->ctx->streams[i], sync) == 1) {
 
  260                                        "match any streams.\n", arg);
 
  268         const char *
c = map + 1;
 
  277         file_idx = strtol(map, &p, 0);
 
  289                                            *p == 
':' ? p + 1 : p) > 0)
 
  295                             *p == 
':' ? p + 1 : p) <= 0)
 
  303                 if (sync_file_idx >= 0) {
 
  350     n = sscanf(arg, 
"%d.%d.%d:%d.%d",
 
  354     if (n != 3 && n != 5) {
 
  356                "[file.stream.channel|-1][:syncfile:syncstream]\n");
 
  411             if (*(++arg) && *arg != 
':') {
 
  415             *stream_spec = *arg == 
':' ? arg + 1 : 
"";
 
  420                 *index = strtol(++arg, 
NULL, 0);
 
  435     char type_in, type_out;
 
  436     const char *istream_spec = 
NULL, *ostream_spec = 
NULL;
 
  437     int idx_in = 0, idx_out = 0;
 
  443         if (type_out == 
'g' || !*outspec)
 
  445         if (type_out == 
's' || !*outspec)
 
  447         if (type_out == 
'c' || !*outspec)
 
  452     if (type_in == 
'g' || type_out == 
'g')
 
  454     if (type_in == 
's' || type_out == 
's')
 
  456     if (type_in == 
'c' || type_out == 
'c')
 
  463 #define METADATA_CHECK_INDEX(index, nb_elems, desc)\ 
  464     if ((index) < 0 || (index) >= (nb_elems)) {\ 
  465         av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\ 
  470 #define SET_DICT(type, meta, context, index)\ 
  473             meta = &context->metadata;\ 
  476             METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\ 
  477             meta = &context->chapters[index]->metadata;\ 
  480             METADATA_CHECK_INDEX(index, context->nb_programs, "program")\ 
  481             meta = &context->programs[index]->metadata;\ 
  485         default: av_assert0(0);\ 
  488     SET_DICT(type_in, meta_in, ic, idx_in);
 
  489     SET_DICT(type_out, meta_out, oc, idx_out);
 
  492     if (type_in == 
's') {
 
  506     if (type_out == 
's') {
 
  525     struct tm time = *gmtime((time_t*)&recording_timestamp);
 
  526     if (!strftime(buf, 
sizeof(buf), 
"creation_time=%Y-%m-%dT%H:%M:%S%z", &time))
 
  531                                  "tag instead.\n", opt);
 
  538     const char *codec_string = encoder ? 
"encoder" : 
"decoder";
 
  550                    codec_string, codec->
name, desc->
name);
 
  557     if (codec->
type != type) {
 
  566     char *codec_name = 
NULL;
 
  587         char *framerate = 
NULL, *hwaccel = 
NULL, *hwaccel_device = 
NULL;
 
  588         char *codec_tag = 
NULL;
 
  590         char *discard_str = 
NULL;
 
  612             uint32_t 
tag = strtol(codec_tag, &next, 0);
 
  671                 if (!strcmp(hwaccel, 
"none"))
 
  673                 else if (!strcmp(hwaccel, 
"auto"))
 
  677                     for (i = 0; hwaccels[i].
name; i++) {
 
  678                         if (!strcmp(hwaccels[i].
name, hwaccel)) {
 
  688                         for (i = 0; hwaccels[i].
name; i++)
 
  697             if (hwaccel_device) {
 
  718             char *canvas_size = 
NULL;
 
  742         fprintf(stderr, 
"Error, both -y and -n supplied. Exiting.\n");
 
  748         if (proto_name && !strcmp(proto_name, 
"file") && 
avio_check(filename, 0) == 0) {
 
  750                 fprintf(stderr,
"File '%s' already exists. Overwrite ? [y/N] ", filename);
 
  753                 signal(SIGINT, SIG_DFL);
 
  814     char *    data_codec_name = 
NULL;
 
  815     int scan_all_pmts_set = 0;
 
  824     if (!strcmp(filename, 
"-"))
 
  828                          strcmp(filename, 
"/dev/stdin");
 
  843         if (file_iformat && file_iformat->
priv_class &&
 
  852         if (file_iformat && file_iformat->
priv_class &&
 
  879     if (video_codec_name)
 
  881     if (audio_codec_name)
 
  883     if (subtitle_codec_name)
 
  893         scan_all_pmts_set = 1;
 
  901     if (scan_all_pmts_set)
 
  932         int64_t seek_timestamp = timestamp;
 
  935             int dts_heuristic = 0;
 
  994         if (!option || foption)
 
 1000                    "input file #%d (%s) is not a decoding option.\n", e->
key,
 
 1007                "input file #%d (%s) has not been used for any stream. The most " 
 1008                "likely reason is either wrong type (e.g. a video option with " 
 1009                "no video streams) or that it is a private option of some decoder " 
 1010                "which was not actually used for any stream.\n", e->
key,
 
 1026     for (i = 0; i < orig_nb_streams; i++)
 
 1046     while ((c = 
avio_r8(s)) && c != 
'\n')
 
 1057     char filename[1000];
 
 1058     const char *base[3] = { getenv(
"AVCONV_DATADIR"),
 
 1067             snprintf(filename, 
sizeof(filename), 
"%s%s/%s-%s.avpreset", base[i],
 
 1068                      i != 1 ? 
"" : 
"/.avconv", codec_name, preset_name);
 
 1072             snprintf(filename, 
sizeof(filename), 
"%s%s/%s.avpreset", base[i],
 
 1073                      i != 1 ? 
"" : 
"/.avconv", preset_name);
 
 1082     char *codec_name = 
NULL;
 
 1089     } 
else if (!strcmp(codec_name, 
"copy"))
 
 1102     char *bsf = 
NULL, *next, *codec_tag = 
NULL;
 
 1143                 if (!buf[0] || buf[0] == 
'#') {
 
 1147                 if (!(arg = strchr(buf, 
'='))) {
 
 1159                    "Preset %s specified for stream %d:%d, but could not be opened.\n",
 
 1183         if (next = strchr(bsf, 
','))
 
 1185         if (arg = strchr(bsf, 
'='))
 
 1192             bsfc_prev->
next = bsfc;
 
 1203         uint32_t 
tag = strtol(codec_tag, &next, 0);
 
 1230     if (source_index >= 0) {
 
 1243     const char *p = str;
 
 1275     while ((ret = 
avio_read(pb, buf, 
sizeof(buf))) > 0)
 
 1311                "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n" 
 1312                "Filtering and streamcopy cannot be used together.\n",
 
 1313                ost->
filters ? 
"Filtergraph" : 
"Filtergraph script",
 
 1325     char *frame_rate = 
NULL, *frame_aspect_ratio = 
NULL;
 
 1340     if (frame_aspect_ratio) {
 
 1343             q.
num <= 0 || q.
den <= 0) {
 
 1354         const char *p = 
NULL;
 
 1356         char *frame_pix_fmt = 
NULL;
 
 1357         char *intra_matrix = 
NULL, *inter_matrix = 
NULL;
 
 1358         char *chroma_intra_matrix = 
NULL;
 
 1370         if (frame_pix_fmt && *frame_pix_fmt == 
'+') {
 
 1372             if (!*++frame_pix_fmt)
 
 1373                 frame_pix_fmt = 
NULL;
 
 1392         if (chroma_intra_matrix) {
 
 1411         for (i = 0; p; i++) {
 
 1413             int e = sscanf(p, 
"%d,%d,%d", &start, &end, &q);
 
 1501         char *sample_fmt = 
NULL;
 
 1627     p = strchr(idx_str, 
':');
 
 1630                "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
 
 1662         if (in_ch->
end < ts_off)
 
 1664         if (rt != INT64_MAX && in_ch->
start > rt + ts_off)
 
 1671         out_ch->id        = in_ch->
id;
 
 1673         out_ch->start     = 
FFMAX(0,  in_ch->
start - ts_off);
 
 1674         out_ch->end       = 
FFMIN(rt, in_ch->
end   - ts_off);
 
 1698         const char *enc_config;
 
 1756                "which is fed from a complex filtergraph. Filtering and streamcopy " 
 1762         const char *opt = ost->
filters ? 
"-vf/-af/-filter" : 
"-filter_script";
 
 1764                "%s '%s' was specified through the %s option " 
 1765                "for output stream %d:%d, which is fed from a complex filtergraph.\n" 
 1766                "%s and -filter_complex cannot be used together for the same stream.\n",
 
 1767                ost->
filters ? 
"Filtergraph" : 
"Filtergraph script",
 
 1835     if (!strcmp(filename, 
"-"))
 
 1871     if (!strcmp(file_oformat->
name, 
"ffm") &&
 
 1915             int area = 0, idx = -1;
 
 1937             int channels = 0, idx = -1;
 
 1960                     int input_props = 0, output_props = 0;
 
 1963                     if (input_descriptor)
 
 1965                     if (output_descriptor)
 
 1967                     if (subtitle_codec_name ||
 
 1968                         input_props & output_props ||
 
 1970                         input_descriptor && output_descriptor &&
 
 1971                         (!input_descriptor->
props ||
 
 1972                          !output_descriptor->
props)) {
 
 2012                            "in any defined filter graph, or was already used elsewhere.\n", map->
linklabel);
 
 2042                            "Cannot map stream #%d:%d - unsupported type.\n",
 
 2046                                "If you want unsupported types ignored instead " 
 2047                                "of failing, please use the -ignore_unknown option\n" 
 2048                                "If you want them copied, please use -copy_unknown\n");
 
 2120         if (!option || foption)
 
 2126                    "output file #%d (%s) is not an encoding option.\n", e->
key,
 
 2133         if (!strcmp(e->
key, 
"gop_timecode"))
 
 2137                "output file #%d (%s) has not been used for any stream. The most " 
 2138                "likely reason is either wrong type (e.g. a video option with " 
 2139                "no video streams) or that it is a private option of some encoder " 
 2140                "which was not actually used for any stream.\n", e->
key,
 
 2155                "No input streams but output needs an input stream\n");
 
 2184             av_log(
NULL, 
AV_LOG_FATAL, 
"Invalid input file index %d while processing metadata maps\n", in_file_index);
 
 2188                       in_file_index >= 0 ?
 
 2227             if (!output_streams[i]->stream_copy) {
 
 2238         const char *stream_spec;
 
 2289     static const char *
const frame_rates[] = { 
"25", 
"30000/1001", 
"24000/1001" };
 
 2291     if (!strncmp(arg, 
"pal-", 4)) {
 
 2294     } 
else if (!strncmp(arg, 
"ntsc-", 5)) {
 
 2297     } 
else if (!strncmp(arg, 
"film-", 5)) {
 
 2314                     } 
else if ((fr == 29970) || (fr == 23976)) {
 
 2334     if (!strcmp(arg, 
"vcd")) {
 
 2361     } 
else if (!strcmp(arg, 
"svcd")) {
 
 2383     } 
else if (!strcmp(arg, 
"dvd")) {
 
 2405     } 
else if (!strncmp(arg, 
"dv", 2)) {
 
 2410         parse_option(o, 
"pix_fmt", !strncmp(arg, 
"dv50", 4) ? 
"yuv422p" :
 
 2411                           norm == 
PAL ? 
"yuv420p" : 
"yuv411p", 
options);
 
 2438     time_t today2 = time(
NULL);
 
 2439     struct tm *today = localtime(&today2);
 
 2441     snprintf(filename, 
sizeof(filename), 
"vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
 
 2488     char filename[1000], 
line[1000], tmp_line[1000];
 
 2489     const char *codec_name = 
NULL;
 
 2495     if (!(f = 
get_preset_file(filename, 
sizeof(filename), arg, *opt == 
'f', codec_name))) {
 
 2496         if(!strncmp(arg, 
"libx264-lossless", strlen(
"libx264-lossless"))){
 
 2503     while (fgets(line, 
sizeof(line), f)) {
 
 2504         char *key = tmp_line, *
value, *endptr;
 
 2506         if (strcspn(line, 
"#\n\r") == 0)
 
 2508         av_strlcpy(tmp_line, line, 
sizeof(tmp_line));
 
 2522                    filename, line, key, value);
 
 2545     if(!strcmp(opt, 
"ab")){
 
 2548     } 
else if(!strcmp(opt, 
"b")){
 
 2562     if(!strcmp(opt, 
"qscale")){
 
 2575     if(!strcmp(opt, 
"profile")){
 
 2622     char layout_str[32];
 
 2625     int ret, channels, ac_str_size;
 
 2633     snprintf(layout_str, 
sizeof(layout_str), 
"%"PRIu64, layout);
 
 2640     snprintf(layout_str, 
sizeof(layout_str), 
"%d", channels);
 
 2641     stream_str = strchr(opt, 
':');
 
 2642     ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
 
 2697     int show_advanced = 0, show_avoptions = 0;
 
 2700         if (!strcmp(opt, 
"long"))
 
 2702         else if (!strcmp(opt, 
"full"))
 
 2703             show_advanced = show_avoptions = 1;
 
 2710     printf(
"Getting help:\n" 
 2711            "    -h      -- print basic options\n" 
 2712            "    -h long -- print more options\n" 
 2713            "    -h full -- print all options (including all format and codec specific options, very long)\n" 
 2714            "    See man %s for detailed description of the options.\n" 
 2721                       "instead of just one file:",
 
 2749     if (show_avoptions) {
 
 2793                    "%s.\n", inout, g->
arg);
 
 2817     memset(&octx, 0, 
sizeof(octx));
 
 2862     if (!strcmp(arg, 
"-"))
 
 2874 #define OFFSET(x) offsetof(OptionsContext, x) 
 2880         "force format", 
"fmt" },
 
 2882         "overwrite output files" },
 
 2884         "never overwrite output files" },
 
 2886         "Ignore unknown stream types" },
 
 2888         "Copy unknown stream types" },
 
 2891         "codec name", 
"codec" },
 
 2894         "codec name", 
"codec" },
 
 2897         "preset name", 
"preset" },
 
 2900         "set input stream mapping",
 
 2901         "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
 
 2903         "map an audio channel from one stream to another", 
"file.stream.channel[:syncfile.syncstream]" },
 
 2906         "set metadata information of outfile from infile",
 
 2907         "outfile[,metadata]:infile[,metadata]" },
 
 2910         "set chapters mapping", 
"input_file_index" },
 
 2913         "record or transcode \"duration\" seconds of audio/video",
 
 2916         "record or transcode stop time", 
"time_stop" },
 
 2918         "set the limit file size in bytes", 
"limit_size" },
 
 2921         "set the start time offset", 
"time_off" },
 
 2924         "enable/disable seeking by timestamp with -ss" },
 
 2927         "enable/disable accurate seeking with -ss" },
 
 2930         "set the input ts offset", 
"time_off" },
 
 2933         "set the input ts scale", 
"scale" },
 
 2935         "set the recording timestamp ('now' to set the current time)", 
"time" },
 
 2937         "add metadata", 
"string=string" },
 
 2940         "set the number of data frames to output", 
"number" },
 
 2942         "add timings for benchmarking" },
 
 2944       "add timings for each task" },
 
 2946       "write program-readable progress information", 
"url" },
 
 2948       "enable or disable interaction on standard input" },
 
 2950         "set max runtime in seconds", 
"limit" },
 
 2952         "dump each input packet" },
 
 2954         "when dumping packets, also dump the payload" },
 
 2957         "read input at native frame rate", 
"" },
 
 2959         "specify target file type (\"vcd\", \"svcd\", \"dvd\"," 
 2960         " \"dv\", \"dv50\", \"pal-vcd\", \"ntsc-svcd\", ...)", 
"type" },
 
 2962         "video sync method", 
"" },
 
 2964         "frame drop threshold", 
"" },
 
 2966         "audio sync method", 
"" },
 
 2968         "audio drift threshold", 
"threshold" },
 
 2970         "copy timestamps" },
 
 2972         "shift input timestamps to start at 0 when using copyts" },
 
 2974         "copy input stream time base when stream copying", 
"mode" },
 
 2977         "finish encoding within shortest input" },
 
 2982         "timestamp discontinuity delta threshold", 
"threshold" },
 
 2984         "timestamp error delta threshold", 
"threshold" },
 
 2986         "exit on error", 
"error" },
 
 2989         "copy initial non-keyframes" },
 
 2991         "copy or discard frames before start time" },
 
 2993         "set the number of frames to output", 
"number" },
 
 2996         "force codec tag/fourcc", 
"fourcc/tag" },
 
 2999         "use fixed quality scale (VBR)", 
"q" },
 
 3002         "use fixed quality scale (VBR)", 
"q" },
 
 3004         "set profile", 
"profile" },
 
 3006         "set stream filtergraph", 
"filter_graph" },
 
 3008         "read stream filtergraph description from a file", 
"filename" },
 
 3010         "reinit filtergraph on input parameter changes", 
"" },
 
 3012         "create a complex filtergraph", 
"graph_description" },
 
 3014         "create a complex filtergraph", 
"graph_description" },
 
 3016         "read complex filtergraph description from a file", 
"filename" },
 
 3018         "print progress report during encoding", },
 
 3021         "add an attachment to the output file", 
"filename" },
 
 3024         "extract an attachment into a file", 
"filename" },
 
 3026         "print timestamp debugging info" },
 
 3028         "maximum error rate", 
"ratio of errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success." },
 
 3034         "disposition", 
"" },
 
 3036                                                                      { .off = 
OFFSET(thread_queue_size) },
 
 3037         "set the maximum number of queued packets from the demuxer" },
 
 3041         "set the number of video frames to output", 
"number" },
 
 3044         "set frame rate (Hz value, fraction or abbreviation)", 
"rate" },
 
 3047         "set frame size (WxH or abbreviation)", 
"size" },
 
 3050         "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", 
"aspect" },
 
 3053         "set pixel format", 
"format" },
 
 3055         "set the number of bits per raw sample", 
"number" },
 
 3057         "deprecated use -g 1" },
 
 3062         "rate control override for specific intervals", 
"override" },
 
 3065         "force video codec ('copy' to copy stream)", 
"codec" },
 
 3071         "set initial TimeCode value.", 
"hh:mm:ss[:;.]ff" },
 
 3073         "select the pass number (1 to 3)", 
"n" },
 
 3076         "select two pass log file name prefix", 
"prefix" },
 
 3078         "this option is deprecated, use the yadif filter instead" },
 
 3080         "calculate PSNR of compressed frames" },
 
 3082         "dump video coding statistics to file" },
 
 3084         "dump video coding statistics to file", 
"file" },
 
 3086         "set video filters", 
"filter_graph" },
 
 3089         "specify intra matrix coeffs", 
"matrix" },
 
 3092         "specify inter matrix coeffs", 
"matrix" },
 
 3095         "specify intra matrix coeffs", 
"matrix" },
 
 3098         "top=1/bottom=0/auto=-1 field first", 
"" },
 
 3101         "force video tag/fourcc", 
"fourcc/tag" },
 
 3103         "show QP histogram" },
 
 3106         "force the selected framerate, disable the best supported framerate selection" },
 
 3109         "set the value of an outfile streamid", 
"streamIndex:value" },
 
 3112         "force key frames at specified timestamps", 
"timestamps" },
 
 3114         "audio bitrate (please use -b:a)", 
"bitrate" },
 
 3116         "video bitrate (please use -b:v)", 
"bitrate" },
 
 3119         "use HW accelerated decoding", 
"hwaccel name" },
 
 3122         "select a device for HW acceleration" "devicename" },
 
 3128         "automatically insert correct rotate filters" },
 
 3132         "set the number of audio frames to output", 
"number" },
 
 3134         "set audio quality (codec-specific)", 
"quality", },
 
 3137         "set audio sampling rate (in Hz)", 
"rate" },
 
 3140         "set number of audio channels", 
"channels" },
 
 3145         "force audio codec ('copy' to copy stream)", 
"codec" },
 
 3148         "force audio tag/fourcc", 
"fourcc/tag" },
 
 3150         "change audio volume (256=normal)" , 
"volume" },
 
 3153         "set sample format", 
"format" },
 
 3156         "set channel layout", 
"layout" },
 
 3158         "set audio filters", 
"filter_graph" },
 
 3160       "set the maximum number of channels to try to guess the channel layout" },
 
 3164         "disable subtitle" },
 
 3166         "force subtitle codec ('copy' to copy stream)", 
"codec" },
 
 3168         , 
"force subtitle tag/fourcc", 
"fourcc/tag" },
 
 3170         "fix subtitles duration" },
 
 3172         "set canvas size (WxH or abbreviation)", 
"size" },
 
 3176         "deprecated, use -channel", 
"channel" },
 
 3178         "deprecated, use -standard", 
"standard" },
 
 3183         "set the maximum demux-decode delay", 
"seconds" },
 
 3185         "set the initial demux-decode delay", 
"seconds" },
 
 3187         "override the options from ffserver", 
"" },
 
 3189         "specify a file in which to print sdp information", 
"file" },
 
 3192         "A comma-separated list of bitstream filters", 
"bitstream_filters" },
 
 3194         "deprecated", 
"audio bitstream_filters" },
 
 3196         "deprecated", 
"video bitstream_filters" },
 
 3199         "set the audio options to the indicated preset", 
"preset" },
 
 3201         "set the video options to the indicated preset", 
"preset" },
 
 3203         "set the subtitle options to the indicated preset", 
"preset" },
 
 3205         "set options from indicated preset file", 
"filename" },
 
 3208         "force data codec ('copy' to copy stream)", 
"codec" },
 
unsigned int nb_chapters
Number of chapters in AVChapter array. 
int avio_open(AVIOContext **s, const char *url, int flags)
Create and initialize a AVIOContext for accessing the resource indicated by url. 
int parse_optgroup(void *optctx, OptionGroup *g)
Parse an options group and write results into optctx. 
int av_parse_ratio(AVRational *q, const char *str, int max, int log_offset, void *log_ctx)
Parse str and store the parsed ratio in q. 
int guess_input_channel_layout(InputStream *ist)
const char const char void * val
AVDictionary * resample_opts
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units 
int64_t avio_size(AVIOContext *s)
Get the filesize. 
static void choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost)
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *avctx, AVCodec *codec, enum AVPixelFormat target)
#define av_realloc_f(p, o, n)
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 int opt_data_frames(void *optctx, const char *opt, const char *arg)
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)
char * filters
filtergraph associated to the -filter option 
static AVInputFormat * file_iformat
#define CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode. 
#define AV_LOG_WARNING
Something somehow does not look correct. 
Main libavfilter public API header. 
int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header. 
static void assert_file_overwrite(const char *filename)
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries. 
#define CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode. 
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. 
void choose_sample_fmt(AVStream *st, AVCodec *codec)
void avfilter_inout_free(AVFilterInOut **inout)
Free the supplied list of AVFilterInOut and set *inout to NULL. 
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier. 
enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
Get the type of an AVFilterPad. 
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) 
#define AV_OPT_FLAG_AUDIO_PARAM
int index
stream index in AVFormatContext 
#define AVIO_FLAG_READ
read-only 
static int opt_audio_filters(void *optctx, const char *opt, const char *arg)
static OutputStream * new_unknown_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
#define AVIO_FLAG_WRITE
write-only 
static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const char *filename)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
#define AV_CODEC_PROP_TEXT_SUB
Subtitle codec is text based. 
AVBitStreamFilterContext * bitstream_filters
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx. 
static int opt_filter_complex(void *optctx, const char *opt, const char *arg)
static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
#define FF_ARRAY_ELEMS(a)
static int file_overwrite
static OutputStream * new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index)
const AVClass * sws_get_class(void)
Get the AVClass for swsContext. 
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format. 
static const char * audio_codec_name
enum AVCodecID subtitle_codec_id
Forced subtitle codec_id. 
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream. 
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext. 
AVDictionary * filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, AVCodec *codec)
Filter out options for given codec. 
int64_t start_time
start time in microseconds == AV_TIME_BASE units 
static int opt_preset(void *optctx, const char *opt, const char *arg)
SpecifierOpt * frame_pix_fmts
static int opt_data_codec(void *optctx, const char *opt, const char *arg)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout. 
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)
void uninit_parse_context(OptionParseContext *octx)
Free all allocated memory in an OptionParseContext. 
static int opt_audio_qscale(void *optctx, const char *opt, const char *arg)
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...
#define CODEC_FLAG_PSNR
error[?] variables will be set during encoding. 
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found. 
void av_codec_set_chroma_intra_matrix(AVCodecContext *avctx, uint16_t *val)
static const uint8_t frame_sizes[]
AVFilterPad * output_pads
array of output pads 
int vdpau_init(AVCodecContext *s)
static int ignore_unknown_streams
static int64_t start_time
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...
static int open_input_file(OptionsContext *o, const char *filename)
static const OptionGroupDef groups[]
static int opt_sdp_file(void *optctx, const char *opt, const char *arg)
#define CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe. 
static av_cold int end(AVCodecContext *avctx)
uint16_t * chroma_intra_matrix
custom intra quantization matrix Code outside libavcodec should access this field using av_codec_g/se...
int id
unique ID to identify the chapter 
static int opt_vsync(void *optctx, const char *opt, const char *arg)
int id
Format-specific stream ID. 
uint8_t * extradata
some codecs need / can use extradata like Huffman tables. 
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file. 
AVStream ** streams
A list of all streams in the file. 
static int opt_vstats(void *optctx, const char *opt, const char *arg)
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext. 
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key. 
int flags
Flags modifying the (de)muxer behaviour. 
AVDictionary * resample_opts
#define AV_LOG_VERBOSE
Detailed information. 
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext. 
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)
const OptionDef options[]
void av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another. 
struct AVBitStreamFilterContext * next
enum AVCodecID video_codec_id
Forced video codec_id. 
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding 
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf. 
static int opt_video_codec(void *optctx, const char *opt, const char *arg)
static int opt_qscale(void *optctx, const char *opt, const char *arg)
struct AVOutputFormat * oformat
The output container format. 
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. 
AVDictionary * format_opts
static OutputStream * new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers. 
void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)
Print detailed information about the input or output format, such as duration, bitrate, streams, container, programs, metadata, side data, codec and time base. 
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
AVCodecID
Identify the syntax and semantics of the bitstream. 
static int opt_profile(void *optctx, const char *opt, const char *arg)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered. 
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match. 
AVDictionary * metadata
Metadata that applies to the whole file. 
int has_b_frames
Size of the frame reordering buffer in the decoder. 
static int configure_complex_filters(void)
FilterGraph ** filtergraphs
const AVIOInterruptCB int_cb
static int open_files(OptionGroupList *l, const char *inout, int(*open_file)(OptionsContext *, const char *))
static int opt_subtitle_codec(void *optctx, const char *opt, const char *arg)
#define AV_OPT_FLAG_FILTERING_PARAM
a generic parameter which can be set by the user for filtering 
static int opt_video_channel(void *optctx, const char *opt, const char *arg)
static int opt_recording_timestamp(void *optctx, const char *opt, const char *arg)
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it. 
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers. 
AudioChannelMap * audio_channel_maps
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
static int opt_bitrate(void *optctx, const char *opt, const char *arg)
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option. 
static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec)
Parse a metadata specifier passed as 'arg' parameter. 
#define CODEC_FLAG_QSCALE
Use fixed qscale. 
simple assert() macros that are a bit more flexible than ISO C assert(). 
const char * name
Name of the codec implementation. 
static int opt_old2new(void *optctx, const char *opt, const char *arg)
void remove_avoptions(AVDictionary **a, AVDictionary *b)
static int opt_sameq(void *optctx, const char *opt, const char *arg)
HW acceleration through VDA, data[3] contains a CVPixelBufferRef. 
static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
static void uninit_options(OptionsContext *o)
Libavcodec external API header. 
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...
int av_codec_get_lowres(const AVCodecContext *avctx)
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
uint64_t channel_layout
Audio channel layout. 
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream. 
int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance)
Test if the given container can store a codec. 
int ffmpeg_parse_options(int argc, char **argv)
int props
Codec properties, a combination of AV_CODEC_PROP_* flags. 
AVRational frame_aspect_ratio
static AVDictionary * strip_specifiers(AVDictionary *dict)
char * av_asprintf(const char *fmt,...)
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. 
static const char * subtitle_codec_name
static int subtitle_disable
int nb_audio_channel_maps
unsigned int nb_streams
Number of elements in AVFormatContext.streams. 
AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format. 
static int opt_video_filters(void *optctx, const char *opt, const char *arg)
int rc_override_count
ratecontrol override, see RcOverride 
int void avio_flush(AVIOContext *s)
Force flushing of buffered data. 
audio channel layout utility functions 
char filename[1024]
input or output filename 
#define AV_TIME_BASE
Internal time base represented as integer. 
enum AVCodecID audio_codec_id
Forced audio codec_id. 
SpecifierOpt * audio_channels
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare. 
static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample. 
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values. 
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first. 
static int opt_progress(void *optctx, const char *opt, const char *arg)
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)
Create and initialize a bitstream filter context given a bitstream filter name. 
static int open_output_file(OptionsContext *o, const char *filename)
GLsizei GLboolean const GLfloat * value
SpecifierOpt * audio_sample_rate
int dxva2_init(AVCodecContext *s)
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
SpecifierOpt * dump_attachment
A list of option groups that all have the same group type (e.g. 
static AVCodec * find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
float frame_drop_threshold
SpecifierOpt * metadata_map
static int open_file(AVFormatContext *avf, unsigned fileno)
#define AV_DICT_APPEND
If the entry already exists, append to it. 
char * specifier
stream/chapter/program/... 
int audio_channels_mapped
Usually treated as AVMEDIA_TYPE_DATA. 
Opaque data information usually sparse. 
static void init_options(OptionsContext *o)
const AVClass * swr_get_class(void)
Get the AVClass for SwrContext. 
int opt_timelimit(void *optctx, const char *opt, const char *arg)
Limit the execution time. 
int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
Set all the options from a given dictionary on an object. 
SpecifierOpt * frame_sizes
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
AVFilterContext * filter_ctx
filter context associated to this input/output 
void exit_program(int ret)
Wraps exit with a program-specific cleanup routine. 
const AVClass * avfilter_get_class(void)
A linked-list of the inputs/outputs of the filter chain. 
int64_t end
chapter start/end time in time_base units 
int av_dict_parse_string(AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags)
Parse the key/value pairs list and add the parsed entries to a dictionary. 
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
SpecifierOpt * frame_rates
#define AV_LOG_INFO
Standard information. 
struct InputStream * sync_ist
enum AVMediaType codec_type
#define AV_TIME_BASE_Q
Internal time base represented as fractional value. 
char * av_strdup(const char *s)
Duplicate the string s. 
int sample_rate
samples per second 
AVIOContext * pb
I/O context. 
#define SET_DICT(type, meta, context, index)
static int override_ffserver
void avio_w8(AVIOContext *s, int b)
#define AV_OPT_FLAG_VIDEO_PARAM
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
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). 
a very simple circular buffer FIFO implementation 
#define AV_CODEC_PROP_BITMAP_SUB
Subtitle codec is bitmap based Decoded AVSubtitle data can be read from the AVSubtitleRect->pict fiel...
void assert_avoptions(AVDictionary *m)
float audio_drift_threshold
void show_help_default(const char *opt, const char *arg)
Per-fftool specific help handler. 
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry. 
struct AVBitStreamFilter * filter
uint16_t * intra_matrix
custom intra quantization matrix 
static int opt_map_channel(void *optctx, const char *opt, const char *arg)
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. 
#define VSYNC_PASSTHROUGH
Describe the class of an AVClass context structure. 
int configure_filtergraph(FilterGraph *fg)
OutputStream ** output_streams
int pad_idx
index of the filt_ctx pad to use for linking 
static int opt_filter_complex_script(void *optctx, const char *opt, const char *arg)
static char * get_ost_filters(OptionsContext *o, AVFormatContext *oc, OutputStream *ost)
rational number numerator/denominator 
int metadata_global_manual
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface. 
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding 
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration)
Parse a string specifying a time and return its corresponding value as a number of microseconds...
void * grow_array(void *array, int elem_size, int *size, int new_size)
Realloc array to hold new_size elements of elem_size. 
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error. 
static OutputStream * new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
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. 
int av_opt_eval_int(void *obj, const AVOption *o, const char *val, int *int_out)
char * filters_script
filtergraph script associated to the -filter_script option 
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
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 
static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Seek to timestamp ts. 
static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
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. 
static int opt_vstats_file(void *optctx, const char *opt, const char *arg)
char * name
unique name for this input/output in the list 
const char * avio_find_protocol_name(const char *url)
Return the name of the protocol that will handle the passed URL. 
static AVCodec * choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
int global_quality
Global quality for codecs which cannot change it per frame. 
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown. 
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name. 
static OutputStream * new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
static int opt_attach(void *optctx, const char *opt, const char *arg)
static void parse_matrix_coeffs(uint16_t *dest, const char *str)
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds. ...
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf. 
static int opt_video_frames(void *optctx, const char *opt, const char *arg)
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok()...
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only 
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str. 
float dts_error_threshold
int vda_init(AVCodecContext *s)
#define CODEC_FLAG_EMU_EDGE
static uint8_t * get_line(AVIOContext *s)
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...
static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)
struct FilterGraph * graph
static uint8_t * read_file(const char *filename)
static int opt_target(void *optctx, const char *opt, const char *arg)
AVDictionary * codec_opts
AVIOContext * progress_avio
AVDictionary * format_opts
static int opt_video_standard(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. 
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set that converts the value to a string and stores it...
int disposition
AV_DISPOSITION_* bit field. 
const char ** attachments
#define AV_OPT_SEARCH_FAKE_OBJ
The obj passed to av_opt_find() is fake – only a double pointer to AVClass instead of a required poin...
AVRational time_base
time base in which the start/end timestamps are specified 
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
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...
struct AVInputFormat * iformat
The input container format. 
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext. 
int frame_bits_per_raw_sample
#define GROW_ARRAY(array, nb_elems)
enum AVCodecID data_codec_id
Forced Data codec_id. 
int eof_reached
true if eof reached 
static int opt_timecode(void *optctx, const char *opt, const char *arg)
static void dump_attachment(AVStream *st, const char *filename)
int channels
number of audio channels 
static const struct PPFilter filters[]
SpecifierOpt * max_frames
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda 
static int opt_streamid(void *optctx, const char *opt, const char *arg)
void show_help_children(const AVClass *class, int flags)
Show help for all options with given flags in class and all its children. 
static void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc, const OutputStream *ost, enum AVMediaType type)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
AVDictionary * encoder_opts
static enum AVSampleFormat sample_fmts[]
AVDictionary * codec_opts
int64_t duration
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...
static const char * video_codec_name
float dts_delta_threshold
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string. 
static int input_stream_potentially_available
#define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)
OutputFile ** output_files
#define AV_LOG_FATAL
Something went wrong and recovery is not possible. 
static int opt_default_new(OptionsContext *o, const char *opt, const char *arg)
static int no_file_overwrite
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name. 
static int opt_map(void *optctx, const char *opt, const char *arg)
static int opt_audio_frames(void *optctx, const char *opt, const char *arg)
#define MKTAG(a, b, c, d)
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed. 
static OutputStream * new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
struct SwsContext * sws_opts
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
const char program_name[]
program name, defined by the program for show_version(). 
#define AV_NOPTS_VALUE
Undefined timestamp value. 
InputStream ** input_streams
static int copy_unknown_streams
static OutputStream * new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index)