45 #define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" 47 #define SPECIFIER_OPT_FMT_str "%s" 48 #define SPECIFIER_OPT_FMT_i "%i" 49 #define SPECIFIER_OPT_FMT_i64 "%"PRId64 50 #define SPECIFIER_OPT_FMT_ui64 "%"PRIu64 51 #define SPECIFIER_OPT_FMT_f "%f" 52 #define SPECIFIER_OPT_FMT_dbl "%lf" 96 #define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\ 98 char namestr[128] = "";\ 99 const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\ 100 for (i = 0; opt_name_##name[i]; i++)\ 101 av_strlcatf(namestr, sizeof(namestr), "-%s%s", opt_name_##name[i], opt_name_##name[i+1] ? (opt_name_##name[i+2] ? ", " : " or ") : "");\ 102 av_log(NULL, AV_LOG_WARNING, "Multiple %s options specified for stream %d, only the last option '-%s%s%s "SPECIFIER_OPT_FMT_##type"' will be used.\n",\ 103 namestr, st->index, opt_name_##name[0], spec[0] ? ":" : "", spec, so->u.type);\ 106 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\ 108 int i, ret, matches = 0;\ 110 for (i = 0; i < o->nb_ ## name; i++) {\ 111 char *spec = o->name[i].specifier;\ 112 if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\ 113 outvar = o->name[i].u.type;\ 120 WARN_MULTIPLE_OPT_USAGE(name, type, so, st);\ 123 #define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\ 126 for (i = 0; i < o->nb_ ## name; i++) {\ 127 char *spec = o->name[i].specifier;\ 128 if (!strcmp(spec, mediatype))\ 129 outvar = o->name[i].u.type;\ 134 #if CONFIG_VIDEOTOOLBOX 197 int i, *count = (
int*)(so + 1);
198 for (i = 0; i < *count; i++) {
220 memset(o, 0,
sizeof(*o));
236 printf(
"Hardware acceleration methods:\n");
251 char *p = strchr(e->
key,
':');
276 const AVClass *pclass = &
class;
284 "If you are looking for an option to preserve the quality (which is not " 285 "what -%s was for), use -qscale 0 or an equivalent quality factor option.\n",
326 static int opt_map(
void *optctx,
const char *opt,
const char *
arg)
330 int i, negative = 0, file_idx, disabled = 0;
331 int sync_file_idx = -1, sync_stream_idx = 0;
345 if (sync = strchr(map,
',')) {
347 sync_file_idx = strtol(sync + 1, &sync, 0);
362 "match any streams.\n", arg);
375 const char *
c = map + 1;
384 if (allow_unused = strchr(map,
'?'))
386 file_idx = strtol(map, &p, 0);
398 *p ==
':' ? p + 1 : p) > 0)
404 *p ==
':' ? p + 1 : p) <= 0)
416 if (sync_file_idx >= 0) {
429 }
else if (disabled) {
431 "To ignore this, add a trailing '?' to the map.\n", arg);
435 "To ignore this, add a trailing '?' to the map.\n", arg);
478 n = sscanf(arg,
"%d.%d.%d:%d.%d",
482 if (n != 3 && n != 5) {
484 "[file.stream.channel|-1][:syncfile:syncstream]\n");
510 if (allow_unused = strchr(mapchan,
'?'))
519 "To ignore this, add a trailing '?' to the map_channel.\n",
537 static int opt_vaapi_device(
void *optctx,
const char *opt,
const char *
arg)
539 const char *prefix =
"vaapi:";
553 if (!strcmp(arg,
"list")) {
555 printf(
"Supported hardware device types:\n");
568 if (filter_hw_device) {
573 if (!filter_hw_device) {
595 if (*(++arg) && *arg !=
':') {
599 *stream_spec = *arg ==
':' ? arg + 1 :
"";
604 *index = strtol(++arg,
NULL, 0);
619 char type_in, type_out;
620 const char *istream_spec =
NULL, *ostream_spec =
NULL;
621 int idx_in = 0, idx_out = 0;
627 if (type_out ==
'g' || !*outspec)
629 if (type_out ==
's' || !*outspec)
631 if (type_out ==
'c' || !*outspec)
636 if (type_in ==
'g' || type_out ==
'g')
638 if (type_in ==
's' || type_out ==
's')
640 if (type_in ==
'c' || type_out ==
'c')
647 #define METADATA_CHECK_INDEX(index, nb_elems, desc)\ 648 if ((index) < 0 || (index) >= (nb_elems)) {\ 649 av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\ 654 #define SET_DICT(type, meta, context, index)\ 657 meta = &context->metadata;\ 660 METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\ 661 meta = &context->chapters[index]->metadata;\ 664 METADATA_CHECK_INDEX(index, context->nb_programs, "program")\ 665 meta = &context->programs[index]->metadata;\ 669 default: av_assert0(0);\ 672 SET_DICT(type_in, meta_in, ic, idx_in);
673 SET_DICT(type_out, meta_out, oc, idx_out);
676 if (type_in ==
's') {
690 if (type_out ==
's') {
709 struct tm time = *gmtime((time_t*)&recording_timestamp);
710 if (!strftime(buf,
sizeof(buf),
"creation_time=%Y-%m-%dT%H:%M:%S%z", &time))
715 "tag instead.\n", opt);
722 const char *
codec_string = encoder ?
"encoder" :
"decoder";
734 codec_string, codec->
name, desc->
name);
741 if (codec->
type != type) {
750 char *codec_name =
NULL;
772 const char *hwaccel =
NULL;
773 char *hwaccel_output_format =
NULL;
774 char *codec_tag =
NULL;
776 char *discard_str =
NULL;
802 uint32_t
tag = strtol(codec_tag, &next, 0);
851 if (st->codec->lowres) {
876 hwaccel_output_format, ic, st);
878 if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel,
"cuvid")) {
880 "WARNING: defaulting hwaccel_output_format to cuda for compatibility " 881 "with old commandlines. This behaviour is DEPRECATED and will be removed " 882 "in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n");
884 }
else if (hwaccel_output_format) {
888 "format: %s", hwaccel_output_format);
896 if (!strcmp(hwaccel,
"nvdec") || !strcmp(hwaccel,
"cuvid"))
899 if (!strcmp(hwaccel,
"none"))
901 else if (!strcmp(hwaccel,
"auto"))
906 for (i = 0; hwaccels[
i].
name; i++) {
907 if (!strcmp(hwaccels[i].
name, hwaccel)) {
937 if (hwaccel_device) {
953 char *canvas_size =
NULL;
985 fprintf(stderr,
"Error, both -y and -n supplied. Exiting.\n");
990 if (proto_name && !strcmp(proto_name,
"file") &&
avio_check(filename, 0) == 0) {
992 fprintf(stderr,
"File '%s' already exists. Overwrite? [y/N] ", filename);
995 signal(SIGINT, SIG_DFL);
1009 if (proto_name && !strcmp(proto_name,
"file")) {
1014 if (!strcmp(filename, file->
ctx->
url)) {
1035 filename = e->
value;
1067 char * data_codec_name =
NULL;
1068 int scan_all_pmts_set = 0;
1092 if (!strcmp(filename,
"-"))
1096 strcmp(filename,
"/dev/stdin");
1111 if (file_iformat && file_iformat->
priv_class &&
1120 if (file_iformat && file_iformat->
priv_class &&
1138 if (video_codec_name)
1140 if (audio_codec_name)
1142 if (subtitle_codec_name)
1144 if (data_codec_name)
1159 scan_all_pmts_set = 1;
1169 if (scan_all_pmts_set)
1186 for (i = 0; i < orig_nb_streams; i++)
1225 int64_t seek_timestamp = timestamp;
1228 int dts_heuristic = 0;
1236 if (dts_heuristic) {
1292 if (!option || foption)
1298 "input file #%d (%s) is not a decoding option.\n", e->
key,
1305 "input file #%d (%s) has not been used for any stream. The most " 1306 "likely reason is either wrong type (e.g. a video option with " 1307 "no video streams) or that it is a private option of some decoder " 1308 "which was not actually used for any stream.\n", e->
key,
1340 while ((c =
avio_r8(s)) && c !=
'\n')
1351 char filename[1000];
1352 const char *
base[3] = { getenv(
"AVCONV_DATADIR"),
1361 snprintf(filename,
sizeof(filename),
"%s%s/%s-%s.avpreset", base[i],
1362 i != 1 ?
"" :
"/.avconv", codec_name, preset_name);
1366 snprintf(filename,
sizeof(filename),
"%s%s/%s.avpreset", base[i],
1367 i != 1 ?
"" :
"/.avconv", preset_name);
1377 char *codec_name =
NULL;
1387 "output stream #%d:%d. Default encoder for format %s (codec %s) is " 1388 "probably disabled. Please choose an encoder manually.\n",
1393 }
else if (!strcmp(codec_name,
"copy"))
1414 const char *bsfs =
NULL, *time_base =
NULL;
1415 char *next, *codec_tag =
NULL;
1468 if (!buf[0] || buf[0] ==
'#') {
1472 if (!(arg = strchr(buf,
'='))) {
1484 "Preset %s specified for stream %d:%d, but could not be opened.\n",
1500 q.
num <= 0 || q.
den <= 0) {
1532 if (bsfs && *bsfs) {
1542 uint32_t
tag = strtol(codec_tag, &next, 0);
1574 if (source_index >= 0) {
1591 const char *p =
str;
1623 while ((ret =
avio_read(pb, buf,
sizeof(buf))) > 0)
1659 "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n" 1660 "Filtering and streamcopy cannot be used together.\n",
1661 ost->
filters ?
"Filtergraph" :
"Filtergraph script",
1673 char *frame_rate =
NULL, *frame_aspect_ratio =
NULL;
1688 if (frame_aspect_ratio) {
1691 q.
num <= 0 || q.
den <= 0) {
1702 const char *p =
NULL;
1704 char *frame_pix_fmt =
NULL;
1705 char *intra_matrix =
NULL, *inter_matrix =
NULL;
1706 char *chroma_intra_matrix =
NULL;
1718 if (frame_pix_fmt && *frame_pix_fmt ==
'+') {
1720 if (!*++frame_pix_fmt)
1721 frame_pix_fmt =
NULL;
1740 if (chroma_intra_matrix) {
1759 for (i = 0; p; i++) {
1761 int e = sscanf(p,
"%d,%d,%d", &start, &end, &q);
1810 char logfilename[1024];
1813 snprintf(logfilename,
sizeof(logfilename),
"%s-%d.log",
1817 if (!strcmp(ost->
enc->name,
"libx264")) {
1821 char *logbuffer =
read_file(logfilename);
1834 "Cannot write log file '%s' for pass-1 encoding: %s\n",
1835 logfilename, strerror(errno));
1883 char *sample_fmt =
NULL;
2009 p = strchr(idx_str,
':');
2012 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
2044 if (in_ch->
end < ts_off)
2046 if (rt != INT64_MAX && in_ch->
start > rt + ts_off)
2053 out_ch->id = in_ch->
id;
2055 out_ch->start =
FFMAX(0, in_ch->
start - ts_off);
2056 out_ch->end =
FFMIN(rt, in_ch->
end - ts_off);
2071 switch (ofilter->
type) {
2088 "which is fed from a complex filtergraph. Filtering and streamcopy " 2094 const char *opt = ost->
filters ?
"-vf/-af/-filter" :
"-filter_script";
2096 "%s '%s' was specified through the %s option " 2097 "for output stream %d:%d, which is fed from a complex filtergraph.\n" 2098 "%s and -filter_complex cannot be used together for the same stream.\n",
2099 ost->
filters ?
"Filtergraph" :
"Filtergraph script",
2129 int format_flags = 0;
2159 if (!strcmp(filename,
"-"))
2193 switch (ofilter->
type) {
2208 int area = 0, idx = -1;
2233 int best_score = 0, idx = -1;
2242 score > best_score) {
2261 int input_props = 0, output_props = 0;
2266 if (input_descriptor)
2268 if (output_descriptor)
2270 if (subtitle_codec_name ||
2271 input_props & output_props ||
2273 input_descriptor && output_descriptor &&
2274 (!input_descriptor->
props ||
2275 !output_descriptor->
props)) {
2317 "in any defined filter graph, or was already used elsewhere.\n", map->
linklabel);
2353 "Cannot map stream #%d:%d - unsupported type.\n",
2357 "If you want unsupported types ignored instead " 2358 "of failing, please use the -ignore_unknown option\n" 2359 "If you want them copied, please use -copy_unknown\n");
2407 #if FF_API_LAVF_AVCTX 2443 if (!option || foption)
2449 "output file #%d (%s) is not an encoding option.\n", e->
key,
2456 if (!strcmp(e->
key,
"gop_timecode"))
2460 "output file #%d (%s) has not been used for any stream. The most " 2461 "likely reason is either wrong type (e.g. a video option with " 2462 "no video streams) or that it is a private option of some encoder " 2463 "which was not actually used for any stream.\n", e->
key,
2481 "Error initializing a simple filtergraph between streams " 2500 }
else if (ost->
enc->pix_fmts) {
2513 }
else if (ost->
enc->sample_fmts) {
2524 }
else if (ost->
enc->supported_samplerates) {
2526 while (ost->
enc->supported_samplerates[count])
2536 }
else if (ost->
enc->channel_layouts) {
2538 while (ost->
enc->channel_layouts[count])
2561 "No input streams but output needs an input stream\n");
2590 av_log(
NULL,
AV_LOG_FATAL,
"Invalid input file index %d while processing metadata maps\n", in_file_index);
2594 in_file_index >= 0 ?
2633 if (!output_streams[i]->stream_copy) {
2646 const char *to_dealloc = p2;
2661 if (!strcmp(key,
"program_num"))
2662 progid = strtol(p2,
NULL, 0);
2672 const char *to_dealloc = p2;
2681 "No '=' character in program string %s.\n",
2689 if (!strcmp(key,
"title")) {
2691 }
else if (!strcmp(key,
"program_num")) {
2692 }
else if (!strcmp(key,
"st")) {
2693 int st_num = strtol(p2,
NULL, 0);
2708 const char *stream_spec;
2709 int index = 0, j, ret = 0;
2772 static const char *
const frame_rates[] = {
"25",
"30000/1001",
"24000/1001" };
2774 if (!strncmp(arg,
"pal-", 4)) {
2777 }
else if (!strncmp(arg,
"ntsc-", 5)) {
2780 }
else if (!strncmp(arg,
"film-", 5)) {
2797 }
else if ((fr == 29970) || (fr == 23976)) {
2817 if (!strcmp(arg,
"vcd")) {
2844 }
else if (!strcmp(arg,
"svcd")) {
2866 }
else if (!strcmp(arg,
"dvd")) {
2888 }
else if (!strncmp(arg,
"dv", 2)) {
2893 parse_option(o,
"pix_fmt", !strncmp(arg,
"dv50", 4) ?
"yuv422p" :
2894 norm ==
PAL ?
"yuv420p" :
"yuv411p",
options);
2921 time_t today2 = time(
NULL);
2922 struct tm *today = localtime(&today2);
2929 snprintf(filename,
sizeof(filename),
"vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
2976 char filename[1000],
line[1000], tmp_line[1000];
2977 const char *codec_name =
NULL;
2983 if (!(f =
get_preset_file(filename,
sizeof(filename), arg, *opt ==
'f', codec_name))) {
2984 if(!strncmp(arg,
"libx264-lossless", strlen(
"libx264-lossless"))){
2991 while (fgets(line,
sizeof(line), f)) {
2992 char *
key = tmp_line, *
value, *endptr;
2994 if (strcspn(line,
"#\n\r") == 0)
2996 av_strlcpy(tmp_line, line,
sizeof(tmp_line));
3010 filename, line, key, value);
3036 if(!strcmp(opt,
"ab")){
3039 }
else if(!strcmp(opt,
"b")){
3053 if(!strcmp(opt,
"qscale")){
3068 if(!strcmp(opt,
"profile")){
3118 char layout_str[32];
3129 snprintf(layout_str,
sizeof(layout_str),
"%"PRIu64, layout);
3136 snprintf(layout_str,
sizeof(layout_str),
"%d", channels);
3137 stream_str = strchr(opt,
':');
3138 ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
3193 int show_advanced = 0, show_avoptions = 0;
3196 if (!strcmp(opt,
"long"))
3198 else if (!strcmp(opt,
"full"))
3199 show_advanced = show_avoptions = 1;
3206 printf(
"Getting help:\n" 3207 " -h -- print basic options\n" 3208 " -h long -- print more options\n" 3209 " -h full -- print all options (including all format and codec specific options, very long)\n" 3210 " -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol\n" 3211 " See man %s for detailed description of the options.\n" 3218 "instead of just one file):",
3246 if (show_avoptions) {
3253 #if CONFIG_SWRESAMPLE 3293 "%s.\n", inout, g->
arg);
3318 memset(&octx, 0,
sizeof(octx));
3375 if (!strcmp(arg,
"-"))
3387 #define OFFSET(x) offsetof(OptionsContext, x) 3393 "force format",
"fmt" },
3395 "overwrite output files" },
3397 "never overwrite output files" },
3399 "Ignore unknown stream types" },
3401 "Copy unknown stream types" },
3404 "codec name",
"codec" },
3407 "codec name",
"codec" },
3410 "preset name",
"preset" },
3413 "set input stream mapping",
3414 "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
3416 "map an audio channel from one stream to another",
"file.stream.channel[:syncfile.syncstream]" },
3419 "set metadata information of outfile from infile",
3420 "outfile[,metadata]:infile[,metadata]" },
3423 "set chapters mapping",
"input_file_index" },
3426 "record or transcode \"duration\" seconds of audio/video",
3429 "record or transcode stop time",
"time_stop" },
3431 "set the limit file size in bytes",
"limit_size" },
3434 "set the start time offset",
"time_off" },
3437 "set the start time offset relative to EOF",
"time_off" },
3440 "enable/disable seeking by timestamp with -ss" },
3443 "enable/disable accurate seeking with -ss" },
3446 "set the input ts offset",
"time_off" },
3449 "set the input ts scale",
"scale" },
3451 "set the recording timestamp ('now' to set the current time)",
"time" },
3453 "add metadata",
"string=string" },
3455 "add program with specified streams",
"title=string:st=number..." },
3458 "set the number of data frames to output",
"number" },
3460 "add timings for benchmarking" },
3462 "add timings for each task" },
3464 "write program-readable progress information",
"url" },
3466 "enable or disable interaction on standard input" },
3468 "set max runtime in seconds in CPU user time",
"limit" },
3470 "dump each input packet" },
3472 "when dumping packets, also dump the payload" },
3475 "read input at native frame rate",
"" },
3477 "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" " 3478 "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")",
"type" },
3480 "video sync method",
"" },
3482 "frame drop threshold",
"" },
3484 "audio sync method",
"" },
3486 "audio drift threshold",
"threshold" },
3488 "copy timestamps" },
3490 "shift input timestamps to start at 0 when using copyts" },
3492 "copy input stream time base when stream copying",
"mode" },
3495 "finish encoding within shortest input" },
3503 "timestamp discontinuity delta threshold",
"threshold" },
3505 "timestamp error delta threshold",
"threshold" },
3507 "exit on error",
"error" },
3509 "abort on the specified condition flags",
"flags" },
3512 "copy initial non-keyframes" },
3514 "copy or discard frames before start time" },
3516 "set the number of frames to output",
"number" },
3519 "force codec tag/fourcc",
"fourcc/tag" },
3522 "use fixed quality scale (VBR)",
"q" },
3525 "use fixed quality scale (VBR)",
"q" },
3527 "set profile",
"profile" },
3529 "set stream filtergraph",
"filter_graph" },
3531 "number of non-complex filter threads" },
3533 "read stream filtergraph description from a file",
"filename" },
3535 "reinit filtergraph on input parameter changes",
"" },
3537 "create a complex filtergraph",
"graph_description" },
3539 "number of threads for -filter_complex" },
3541 "create a complex filtergraph",
"graph_description" },
3543 "read complex filtergraph description from a file",
"filename" },
3545 "print progress report during encoding", },
3548 "add an attachment to the output file",
"filename" },
3551 "extract an attachment into a file",
"filename" },
3553 OPT_OFFSET, { .off =
OFFSET(
loop) },
"set number of times input stream shall be looped",
"loop count" },
3555 "print timestamp debugging info" },
3557 "ratio of errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.",
"maximum error rate" },
3563 "disposition",
"" },
3565 { .off =
OFFSET(thread_queue_size) },
3566 "set the maximum number of queued packets from the demuxer" },
3568 "read and decode the streams to fill missing information with heuristics" },
3572 "set the number of video frames to output",
"number" },
3575 "set frame rate (Hz value, fraction or abbreviation)",
"rate" },
3578 "set frame size (WxH or abbreviation)",
"size" },
3581 "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)",
"aspect" },
3584 "set pixel format",
"format" },
3586 "set the number of bits per raw sample",
"number" },
3588 "deprecated use -g 1" },
3593 "rate control override for specific intervals",
"override" },
3596 "force video codec ('copy' to copy stream)",
"codec" },
3602 "set initial TimeCode value.",
"hh:mm:ss[:;.]ff" },
3604 "select the pass number (1 to 3)",
"n" },
3607 "select two pass log file name prefix",
"prefix" },
3609 "this option is deprecated, use the yadif filter instead" },
3611 "calculate PSNR of compressed frames" },
3613 "dump video coding statistics to file" },
3615 "dump video coding statistics to file",
"file" },
3617 "Version of the vstats format to use."},
3619 "set video filters",
"filter_graph" },
3622 "specify intra matrix coeffs",
"matrix" },
3625 "specify inter matrix coeffs",
"matrix" },
3628 "specify intra matrix coeffs",
"matrix" },
3631 "top=1/bottom=0/auto=-1 field first",
"" },
3634 "force video tag/fourcc",
"fourcc/tag" },
3636 "show QP histogram" },
3639 "force the selected framerate, disable the best supported framerate selection" },
3642 "set the value of an outfile streamid",
"streamIndex:value" },
3645 "force key frames at specified timestamps",
"timestamps" },
3647 "audio bitrate (please use -b:a)",
"bitrate" },
3649 "video bitrate (please use -b:v)",
"bitrate" },
3652 "use HW accelerated decoding",
"hwaccel name" },
3655 "select a device for HW acceleration",
"devicename" },
3658 "select output format used with HW accelerated decoding",
"format" },
3659 #if CONFIG_VIDEOTOOLBOX 3663 "show available HW acceleration methods" },
3666 "automatically insert correct rotate filters" },
3670 "set the number of audio frames to output",
"number" },
3672 "set audio quality (codec-specific)",
"quality", },
3675 "set audio sampling rate (in Hz)",
"rate" },
3678 "set number of audio channels",
"channels" },
3683 "force audio codec ('copy' to copy stream)",
"codec" },
3686 "force audio tag/fourcc",
"fourcc/tag" },
3688 "change audio volume (256=normal)" ,
"volume" },
3691 "set sample format",
"format" },
3694 "set channel layout",
"layout" },
3696 "set audio filters",
"filter_graph" },
3698 "set the maximum number of channels to try to guess the channel layout" },
3702 "disable subtitle" },
3704 "force subtitle codec ('copy' to copy stream)",
"codec" },
3706 ,
"force subtitle tag/fourcc",
"fourcc/tag" },
3708 "fix subtitles duration" },
3710 "set canvas size (WxH or abbreviation)",
"size" },
3714 "deprecated, use -channel",
"channel" },
3716 "deprecated, use -standard",
"standard" },
3721 "set the maximum demux-decode delay",
"seconds" },
3723 "set the initial demux-decode delay",
"seconds" },
3725 "specify a file in which to print sdp information",
"file" },
3728 "set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5)",
"ratio" },
3730 "set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). " 3731 "two special values are defined - " 3732 "0 = use frame rate (video) or sample rate (audio)," 3733 "-1 = match source time base",
"ratio" },
3736 "A comma-separated list of bitstream filters",
"bitstream_filters" },
3738 "deprecated",
"audio bitstream_filters" },
3740 "deprecated",
"video bitstream_filters" },
3743 "set the audio options to the indicated preset",
"preset" },
3745 "set the video options to the indicated preset",
"preset" },
3747 "set the subtitle options to the indicated preset",
"preset" },
3749 "set options from indicated preset file",
"filename" },
3752 "maximum number of packets that can be buffered while waiting for all streams to initialize",
"packets" },
3756 "force data codec ('copy' to copy stream)",
"codec" },
3762 "set VAAPI hardware device (DRM path or X11 display name)",
"device" },
3767 "set QSV hardware device (DirectX adapter index, DRM path or X11 display name)",
"device"},
3771 "initialise hardware device",
"args" },
3773 "set hardware device used when filtering",
"device" },
unsigned int nb_chapters
Number of chapters in AVChapter array.
#define AVERROR_ENCODER_NOT_FOUND
Encoder not found.
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)
AVDictionary * resample_opts
static int opt_filter_hw_device(void *optctx, const char *opt, const char *arg)
static const char * opt_name_frame_sizes[]
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
static const char * opt_name_copy_initial_nonkeyframes[]
int64_t avio_size(AVIOContext *s)
Get the filesize.
static const char * format[]
static const char * opt_name_apad[]
#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.
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.
static const char * opt_name_passlogfiles[]
static const char * opt_name_frame_rates[]
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
int coded_width
Bitstream width / height, may be different from width/height e.g.
int64_t forced_kf_ref_pts
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
Main libavfilter public API header.
static void assert_file_overwrite(const char *filename)
static const char * opt_name_bitstream_filters[]
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries.
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
Look up an AVHWDeviceType by name.
hardware decoding through Videotoolbox
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 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.
FILE * av_fopen_utf8(const char *path, const char *mode)
Open a file using a UTF-8 filename.
static const char * opt_name_top_field_first[]
static const char * opt_name_force_fps[]
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
#define AV_OPT_FLAG_AUDIO_PARAM
int index
stream index in AVFormatContext
int max_muxing_queue_size
#define AVIO_FLAG_READ
read-only
const char * av_default_item_name(void *ptr)
Return the context name.
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
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.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Convenience header that includes libavutil's core.
static int opt_filter_complex(void *optctx, const char *opt, const char *arg)
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
static const char * opt_name_discard[]
static int file_overwrite
static OutputStream * new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index)
static const char * opt_name_enc_time_bases[]
static int find_stream_info
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 * opt_name_max_frames[]
static void error(const char *err)
static const char * audio_codec_name
static int choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost)
enum AVCodecID subtitle_codec_id
Forced subtitle codec_id.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
#define CMDUTILS_COMMON_OPTIONS
AVDictionary * filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, AVCodec *codec)
Filter out options for given codec.
This struct describes the properties of an encoded stream.
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)
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.
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
static const char * opt_name_ts_scale[]
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...
uint64_t av_get_channel_layout(const char *name)
Return a channel layout id that matches name, or 0 if no match is found.
static const char * opt_name_canvas_sizes[]
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static const uint8_t frame_sizes[]
static int ignore_unknown_streams
static int64_t start_time
static const char * opt_name_audio_sample_rate[]
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 const char * opt_name_max_muxing_queue_size[]
static const char * opt_name_rc_overrides[]
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)
static av_cold int end(AVCodecContext *avctx)
uint16_t * chroma_intra_matrix
custom intra quantization matrix
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.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define u(width, name, range_min, range_max)
AVStream ** streams
A list of all streams in the file.
static int opt_vstats(void *optctx, const char *opt, const char *arg)
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
#define AVERROR_PROTOCOL_NOT_FOUND
Protocol not found.
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.
static const char * opt_name_chroma_intra_matrices[]
AVProgram * av_new_program(AVFormatContext *s, int id)
AVDictionary * resample_opts
#define AV_LOG_VERBOSE
Detailed information.
int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
static const char * opt_name_filter_scripts[]
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
int init_complex_filtergraph(FilterGraph *fg)
static const char * opt_name_forced_key_frames[]
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.
static const char * opt_name_codec_names[]
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
const OptionDef options[]
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array.
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)
AVDictionary ** setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts)
Setup AVCodecContext options for avformat_find_stream_info().
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 filter_complex_nbthreads
#define i(width, name, range_min, range_max)
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.
void check_filter_outputs(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)
int av_opt_eval_flags(void *obj, const AVOption *o, const char *val, int *flags_out)
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.
ff_const59 struct AVInputFormat * iformat
The input container format.
char * url
input or output URL.
int video_delay
Video only.
#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. ...
enum AVMediaType codec_type
General type of the encoded data.
int flags
AV_CODEC_FLAG_*.
ff_const59 AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
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.
simple assert() macros that are a bit more flexible than ISO C assert().
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
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)
static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
AVRational avg_frame_rate
Average framerate.
New fields can be added to the end with minor version bumps.
static void uninit_options(OptionsContext *o)
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...
AVCodec * audio_codec
Forced audio codec.
int extradata_size
Size of the extradata content in bytes.
static const char * opt_name_guess_layout_max[]
int avio_r8(AVIOContext *s)
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array through a pointer to a pointer.
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)
static int opt_abort_on(void *optctx, const char *opt, const char *arg)
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.
static int opt_video_filters(void *optctx, const char *opt, const char *arg)
int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst)
Parse string describing list of bitstream filters and create single AVBSFContext describing the whole...
int rc_override_count
ratecontrol override, see RcOverride
audio channel layout utility functions
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
#define AV_CODEC_FLAG_QSCALE
Use fixed qscale.
#define AV_TIME_BASE
Internal time base represented as integer.
void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx)
enum AVCodecID audio_codec_id
Forced audio codec_id.
SpecifierOpt * audio_channels
uint64_t * channel_layouts
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
struct OutputStream * ost
int width
picture width / height.
static int open_output_file(OptionsContext *o, const char *filename)
static const char * opt_name_time_bases[]
SpecifierOpt * audio_sample_rate
enum AVCodecID av_guess_codec(ff_const59 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.
static const char * opt_name_disposition[]
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_CODEC_FLAG_PSNR
error[?] variables will be set during encoding.
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.
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)
static const char * opt_name_copy_prior_start[]
int qsv_init(AVCodecContext *s)
float frame_drop_threshold
SpecifierOpt * metadata_map
static int open_file(AVFormatContext *avf, unsigned fileno)
#define AV_OPT_FLAG_BSF_PARAM
a generic parameter which can be set by the user for bit stream filtering
#define AV_DICT_APPEND
If the entry already exists, append to it.
char * specifier
stream/chapter/program/...
int audio_channels_mapped
const AVClass * av_bsf_get_class(void)
Get the AVClass for AVBSFContext.
Usually treated as AVMEDIA_TYPE_DATA.
static const char * opt_name_frame_pix_fmts[]
Opaque data information usually sparse.
static void init_options(OptionsContext *o)
static const char * opt_name_presets[]
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.
SpecifierOpt * frame_sizes
#define is(width, name, range_min, range_max, subs,...)
HW acceleration through CUDA.
HWDevice * filter_hw_device
#define FF_ARRAY_ELEMS(a)
static const char * opt_name_autorotate[]
void exit_program(int ret)
Wraps exit with a program-specific cleanup routine.
ff_const59 struct AVOutputFormat * oformat
The output container format.
HWDevice * hw_device_get_by_name(const char *name)
const AVClass * avfilter_get_class(void)
A linked-list of the inputs/outputs of the filter chain.
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
int64_t end
chapter start/end time in time_base units
SpecifierOpt * frame_rates
static const char * opt_name_hwaccel_devices[]
#define AV_LOG_INFO
Standard information.
struct InputStream * sync_ist
char * av_strdup(const char *s)
Duplicate a string.
Libavcodec external API header.
enum AVMediaType codec_type
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
int sample_rate
samples per second
AVIOContext * pb
I/O context.
AVFifoBuffer * muxing_queue
#define SET_DICT(type, meta, context, index)
static const char * opt_name_hwaccels[]
void avio_w8(AVIOContext *s, int b)
#define AV_OPT_FLAG_VIDEO_PARAM
main external API structure.
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
static const char * opt_name_pass[]
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
#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.
uint16_t * intra_matrix
custom intra quantization matrix Must be allocated with the av_malloc() family of functions...
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.
OutputStream ** output_streams
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
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 (pair of numerator and denominator).
int metadata_global_manual
#define ABORT_ON_FLAG_EMPTY_OUTPUT
double rotate_override_value
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
static const char * opt_name_qscale[]
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.
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
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 VDPAUPixFmtMap * map
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
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
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 Must be allocated with the av_malloc() family of functions...
static const char * opt_name_hwaccel_output_formats[]
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 int init_complex_filters(void)
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.
static const char * opt_name_audio_channels[]
#define flags(name, subs,...)
static OutputStream * new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
static const char * opt_name_frame_aspect_ratios[]
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. ...
static int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
static const char * opt_name_filters[]
#define AV_CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
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
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
float dts_error_threshold
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)
static uint8_t * read_file(const char *filename)
static int opt_target(void *optctx, const char *opt, const char *arg)
AVDictionary * codec_opts
static const char * opt_name_fix_sub_duration[]
AVIOContext * progress_avio
AVDictionary * format_opts
static int opt_video_standard(void *optctx, const char *opt, const char *arg)
AVCodecParameters * ref_par
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
AVCodec * video_codec
Forced video codec.
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 poi...
AVRational time_base
time base in which the start/end timestamps are specified
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
static const char * opt_name_inter_matrices[]
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
#define AV_CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode.
int frame_bits_per_raw_sample
enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev)
Iterate over supported device types.
#define GROW_ARRAY(array, nb_elems)
enum AVCodecID data_codec_id
Forced Data codec_id.
int eof_reached
true if was unable to read due to error or eof
AVCodec * subtitle_codec
Forced subtitle codec.
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
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
AVCodec * data_codec
Forced data codec.
static const struct PPFilter filters[]
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
SpecifierOpt * max_frames
static const char * opt_name_sample_fmts[]
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
static int show_hwaccels(void *optctx, const char *opt, const char *arg)
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
int hw_device_init_from_string(const char *arg, HWDevice **dev)
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 * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVDictionary * encoder_opts
int64_t av_get_default_channel_layout(int nb_channels)
Return default channel layout for a given number of channels.
static enum AVSampleFormat sample_fmts[]
AVDictionary * codec_opts
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
static const AVBitStreamFilter *const bitstream_filters[]
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
static const char * opt_name_reinit_filters[]
float dts_delta_threshold
char * videotoolbox_pixfmt
#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 DEFAULT_PASS_LOGFILENAME_PREFIX
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int opt_default_new(OptionsContext *o, const char *opt, const char *arg)
static int no_file_overwrite
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
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)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static const char * opt_name_codec_tags[]
#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM
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)
static double val(void *priv, double ch)
This structure stores compressed data.
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)
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
const char program_name[]
program name, defined by the program for show_version().
#define AV_NOPTS_VALUE
Undefined timestamp value.
InputStream ** input_streams
int videotoolbox_init(AVCodecContext *s)
static const char * opt_name_intra_matrices[]
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
static int copy_unknown_streams
static OutputStream * new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index)