Go to the documentation of this file.
47 #define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
49 #define SPECIFIER_OPT_FMT_str "%s"
50 #define SPECIFIER_OPT_FMT_i "%i"
51 #define SPECIFIER_OPT_FMT_i64 "%"PRId64
52 #define SPECIFIER_OPT_FMT_ui64 "%"PRIu64
53 #define SPECIFIER_OPT_FMT_f "%f"
54 #define SPECIFIER_OPT_FMT_dbl "%lf"
102 #define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\
104 char namestr[128] = "";\
105 const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\
106 for (i = 0; opt_name_##name[i]; i++)\
107 av_strlcatf(namestr, sizeof(namestr), "-%s%s", opt_name_##name[i], opt_name_##name[i+1] ? (opt_name_##name[i+2] ? ", " : " or ") : "");\
108 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",\
109 namestr, st->index, opt_name_##name[0], spec[0] ? ":" : "", spec, so->u.type);\
112 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
114 int i, ret, matches = 0;\
116 for (i = 0; i < o->nb_ ## name; i++) {\
117 char *spec = o->name[i].specifier;\
118 if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\
119 outvar = o->name[i].u.type;\
126 WARN_MULTIPLE_OPT_USAGE(name, type, so, st);\
129 #define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\
132 for (i = 0; i < o->nb_ ## name; i++) {\
133 char *spec = o->name[i].specifier;\
134 if (!strcmp(spec, mediatype))\
135 outvar = o->name[i].u.type;\
189 void *dst = (uint8_t*)o + po->
u.
off;
193 int i, *count = (
int*)(so + 1);
194 for (
i = 0;
i < *count;
i++) {
216 memset(o, 0,
sizeof(*o));
233 printf(
"Hardware acceleration methods:\n");
248 char *p = strchr(e->
key,
':');
280 const AVClass *pclass = &
class;
289 if (user_stats_period <= 0) {
324 static int opt_map(
void *optctx,
const char *opt,
const char *
arg)
328 int i, negative = 0, file_idx, disabled = 0;
329 int sync_file_idx = -1, sync_stream_idx = 0;
343 if (sync = strchr(
map,
',')) {
345 sync_file_idx = strtol(sync + 1, &sync, 0);
360 "match any streams.\n",
arg);
373 const char *
c =
map + 1;
382 if (allow_unused = strchr(
map,
'?'))
384 file_idx = strtol(
map, &p, 0);
396 *p ==
':' ? p + 1 : p) > 0)
402 *p ==
':' ? p + 1 : p) <= 0)
414 if (sync_file_idx >= 0) {
427 }
else if (disabled) {
429 "To ignore this, add a trailing '?' to the map.\n",
arg);
433 "To ignore this, add a trailing '?' to the map.\n",
arg);
476 n = sscanf(
arg,
"%d.%d.%d:%d.%d",
480 if (n != 3 && n != 5) {
482 "[file.stream.channel|-1][:syncfile:syncstream]\n");
508 if (allow_unused = strchr(mapchan,
'?'))
517 "To ignore this, add a trailing '?' to the map_channel.\n",
535 static int opt_vaapi_device(
void *optctx,
const char *opt,
const char *
arg)
537 const char *prefix =
"vaapi:";
550 static int opt_qsv_device(
void *optctx,
const char *opt,
const char *
arg)
552 const char *prefix =
"qsv=__qsv_device:hw_any,child_device=";
568 if (!strcmp(
arg,
"list")) {
570 printf(
"Supported hardware device types:\n");
610 if (*(++
arg) && *
arg !=
':') {
614 *stream_spec = *
arg ==
':' ?
arg + 1 :
"";
634 char type_in, type_out;
635 const char *istream_spec =
NULL, *ostream_spec =
NULL;
636 int idx_in = 0, idx_out = 0;
642 if (type_out ==
'g' || !*outspec)
644 if (type_out ==
's' || !*outspec)
646 if (type_out ==
'c' || !*outspec)
651 if (type_in ==
'g' || type_out ==
'g')
653 if (type_in ==
's' || type_out ==
's')
655 if (type_in ==
'c' || type_out ==
'c')
662 #define METADATA_CHECK_INDEX(index, nb_elems, desc)\
663 if ((index) < 0 || (index) >= (nb_elems)) {\
664 av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\
669 #define SET_DICT(type, meta, context, index)\
672 meta = &context->metadata;\
675 METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\
676 meta = &context->chapters[index]->metadata;\
679 METADATA_CHECK_INDEX(index, context->nb_programs, "program")\
680 meta = &context->programs[index]->metadata;\
684 default: av_assert0(0);\
687 SET_DICT(type_in, meta_in, ic, idx_in);
688 SET_DICT(type_out, meta_out, oc, idx_out);
691 if (type_in ==
's') {
705 if (type_out ==
's') {
724 struct tm time = *gmtime((time_t*)&recording_timestamp);
725 if (!strftime(buf,
sizeof(buf),
"creation_time=%Y-%m-%dT%H:%M:%S%z", &time))
730 "tag instead.\n", opt);
737 const char *
codec_string = encoder ?
"encoder" :
"decoder";
765 char *codec_name =
NULL;
789 const char *hwaccel =
NULL;
790 char *hwaccel_output_format =
NULL;
791 char *codec_tag =
NULL;
793 char *discard_str =
NULL;
810 ist->min_pts = INT64_MAX;
811 ist->max_pts = INT64_MIN;
821 uint32_t
tag = strtol(codec_tag, &next, 0);
830 ist->reinit_filters = -1;
842 if (discard_str &&
av_opt_eval_int(&cc, discard_opt, discard_str, &
ist->user_set_discard) < 0) {
864 if (!
ist->decoded_frame)
890 ist->top_field_first = -1;
895 hwaccel_output_format, ic, st);
897 if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel,
"cuvid")) {
899 "WARNING: defaulting hwaccel_output_format to cuda for compatibility "
900 "with old commandlines. This behaviour is DEPRECATED and will be removed "
901 "in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n");
903 }
else if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel,
"qsv")) {
905 "WARNING: defaulting hwaccel_output_format to qsv for compatibility "
906 "with old commandlines. This behaviour is DEPRECATED and will be removed "
907 "in the future. Please explicitly set \"-hwaccel_output_format qsv\".\n");
909 }
else if (hwaccel_output_format) {
913 "format: %s", hwaccel_output_format);
921 if (!strcmp(hwaccel,
"nvdec") || !strcmp(hwaccel,
"cuvid"))
924 if (!strcmp(hwaccel,
"none"))
926 else if (!strcmp(hwaccel,
"auto"))
932 ist->hwaccel_device_type =
type;
935 if (!
ist->hwaccel_id) {
951 if (hwaccel_device) {
953 if (!
ist->hwaccel_device)
961 ist->guess_layout_max = INT_MAX;
967 char *canvas_size =
NULL;
999 fprintf(stderr,
"Error, both -y and -n supplied. Exiting.\n");
1004 if (proto_name && !strcmp(proto_name,
"file") &&
avio_check(filename, 0) == 0) {
1006 fprintf(stderr,
"File '%s' already exists. Overwrite? [y/N] ", filename);
1009 signal(SIGINT, SIG_DFL);
1023 if (proto_name && !strcmp(proto_name,
"file")) {
1028 if (!strcmp(filename, file->
ctx->
url)) {
1049 filename = e->
value;
1081 char * data_codec_name =
NULL;
1082 int scan_all_pmts_set = 0;
1106 if (!strcmp(filename,
"-"))
1110 strcmp(filename,
"/dev/stdin");
1160 if (data_codec_name)
1175 scan_all_pmts_set = 1;
1185 if (scan_all_pmts_set)
1202 for (
i = 0;
i < orig_nb_streams;
i++)
1241 int64_t seek_timestamp = timestamp;
1244 int dts_heuristic = 0;
1252 if (dts_heuristic) {
1285 if (
f->readrate < 0.0f) {
1289 if (
f->readrate &&
f->rate_emu) {
1324 "input file #%d (%s) is not a decoding option.\n", e->
key,
1331 "input file #%d (%s) has not been used for any stream. The most "
1332 "likely reason is either wrong type (e.g. a video option with "
1333 "no video streams) or that it is a private option of some decoder "
1334 "which was not actually used for any stream.\n", e->
key,
1372 char filename[1000];
1373 const char *
base[3] = { getenv(
"AVCONV_DATADIR"),
1382 snprintf(filename,
sizeof(filename),
"%s%s/%s-%s.avpreset",
base[
i],
1383 i != 1 ?
"" :
"/.avconv", codec_name, preset_name);
1387 snprintf(filename,
sizeof(filename),
"%s%s/%s.avpreset",
base[
i],
1388 i != 1 ?
"" :
"/.avconv", preset_name);
1398 char *codec_name =
NULL;
1408 "output stream #%d:%d. Default encoder for format %s (codec %s) is "
1409 "probably disabled. Please choose an encoder manually.\n",
1414 }
else if (!strcmp(codec_name,
"copy"))
1435 const char *bsfs =
NULL, *time_base =
NULL;
1436 char *next, *codec_tag =
NULL;
1502 if (!buf[0] || buf[0] ==
'#')
1504 if (!(
arg = strchr(buf,
'='))) {
1510 }
while (!
s->eof_reached);
1516 "Preset %s specified for stream %d:%d, but could not be opened.\n",
1532 q.
num <= 0 || q.
den <= 0) {
1564 if (bsfs && *bsfs) {
1574 uint32_t
tag = strtol(codec_tag, &next, 0);
1613 if (source_index >= 0) {
1630 const char *p =
str;
1695 "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n"
1696 "Filtering and streamcopy cannot be used together.\n",
1697 ost->
filters ?
"Filtergraph" :
"Filtergraph script",
1709 char *frame_rate =
NULL, *max_frame_rate =
NULL, *frame_aspect_ratio =
NULL;
1727 if (frame_rate && max_frame_rate) {
1732 if ((frame_rate || max_frame_rate) &&
1734 av_log(
NULL,
AV_LOG_ERROR,
"Using -vsync passthrough and -r/-fpsmax can produce invalid output files\n");
1737 if (frame_aspect_ratio) {
1740 q.
num <= 0 || q.
den <= 0) {
1751 const char *p =
NULL;
1753 char *frame_pix_fmt =
NULL;
1754 char *intra_matrix =
NULL, *inter_matrix =
NULL;
1755 char *chroma_intra_matrix =
NULL;
1766 if (frame_pix_fmt && *frame_pix_fmt ==
'+') {
1768 if (!*++frame_pix_fmt)
1769 frame_pix_fmt =
NULL;
1786 if (chroma_intra_matrix) {
1805 for (
i = 0; p;
i++) {
1807 int e = sscanf(p,
"%d,%d,%d", &start, &end, &q);
1856 char logfilename[1024];
1859 snprintf(logfilename,
sizeof(logfilename),
"%s-%d.log",
1863 if (!strcmp(
ost->
enc->name,
"libx264")) {
1867 char *logbuffer =
read_file(logfilename);
1880 "Cannot write log file '%s' for pass-1 encoding: %s\n",
1881 logfilename, strerror(errno));
1913 if (
ifile->nb_streams == 1 &&
ifile->input_ts_offset == 0)
1957 char *sample_fmt =
NULL;
1984 if (
map->channel_idx == -1) {
1994 if (!
ist || (
ist->file_index ==
map->file_idx &&
ist->st->index ==
map->stream_idx)) {
2083 p = strchr(idx_str,
':');
2086 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
2109 for (
i = 0;
i <
is->nb_chapters;
i++) {
2114 int64_t rt = (
ofile->recording_time == INT64_MAX) ? INT64_MAX :
2118 if (in_ch->
end < ts_off)
2120 if (rt != INT64_MAX && in_ch->
start > rt + ts_off)
2127 out_ch->id = in_ch->
id;
2129 out_ch->start =
FFMAX(0, in_ch->
start - ts_off);
2130 out_ch->end =
FFMIN(rt, in_ch->
end - ts_off);
2144 int have_manual = 0;
2171 #if LIBAVFORMAT_VERSION_MAJOR >= 60
2199 have_default[
type] = 1;
2227 "which is fed from a complex filtergraph. Filtering and streamcopy "
2233 const char *opt =
ost->
filters ?
"-vf/-af/-filter" :
"-filter_script";
2235 "%s '%s' was specified through the %s option "
2236 "for output stream %d:%d, which is fed from a complex filtergraph.\n"
2237 "%s and -filter_complex cannot be used together for the same stream.\n",
2238 ost->
filters ?
"Filtergraph" :
"Filtergraph script",
2293 if (!strcmp(filename,
"-"))
2336 int best_score = 0, idx = -1;
2340 int file_best_score = 0, file_best_idx = -1;
2341 for (
i = 0;
i <
ifile->nb_streams;
i++) {
2344 score =
ist->st->codecpar->width *
ist->st->codecpar->height
2352 score > file_best_score) {
2355 file_best_score = score;
2356 file_best_idx =
ifile->ist_index +
i;
2359 if (file_best_idx >= 0) {
2362 if (file_best_score > best_score) {
2363 best_score = file_best_score;
2364 idx = file_best_idx;
2374 int best_score = 0, idx = -1;
2377 int file_best_score = 0, file_best_idx = -1;
2378 for (
i = 0;
i <
ifile->nb_streams;
i++) {
2381 score =
ist->st->codecpar->channels
2387 score > file_best_score) {
2388 file_best_score = score;
2389 file_best_idx =
ifile->ist_index +
i;
2392 if (file_best_idx >= 0) {
2394 if (file_best_score > best_score) {
2395 best_score = file_best_score;
2396 idx = file_best_idx;
2414 int input_props = 0, output_props = 0;
2419 if (input_descriptor)
2421 if (output_descriptor)
2424 input_props & output_props ||
2426 input_descriptor && output_descriptor &&
2427 (!input_descriptor->
props ||
2428 !output_descriptor->
props)) {
2452 if (
map->linklabel) {
2461 if (
out && !strcmp(
out->name,
map->linklabel)) {
2470 "in any defined filter graph, or was already used elsewhere.\n",
map->linklabel);
2480 map->file_index,
map->stream_index);
2493 switch (
ist->st->codecpar->codec_type) {
2506 "Cannot map stream #%d:%d - unsupported type.\n",
2507 map->file_index,
map->stream_index);
2510 "If you want unsupported types ignored instead "
2511 "of failing, please use the -ignore_unknown option\n"
2512 "If you want them copied, please use -copy_unknown\n");
2518 +
map->sync_stream_index];
2526 uint8_t *attachment;
2589 "output file #%d (%s) is not an encoding option.\n", e->
key,
2596 if (!strcmp(e->
key,
"gop_timecode"))
2600 "output file #%d (%s) has not been used for any stream. The most "
2601 "likely reason is either wrong type (e.g. a video option with "
2602 "no video streams) or that it is a private option of some encoder "
2603 "which was not actually used for any stream.\n", e->
key,
2621 "Error initializing a simple filtergraph between streams "
2640 f->formats =
ost->
enc->pix_fmts;
2647 f->formats =
ost->
enc->sample_fmts;
2652 f->sample_rates =
ost->
enc->supported_samplerates;
2657 f->channel_layouts =
ost->
enc->channel_layouts;
2674 "No input streams but output needs an input stream\n");
2703 av_log(
NULL,
AV_LOG_FATAL,
"Invalid input file index %d while processing metadata maps\n", in_file_index);
2707 in_file_index >= 0 ?
2762 const char *to_dealloc = p2;
2777 if (!strcmp(
key,
"program_num"))
2778 progid = strtol(p2,
NULL, 0);
2788 const char *to_dealloc = p2;
2797 "No '=' character in program string %s.\n",
2805 if (!strcmp(
key,
"title")) {
2807 }
else if (!strcmp(
key,
"program_num")) {
2808 }
else if (!strcmp(
key,
"st")) {
2809 int st_num = strtol(p2,
NULL, 0);
2824 const char *stream_spec;
2894 static const char *
const frame_rates[] = {
"25",
"30000/1001",
"24000/1001" };
2896 if (!strncmp(
arg,
"pal-", 4)) {
2899 }
else if (!strncmp(
arg,
"ntsc-", 5)) {
2902 }
else if (!strncmp(
arg,
"film-", 5)) {
2919 }
else if ((fr == 29970) || (fr == 23976)) {
2939 if (!strcmp(
arg,
"vcd")) {
2966 }
else if (!strcmp(
arg,
"svcd")) {
2988 }
else if (!strcmp(
arg,
"dvd")) {
3010 }
else if (!strncmp(
arg,
"dv", 2)) {
3016 norm ==
PAL ?
"yuv420p" :
"yuv411p",
options);
3043 time_t today2 = time(
NULL);
3044 struct tm *today = localtime(&today2);
3051 snprintf(filename,
sizeof(filename),
"vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
3098 char filename[1000],
line[1000], tmp_line[1000];
3099 const char *codec_name =
NULL;
3106 if(!strncmp(
arg,
"libx264-lossless", strlen(
"libx264-lossless"))){
3114 char *
key = tmp_line, *
value, *endptr;
3116 if (strcspn(
line,
"#\n\r") == 0)
3158 if(!strcmp(opt,
"ab")){
3161 }
else if(!strcmp(opt,
"b")){
3175 if(!strcmp(opt,
"qscale")){
3190 if(!strcmp(opt,
"profile")){
3221 " use a string argument as described in the manual.\n");
3243 char layout_str[32];
3262 stream_str = strchr(opt,
':');
3263 ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
3317 int show_advanced = 0, show_avoptions = 0;
3320 if (!strcmp(opt,
"long"))
3322 else if (!strcmp(opt,
"full"))
3323 show_advanced = show_avoptions = 1;
3331 " -h -- print basic options\n"
3332 " -h long -- print more options\n"
3333 " -h full -- print all options (including all format and codec specific options, very long)\n"
3334 " -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol\n"
3335 " See man %s for detailed description of the options.\n"
3342 "instead of just one file):",
3370 if (show_avoptions) {
3377 #if CONFIG_SWRESAMPLE
3399 [GROUP_INFILE] = {
"input url",
"i",
OPT_INPUT },
3417 "%s.\n", inout,
g->arg);
3442 memset(&octx, 0,
sizeof(octx));
3494 static int opt_progress(
void *optctx,
const char *opt,
const char *
arg)
3499 if (!strcmp(
arg,
"-"))
3511 #define OFFSET(x) offsetof(OptionsContext, x)
3517 "force format",
"fmt" },
3519 "overwrite output files" },
3521 "never overwrite output files" },
3523 "Ignore unknown stream types" },
3525 "Copy unknown stream types" },
3527 "allow recasting stream type in order to force a decoder of different media type" },
3530 "codec name",
"codec" },
3533 "codec name",
"codec" },
3536 "preset name",
"preset" },
3539 "set input stream mapping",
3540 "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
3542 "map an audio channel from one stream to another",
"file.stream.channel[:syncfile.syncstream]" },
3545 "set metadata information of outfile from infile",
3546 "outfile[,metadata]:infile[,metadata]" },
3549 "set chapters mapping",
"input_file_index" },
3552 "record or transcode \"duration\" seconds of audio/video",
3555 "record or transcode stop time",
"time_stop" },
3557 "set the limit file size in bytes",
"limit_size" },
3560 "set the start time offset",
"time_off" },
3563 "set the start time offset relative to EOF",
"time_off" },
3566 "enable/disable seeking by timestamp with -ss" },
3569 "enable/disable accurate seeking with -ss" },
3572 "set the input ts offset",
"time_off" },
3575 "set the input ts scale",
"scale" },
3577 "set the recording timestamp ('now' to set the current time)",
"time" },
3579 "add metadata",
"string=string" },
3581 "add program with specified streams",
"title=string:st=number..." },
3584 "set the number of data frames to output",
"number" },
3586 "add timings for benchmarking" },
3588 "add timings for each task" },
3590 "write program-readable progress information",
"url" },
3592 "enable or disable interaction on standard input" },
3594 "set max runtime in seconds in CPU user time",
"limit" },
3596 "dump each input packet" },
3598 "when dumping packets, also dump the payload" },
3601 "read input at native frame rate; equivalent to -readrate 1",
"" },
3604 "read input at specified rate",
"speed" },
3606 "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" "
3607 "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")",
"type" },
3609 "video sync method",
"" },
3611 "frame drop threshold",
"" },
3613 "audio sync method",
"" },
3615 "audio drift threshold",
"threshold" },
3617 "copy timestamps" },
3619 "shift input timestamps to start at 0 when using copyts" },
3621 "copy input stream time base when stream copying",
"mode" },
3624 "finish encoding within shortest input" },
3632 "timestamp discontinuity delta threshold",
"threshold" },
3634 "timestamp error delta threshold",
"threshold" },
3636 "exit on error",
"error" },
3638 "abort on the specified condition flags",
"flags" },
3641 "copy initial non-keyframes" },
3643 "copy or discard frames before start time" },
3645 "set the number of frames to output",
"number" },
3648 "force codec tag/fourcc",
"fourcc/tag" },
3651 "use fixed quality scale (VBR)",
"q" },
3654 "use fixed quality scale (VBR)",
"q" },
3656 "set profile",
"profile" },
3658 "set stream filtergraph",
"filter_graph" },
3660 "number of non-complex filter threads" },
3662 "read stream filtergraph description from a file",
"filename" },
3664 "reinit filtergraph on input parameter changes",
"" },
3666 "create a complex filtergraph",
"graph_description" },
3668 "number of threads for -filter_complex" },
3670 "create a complex filtergraph",
"graph_description" },
3672 "read complex filtergraph description from a file",
"filename" },
3674 "enable automatic conversion filters globally" },
3676 "print progress report during encoding", },
3678 "set the period at which ffmpeg updates stats and -progress output",
"time" },
3681 "add an attachment to the output file",
"filename" },
3684 "extract an attachment into a file",
"filename" },
3686 OPT_OFFSET, { .off =
OFFSET(
loop) },
"set number of times input stream shall be looped",
"loop count" },
3688 "print timestamp debugging info" },
3690 "ratio of decoding errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.",
"maximum error rate" },
3696 "disposition",
"" },
3698 { .off =
OFFSET(thread_queue_size) },
3699 "set the maximum number of queued packets from the demuxer" },
3701 "read and decode the streams to fill missing information with heuristics" },
3703 { .off =
OFFSET(bits_per_raw_sample) },
3704 "set the number of bits per raw sample",
"number" },
3708 "set the number of video frames to output",
"number" },
3711 "set frame rate (Hz value, fraction or abbreviation)",
"rate" },
3714 "set max frame rate (Hz value, fraction or abbreviation)",
"rate" },
3717 "set frame size (WxH or abbreviation)",
"size" },
3720 "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)",
"aspect" },
3723 "set pixel format",
"format" },
3728 "rate control override for specific intervals",
"override" },
3731 "force video codec ('copy' to copy stream)",
"codec" },
3733 "set initial TimeCode value.",
"hh:mm:ss[:;.]ff" },
3735 "select the pass number (1 to 3)",
"n" },
3738 "select two pass log file name prefix",
"prefix" },
3740 "calculate PSNR of compressed frames" },
3742 "dump video coding statistics to file" },
3744 "dump video coding statistics to file",
"file" },
3746 "Version of the vstats format to use."},
3748 "set video filters",
"filter_graph" },
3751 "specify intra matrix coeffs",
"matrix" },
3754 "specify inter matrix coeffs",
"matrix" },
3757 "specify intra matrix coeffs",
"matrix" },
3760 "top=1/bottom=0/auto=-1 field first",
"" },
3763 "force video tag/fourcc",
"fourcc/tag" },
3765 "show QP histogram" },
3768 "force the selected framerate, disable the best supported framerate selection" },
3771 "set the value of an outfile streamid",
"streamIndex:value" },
3774 "force key frames at specified timestamps",
"timestamps" },
3776 "audio bitrate (please use -b:a)",
"bitrate" },
3778 "video bitrate (please use -b:v)",
"bitrate" },
3781 "use HW accelerated decoding",
"hwaccel name" },
3784 "select a device for HW acceleration",
"devicename" },
3787 "select output format used with HW accelerated decoding",
"format" },
3789 "show available HW acceleration methods" },
3792 "automatically insert correct rotate filters" },
3795 "automatically insert a scale filter at the end of the filter graph" },
3799 "set the number of audio frames to output",
"number" },
3801 "set audio quality (codec-specific)",
"quality", },
3804 "set audio sampling rate (in Hz)",
"rate" },
3807 "set number of audio channels",
"channels" },
3812 "force audio codec ('copy' to copy stream)",
"codec" },
3815 "force audio tag/fourcc",
"fourcc/tag" },
3817 "change audio volume (256=normal)" ,
"volume" },
3820 "set sample format",
"format" },
3823 "set channel layout",
"layout" },
3825 "set audio filters",
"filter_graph" },
3827 "set the maximum number of channels to try to guess the channel layout" },
3831 "disable subtitle" },
3833 "force subtitle codec ('copy' to copy stream)",
"codec" },
3835 ,
"force subtitle tag/fourcc",
"fourcc/tag" },
3837 "fix subtitles duration" },
3839 "set canvas size (WxH or abbreviation)",
"size" },
3843 "set the maximum demux-decode delay",
"seconds" },
3845 "set the initial demux-decode delay",
"seconds" },
3847 "specify a file in which to print sdp information",
"file" },
3850 "set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5)",
"ratio" },
3852 "set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). "
3853 "two special values are defined - "
3854 "0 = use frame rate (video) or sample rate (audio),"
3855 "-1 = match source time base",
"ratio" },
3858 "A comma-separated list of bitstream filters",
"bitstream_filters" },
3860 "deprecated",
"audio bitstream_filters" },
3862 "deprecated",
"video bitstream_filters" },
3865 "set the audio options to the indicated preset",
"preset" },
3867 "set the video options to the indicated preset",
"preset" },
3869 "set the subtitle options to the indicated preset",
"preset" },
3871 "set options from indicated preset file",
"filename" },
3874 "maximum number of packets that can be buffered while waiting for all streams to initialize",
"packets" },
3876 "set the threshold after which max_muxing_queue_size is taken into account",
"bytes" },
3880 "force data codec ('copy' to copy stream)",
"codec" },
3886 "set VAAPI hardware device (DRM path or X11 display name)",
"device" },
3891 "set QSV hardware device (DirectX adapter index, DRM path or X11 display name)",
"device"},
3895 "initialise hardware device",
"args" },
3897 "set hardware device used when filtering",
"device" },
static void error(const char *err)
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_BPRINT_SIZE_UNLIMITED
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
static int ignore_unknown_streams
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
static OutputStream * new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index)
static int show_hwaccels(void *optctx, const char *opt, const char *arg)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C program
static int opt_abort_on(void *optctx, const char *opt, const char *arg)
SpecifierOpt * dump_attachment
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
const char * attachment_filename
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AV_OPT_FLAG_VIDEO_PARAM
enum AVMediaType codec_type
General type of the encoded data.
static void dump_attachment(AVStream *st, const char *filename)
static int opt_video_filters(void *optctx, const char *opt, const char *arg)
void show_help_default(const char *opt, const char *arg)
Per-fftool specific help handler.
#define SET_DICT(type, meta, context, index)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
int sample_rate
samples per second
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
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...
The official guide to swscale for confused that is
unsigned int nb_chapters
Number of chapters in AVChapter array.
This struct describes the properties of an encoded stream.
#define ALLOC_ARRAY_ELEM(array, nb_elems)
#define u(width, name, range_min, range_max)
static enum AVSampleFormat sample_fmts[]
static int opt_old2new(void *optctx, const char *opt, const char *arg)
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
static int copy_metadata(char *outspec, char *inspec, AVFormatContext *oc, AVFormatContext *ic, OptionsContext *o)
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
static const char *const opt_name_frame_aspect_ratios[]
void remove_avoptions(AVDictionary **a, AVDictionary *b)
#define AV_CODEC_FLAG_QSCALE
Use fixed qscale.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static const char *const opt_name_frame_pix_fmts[]
char * av_asprintf(const char *fmt,...)
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
uint16_t * intra_matrix
custom intra quantization matrix Must be allocated with the av_malloc() family of functions,...
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
const char program_name[]
program name, defined by the program for show_version().
static int no_file_overwrite
static int opt_default_new(OptionsContext *o, const char *opt, const char *arg)
int64_t start_time
start time in microseconds == AV_TIME_BASE units
const AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
static const char *const opt_name_top_field_first[]
static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
int auto_conversion_filters
static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
int ffmpeg_parse_options(int argc, char **argv)
AVStream ** streams
A list of all streams in the file.
static const char *const opt_name_max_frames[]
static int copy_unknown_streams
static const char * subtitle_codec_name
AVRational avg_frame_rate
Average framerate.
static const char *const opt_name_bitstream_filters[]
AVDictionary * format_opts
#define AV_DICT_APPEND
If the entry already exists, append to it.
static const char *const opt_name_presets[]
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key,...
HWDevice * filter_hw_device
enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
Look up an AVHWDeviceType by name.
static const char *const opt_name_autorotate[]
#define AV_LOG_VERBOSE
Detailed information.
static const char *const opt_name_reinit_filters[]
AVIOContext * progress_avio
static int opt_filter_hw_device(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.
enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev)
Iterate over supported device types.
SpecifierOpt * audio_channels
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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 OutputStream * new_attachment_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
#define AV_CODEC_FLAG_PSNR
error[?] variables will be set during encoding.
int hw_device_init_from_string(const char *arg, HWDevice **dev)
enum AVCodecID video_codec_id
Forced video codec_id.
#define AV_OPT_FLAG_FILTERING_PARAM
a generic parameter which can be set by the user for filtering
int64_t avio_size(AVIOContext *s)
Get the filesize.
double rotate_override_value
static const AVInputFormat * file_iformat
#define AV_CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
static int subtitle_disable
int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
static const char *const opt_name_ts_scale[]
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
void exit_program(int ret)
Wraps exit with a program-specific cleanup routine.
static const char *const opt_name_fix_sub_duration[]
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
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.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
enum VideoSyncMethod vsync_method
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 opt_filter_threads(void *optctx, const char *opt, const char *arg)
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.
char * filters
filtergraph associated to the -filter option
static const char *const opt_name_max_muxing_queue_size[]
A list of option groups that all have the same group type (e.g.
static void uninit_options(OptionsContext *o)
static const Preset presets[]
static int opt_timecode(void *optctx, const char *opt, const char *arg)
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
Put a description of the AVERROR code errnum in errbuf.
static void check_streamcopy_filters(OptionsContext *o, AVFormatContext *oc, const OutputStream *ost, enum AVMediaType type)
static int opt_data_frames(void *optctx, const char *opt, const char *arg)
static char * get_line(AVIOContext *s, AVBPrint *bprint)
@ AVDISCARD_NONE
discard nothing
int flags
AV_CODEC_FLAG_*.
static double val(void *priv, double ch)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
const AVClass * sws_get_class(void)
Get the AVClass for swsContext.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
AVProgram * av_new_program(AVFormatContext *s, int id)
static int opt_audio_filters(void *optctx, const char *opt, const char *arg)
static const char *const opt_name_hwaccels[]
int nb_audio_channel_maps
#define filters(fmt, inverse, clip, i, c)
static int opt_filter_complex_script(void *optctx, const char *opt, const char *arg)
static int input_stream_potentially_available
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int metadata_chapters_manual
int copy_initial_nonkeyframes
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
void avfilter_inout_free(AVFilterInOut **inout)
Free the supplied list of AVFilterInOut and set *inout to NULL.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
static int init_complex_filters(void)
#define FF_ARRAY_ELEMS(a)
#define ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM
static OutputStream * new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
const AVCodec * subtitle_codec
Forced subtitle codec.
AVDictionary * codec_opts
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,...
FILE * av_fopen_utf8(const char *path, const char *mode)
Open a file using a UTF-8 filename.
#define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)
static void parse_matrix_coeffs(uint16_t *dest, const char *str)
int avformat_open_input(AVFormatContext **ps, const char *url, const AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
static int opt_attach(void *optctx, const char *opt, const char *arg)
static int opt_recording_timestamp(void *optctx, const char *opt, const char *arg)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance)
Test if the given container can store a codec.
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
int64_t end
chapter start/end time in time_base units
InputStream ** input_streams
char * specifier
stream/chapter/program/...
This struct describes the properties of a single codec described by an AVCodecID.
static const char *const opt_name_frame_rates[]
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
int split_commandline(OptionParseContext *octx, int argc, char *argv[], const OptionDef *options, const OptionGroupDef *groups, int nb_groups)
Split the commandline into an intermediate form convenient for further processing.
int global_quality
Global quality for codecs which cannot change it per frame.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
AVRational frame_aspect_ratio
int avio_read_to_bprint(AVIOContext *h, struct AVBPrint *pb, size_t max_size)
Read contents of h into print buffer, up to max_size bytes, or up to EOF.
static const char *const opt_name_rc_overrides[]
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
int flags
Flags modifying the (de)muxer behaviour.
static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec)
Parse a metadata specifier passed as 'arg' parameter.
const struct AVInputFormat * iformat
The input container format.
static OutputStream * new_video_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
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 audio_channels_mapped
static int opt_audio_qscale(void *optctx, const char *opt, const char *arg)
const AVClass * av_bsf_get_class(void)
Get the AVClass for AVBSFContext.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AVIO_FLAG_WRITE
write-only
struct OutputStream * ost
int metadata_streams_manual
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static OutputStream * new_data_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
const char * av_hwdevice_get_type_name(enum AVHWDeviceType type)
Get the string name of an AVHWDeviceType.
static const char *const opt_name_codec_names[]
static const char *const opt_name_pass[]
#define AV_OPT_FLAG_BSF_PARAM
a generic parameter which can be set by the user for bit stream filtering
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
void assert_avoptions(AVDictionary *m)
static int opt_video_frames(void *optctx, const char *opt, const char *arg)
#define AV_OPT_FLAG_AUDIO_PARAM
static const char *const opt_name_canvas_sizes[]
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.
int props
Codec properties, a combination of AV_CODEC_PROP_* flags.
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
static void init_output_filter(OutputFilter *ofilter, OptionsContext *o, AVFormatContext *oc)
OutputStream ** output_streams
AVDictionary * encoder_opts
@ AVDISCARD_ALL
discard all
#define av_realloc_f(p, o, n)
enum AVCodecID audio_codec_id
Forced audio codec_id.
AVDictionary * format_opts
static int opt_target(void *optctx, const char *opt, const char *arg)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int open_file(AVFormatContext *avf, unsigned fileno)
static int opt_profile(void *optctx, const char *opt, const char *arg)
#define LIBAVUTIL_VERSION_INT
static void assert_file_overwrite(const char *filename)
Describe the class of an AVClass context structure.
const AVClass * avcodec_get_class(void)
Get the AVClass for AVCodecContext.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
const AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
static const char *const opt_name_copy_initial_nonkeyframes[]
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...
SpecifierOpt * frame_sizes
static int set_dispositions(OutputFile *of)
const AVClass * swr_get_class(void)
Get the AVClass for SwrContext.
Rational number (pair of numerator and denominator).
static int open_input_file(OptionsContext *o, const char *filename)
const char * av_default_item_name(void *ptr)
Return the context name.
int metadata_global_manual
AVIOContext * pb
I/O context.
#define AV_CODEC_PROP_BITMAP_SUB
Subtitle codec is bitmap based Decoded AVSubtitle data can be read from the AVSubtitleRect->pict fiel...
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries.
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.
SpecifierOpt * max_frames
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
const AVCodec * audio_codec
Forced audio codec.
static int find_stream_info
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static int choose_encoder(OptionsContext *o, AVFormatContext *s, OutputStream *ost)
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
static const char *const opt_name_guess_layout_max[]
static const char *const opt_name_max_frame_rates[]
#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...
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
AVCodecID
Identify the syntax and semantics of the bitstream.
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
int extradata_size
Size of the extradata content in bytes.
static int opt_streamid(void *optctx, const char *opt, const char *arg)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
static int opt_preset(void *optctx, const char *opt, const char *arg)
static int opt_vstats_file(void *optctx, const char *opt, const char *arg)
AVDictionary * codec_opts
const AVCodec * data_codec
Forced data codec.
const OptionDef options[]
static int opt_bitrate(void *optctx, const char *opt, const char *arg)
int av_get_exact_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
static const uint8_t frame_sizes[]
static const char *const opt_name_audio_sample_rate[]
static int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
static const AVCodec * find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
#define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)
OutputFile ** output_files
static int opt_map(void *optctx, const char *opt, const char *arg)
static const AVCodec * choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
static int64_t start_time
char * url
input or output URL.
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.
enum AVSampleFormat sample_fmt
audio sample format
static int open_output_file(OptionsContext *o, const char *filename)
static int file_overwrite
static const char *const opt_name_filters[]
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.
#define AV_NOPTS_VALUE
Undefined timestamp value.
static int opt_subtitle_codec(void *optctx, const char *opt, const char *arg)
int avio_check(const char *url, int flags)
Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url,...
AVDictionary ** setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts)
Setup AVCodecContext options for avformat_find_stream_info().
uint16_t * chroma_intra_matrix
custom intra quantization matrix
printf("static const uint8_t my_array[100] = {\n")
static const char *const opt_name_filter_scripts[]
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
static int opt_sdp_file(void *optctx, const char *opt, const char *arg)
static const char *const opt_name_chroma_intra_matrices[]
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#define AV_CODEC_FLAG_PASS2
Use internal 2pass ratecontrol in second pass mode.
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.
static const char *const opt_name_passlogfiles[]
void check_filter_outputs(void)
static char * get_ost_filters(OptionsContext *o, AVFormatContext *oc, OutputStream *ost)
static int opt_data_codec(void *optctx, const char *opt, const char *arg)
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
static void init_options(OptionsContext *o)
static const char *const opt_name_frame_sizes[]
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.
SpecifierOpt * frame_rates
enum VideoSyncMethod video_sync_method
#define AV_LOG_INFO
Standard information.
static const char * video_codec_name
int channels
number of audio channels
static const char *const opt_name_enc_time_bases[]
int guess_input_channel_layout(InputStream *ist)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel layout
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
AVRational max_frame_rate
char * filters_script
filtergraph script associated to the -filter_script option
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
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 init_complex_filtergraph(FilterGraph *fg)
#define i(width, name, range_min, range_max)
static const char *const opt_name_autoscale[]
SpecifierOpt * metadata_map
int64_t id
unique ID to identify the chapter
static const char *const opt_name_audio_channels[]
int avcodec_parameters_to_context(AVCodecContext *codec, const AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
enum AVSampleFormat av_get_sample_fmt(const char *name)
Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE on error.
#define AV_TIME_BASE
Internal time base represented as integer.
static const char *const opt_name_muxing_queue_data_threshold[]
SpecifierOpt * audio_sample_rate
static int opt_video_codec(void *optctx, const char *opt, const char *arg)
static const char *const opt_name_sample_fmts[]
static int opt_qscale(void *optctx, const char *opt, const char *arg)
struct InputStream * sync_ist
AVDictionary * filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec)
Filter out options for given codec.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
@ AVMEDIA_TYPE_ATTACHMENT
Opaque data information usually sparse.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
static OutputStream * new_unknown_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
static int opt_vstats(void *optctx, const char *opt, const char *arg)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
New fields can be added to the end with minor version bumps.
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
const char * name
Name of the codec implementation.
float dts_error_threshold
static const char *const opt_name_bits_per_raw_sample[]
int opt_timelimit(void *optctx, const char *opt, const char *arg)
Limit the execution time.
FilterGraph ** filtergraphs
AVFifoBuffer * muxing_queue
const AVIOInterruptCB int_cb
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
AVCodecParameters * ref_par
static int opt_audio_frames(void *optctx, const char *opt, const char *arg)
int parse_optgroup(void *optctx, OptionGroup *g)
Parse an options group and write results into optctx.
static int opt_map_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)
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
static const char *const opt_name_force_fps[]
int id
Format-specific stream ID.
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
int max_muxing_queue_size
int read_yesno(void)
Return a positive value if a line read from standard input starts with [yY], otherwise return 0.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
double av_strtod(const char *numstr, char **tail)
Parse the string in numstr and return its value as a double.
const struct AVOutputFormat * oformat
The output container format.
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,...
int av_opt_eval_int(void *obj, const AVOption *o, const char *val, int *int_out)
void uninit_parse_context(OptionParseContext *octx)
Free all allocated memory in an OptionParseContext.
#define AV_CODEC_PROP_TEXT_SUB
Subtitle codec is text based.
AudioChannelMap * audio_channel_maps
int64_t forced_kf_ref_pts
#define AV_INPUT_BUFFER_PADDING_SIZE
enum AVCodecID av_guess_codec(const 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.
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
enum AVCodecID data_codec_id
Forced Data codec_id.
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.
main external API structure.
int index
stream index in AVFormatContext
#define CMDUTILS_COMMON_OPTIONS
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option.
static const char *const opt_name_time_bases[]
static const char * audio_codec_name
float audio_drift_threshold
static char * read_file(const char *filename)
static const char *const opt_name_forced_key_frames[]
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static const char *const opt_name_hwaccel_output_formats[]
static AVDictionary * strip_specifiers(AVDictionary *dict)
SpecifierOpt * frame_pix_fmts
const AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
int avio_open(AVIOContext **s, const char *url, int flags)
Create and initialize a AVIOContext for accessing the resource indicated by url.
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
#define GROW_ARRAY(array, nb_elems)
static int opt_vsync(void *optctx, const char *opt, const char *arg)
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.
#define AVIO_FLAG_READ
read-only
static int get_preset_file_2(const char *preset_name, const char *codec_name, AVIOContext **s)
enum AVMediaType codec_type
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.
char * av_strdup(const char *s)
Duplicate a string.
#define AVERROR_ENCODER_NOT_FOUND
Encoder not found.
static int opt_stats_period(void *optctx, const char *opt, const char *arg)
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
int64_t av_get_default_channel_layout(int nb_channels)
Return default channel layout for a given number of channels.
int video_delay
Video only.
static const char *const opt_name_intra_matrices[]
const VDPAUPixFmtMap * map
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
const char ** attachments
size_t muxing_queue_data_size
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
static const char *const opt_name_copy_prior_start[]
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
uint16_t * inter_matrix
custom inter quantization matrix Must be allocated with the av_malloc() family of functions,...
int rc_override_count
ratecontrol override, see RcOverride
static const char *const opt_name_apad[]
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.
int width
picture width / height.
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
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.
float frame_drop_threshold
void * grow_array(void *array, int elem_size, int *size, int new_size)
Realloc array to hold new_size elements of elem_size.
size_t muxing_queue_data_threshold
#define flags(name, subs,...)
static const char *const opt_name_disposition[]
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.
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds.
#define MKTAG(a, b, c, d)
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
static const char *const opt_name_qscale[]
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.
const AVClass * av_stream_get_class(void)
Get the AVClass for AVStream.
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
AVRational time_base
time base in which the start/end timestamps are specified
static const char *const opt_name_hwaccel_devices[]
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
static const char *const opt_name_discard[]
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.
#define AVERROR_PROTOCOL_NOT_FOUND
Protocol not found.
#define ABORT_ON_FLAG_EMPTY_OUTPUT
static int opt_filter_complex(void *optctx, const char *opt, const char *arg)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel.
static const char *const opt_name_inter_matrices[]
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
static const char *const opt_name_codec_tags[]
const AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.
float dts_delta_threshold
static OutputStream * new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
const AVCodec * video_codec
Forced video codec.
#define DEFAULT_PASS_LOGFILENAME_PREFIX
void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx)
int filter_complex_nbthreads
enum AVCodecID subtitle_codec_id
Forced subtitle codec_id.