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" 99 #define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\ 101 char namestr[128] = "";\ 102 const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\ 103 for (i = 0; opt_name_##name[i]; i++)\ 104 av_strlcatf(namestr, sizeof(namestr), "-%s%s", opt_name_##name[i], opt_name_##name[i+1] ? (opt_name_##name[i+2] ? ", " : " or ") : "");\ 105 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",\ 106 namestr, st->index, opt_name_##name[0], spec[0] ? ":" : "", spec, so->u.type);\ 109 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\ 111 int i, ret, matches = 0;\ 113 for (i = 0; i < o->nb_ ## name; i++) {\ 114 char *spec = o->name[i].specifier;\ 115 if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\ 116 outvar = o->name[i].u.type;\ 123 WARN_MULTIPLE_OPT_USAGE(name, type, so, st);\ 126 #define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\ 129 for (i = 0; i < o->nb_ ## name; i++) {\ 130 char *spec = o->name[i].specifier;\ 131 if (!strcmp(spec, mediatype))\ 132 outvar = o->name[i].u.type;\ 137 #if CONFIG_VIDEOTOOLBOX 202 int i, *
count = (
int*)(so + 1);
203 for (i = 0; i < *
count; i++) {
225 memset(o, 0,
sizeof(*o));
242 printf(
"Hardware acceleration methods:\n");
257 char *p = strchr(e->
key,
':');
282 const AVClass *pclass = &
class;
291 if (user_stats_period <= 0) {
305 "If you are looking for an option to preserve the quality (which is not " 306 "what -%s was for), use -qscale 0 or an equivalent quality factor option.\n",
347 static int opt_map(
void *optctx,
const char *opt,
const char *
arg)
351 int i, negative = 0, file_idx, disabled = 0;
352 int sync_file_idx = -1, sync_stream_idx = 0;
366 if (sync = strchr(map,
',')) {
368 sync_file_idx = strtol(sync + 1, &sync, 0);
383 "match any streams.\n", arg);
396 const char *
c = map + 1;
405 if (allow_unused = strchr(map,
'?'))
407 file_idx = strtol(map, &p, 0);
419 *p ==
':' ? p + 1 : p) > 0)
425 *p ==
':' ? p + 1 : p) <= 0)
437 if (sync_file_idx >= 0) {
450 }
else if (disabled) {
452 "To ignore this, add a trailing '?' to the map.\n", arg);
456 "To ignore this, add a trailing '?' to the map.\n", arg);
499 n = sscanf(arg,
"%d.%d.%d:%d.%d",
503 if (n != 3 && n != 5) {
505 "[file.stream.channel|-1][:syncfile:syncstream]\n");
531 if (allow_unused = strchr(mapchan,
'?'))
540 "To ignore this, add a trailing '?' to the map_channel.\n",
558 static int opt_vaapi_device(
void *optctx,
const char *opt,
const char *
arg)
560 const char *prefix =
"vaapi:";
574 if (!strcmp(arg,
"list")) {
576 printf(
"Supported hardware device types:\n");
589 if (filter_hw_device) {
594 if (!filter_hw_device) {
616 if (*(++arg) && *arg !=
':') {
620 *stream_spec = *arg ==
':' ? arg + 1 :
"";
625 *index = strtol(++arg,
NULL, 0);
640 char type_in, type_out;
641 const char *istream_spec =
NULL, *ostream_spec =
NULL;
642 int idx_in = 0, idx_out = 0;
648 if (type_out ==
'g' || !*outspec)
650 if (type_out ==
's' || !*outspec)
652 if (type_out ==
'c' || !*outspec)
657 if (type_in ==
'g' || type_out ==
'g')
659 if (type_in ==
's' || type_out ==
's')
661 if (type_in ==
'c' || type_out ==
'c')
668 #define METADATA_CHECK_INDEX(index, nb_elems, desc)\ 669 if ((index) < 0 || (index) >= (nb_elems)) {\ 670 av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\ 675 #define SET_DICT(type, meta, context, index)\ 678 meta = &context->metadata;\ 681 METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\ 682 meta = &context->chapters[index]->metadata;\ 685 METADATA_CHECK_INDEX(index, context->nb_programs, "program")\ 686 meta = &context->programs[index]->metadata;\ 690 default: av_assert0(0);\ 693 SET_DICT(type_in, meta_in, ic, idx_in);
694 SET_DICT(type_out, meta_out, oc, idx_out);
697 if (type_in ==
's') {
711 if (type_out ==
's') {
730 struct tm time = *gmtime((time_t*)&recording_timestamp);
731 if (!strftime(buf,
sizeof(buf),
"creation_time=%Y-%m-%dT%H:%M:%S%z", &time))
736 "tag instead.\n", opt);
743 const char *
codec_string = encoder ?
"encoder" :
"decoder";
755 codec_string, codec->
name, desc->
name);
762 if (codec->
type != type) {
771 char *codec_name =
NULL;
793 const char *hwaccel =
NULL;
794 char *hwaccel_output_format =
NULL;
795 char *codec_tag =
NULL;
797 char *discard_str =
NULL;
823 uint32_t
tag = strtol(codec_tag, &next, 0);
888 hwaccel_output_format, ic, st);
890 if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel,
"cuvid")) {
892 "WARNING: defaulting hwaccel_output_format to cuda for compatibility " 893 "with old commandlines. This behaviour is DEPRECATED and will be removed " 894 "in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n");
896 }
else if (hwaccel_output_format) {
900 "format: %s", hwaccel_output_format);
908 if (!strcmp(hwaccel,
"nvdec") || !strcmp(hwaccel,
"cuvid"))
911 if (!strcmp(hwaccel,
"none"))
913 else if (!strcmp(hwaccel,
"auto"))
918 for (i = 0; hwaccels[
i].
name; i++) {
919 if (!strcmp(hwaccels[i].
name, hwaccel)) {
949 if (hwaccel_device) {
965 char *canvas_size =
NULL;
997 fprintf(stderr,
"Error, both -y and -n supplied. Exiting.\n");
1002 if (proto_name && !strcmp(proto_name,
"file") &&
avio_check(filename, 0) == 0) {
1004 fprintf(stderr,
"File '%s' already exists. Overwrite? [y/N] ", filename);
1007 signal(SIGINT, SIG_DFL);
1021 if (proto_name && !strcmp(proto_name,
"file")) {
1026 if (!strcmp(filename, file->
ctx->
url)) {
1047 filename = e->
value;
1079 char * data_codec_name =
NULL;
1080 int scan_all_pmts_set = 0;
1104 if (!strcmp(filename,
"-"))
1108 strcmp(filename,
"/dev/stdin");
1123 if (file_iformat && file_iformat->
priv_class &&
1132 if (file_iformat && file_iformat->
priv_class &&
1150 if (video_codec_name)
1152 if (audio_codec_name)
1154 if (subtitle_codec_name)
1156 if (data_codec_name)
1171 scan_all_pmts_set = 1;
1181 if (scan_all_pmts_set)
1198 for (i = 0; i < orig_nb_streams; i++)
1237 int64_t seek_timestamp = timestamp;
1240 int dts_heuristic = 0;
1248 if (dts_heuristic) {
1304 if (!option || foption)
1310 "input file #%d (%s) is not a decoding option.\n", e->
key,
1317 "input file #%d (%s) has not been used for any stream. The most " 1318 "likely reason is either wrong type (e.g. a video option with " 1319 "no video streams) or that it is a private option of some decoder " 1320 "which was not actually used for any stream.\n", e->
key,
1352 while ((c =
avio_r8(s)) && c !=
'\n')
1363 char filename[1000];
1364 const char *
base[3] = { getenv(
"AVCONV_DATADIR"),
1373 snprintf(filename,
sizeof(filename),
"%s%s/%s-%s.avpreset", base[i],
1374 i != 1 ?
"" :
"/.avconv", codec_name, preset_name);
1378 snprintf(filename,
sizeof(filename),
"%s%s/%s.avpreset", base[i],
1379 i != 1 ?
"" :
"/.avconv", preset_name);
1389 char *codec_name =
NULL;
1399 "output stream #%d:%d. Default encoder for format %s (codec %s) is " 1400 "probably disabled. Please choose an encoder manually.\n",
1405 }
else if (!strcmp(codec_name,
"copy"))
1426 const char *bsfs =
NULL, *time_base =
NULL;
1427 char *next, *codec_tag =
NULL;
1482 if (!buf[0] || buf[0] ==
'#') {
1486 if (!(arg = strchr(buf,
'='))) {
1498 "Preset %s specified for stream %d:%d, but could not be opened.\n",
1514 q.
num <= 0 || q.
den <= 0) {
1546 if (bsfs && *bsfs) {
1556 uint32_t
tag = strtol(codec_tag, &next, 0);
1593 if (source_index >= 0) {
1610 const char *p =
str;
1642 while ((ret =
avio_read(pb, buf,
sizeof(buf))) > 0)
1678 "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n" 1679 "Filtering and streamcopy cannot be used together.\n",
1680 ost->
filters ?
"Filtergraph" :
"Filtergraph script",
1692 char *frame_rate =
NULL, *max_frame_rate =
NULL, *frame_aspect_ratio =
NULL;
1710 if (frame_rate && max_frame_rate) {
1715 if ((frame_rate || max_frame_rate) &&
1720 if (frame_aspect_ratio) {
1723 q.
num <= 0 || q.
den <= 0) {
1734 const char *p =
NULL;
1736 char *frame_pix_fmt =
NULL;
1737 char *intra_matrix =
NULL, *inter_matrix =
NULL;
1738 char *chroma_intra_matrix =
NULL;
1750 if (frame_pix_fmt && *frame_pix_fmt ==
'+') {
1752 if (!*++frame_pix_fmt)
1753 frame_pix_fmt =
NULL;
1772 if (chroma_intra_matrix) {
1791 for (i = 0; p; i++) {
1793 int e = sscanf(p,
"%d,%d,%d", &start, &end, &q);
1842 char logfilename[1024];
1845 snprintf(logfilename,
sizeof(logfilename),
"%s-%d.log",
1849 if (!strcmp(ost->
enc->name,
"libx264")) {
1853 char *logbuffer =
read_file(logfilename);
1866 "Cannot write log file '%s' for pass-1 encoding: %s\n",
1867 logfilename, strerror(errno));
1915 char *sample_fmt =
NULL;
2041 p = strchr(idx_str,
':');
2044 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
2076 if (in_ch->
end < ts_off)
2078 if (rt != INT64_MAX && in_ch->
start > rt + ts_off)
2085 out_ch->id = in_ch->
id;
2087 out_ch->start =
FFMAX(0, in_ch->
start - ts_off);
2088 out_ch->end =
FFMIN(rt, in_ch->
end - ts_off);
2103 switch (ofilter->
type) {
2120 "which is fed from a complex filtergraph. Filtering and streamcopy " 2126 const char *opt = ost->
filters ?
"-vf/-af/-filter" :
"-filter_script";
2128 "%s '%s' was specified through the %s option " 2129 "for output stream %d:%d, which is fed from a complex filtergraph.\n" 2130 "%s and -filter_complex cannot be used together for the same stream.\n",
2131 ost->
filters ?
"Filtergraph" :
"Filtergraph script",
2161 int format_flags = 0;
2191 if (!strcmp(filename,
"-"))
2225 switch (ofilter->
type) {
2240 int best_score = 0, idx = -1;
2253 score > best_score) {
2266 int best_score = 0, idx = -1;
2275 score > best_score) {
2294 int input_props = 0, output_props = 0;
2299 if (input_descriptor)
2301 if (output_descriptor)
2303 if (subtitle_codec_name ||
2304 input_props & output_props ||
2306 input_descriptor && output_descriptor &&
2307 (!input_descriptor->
props ||
2308 !output_descriptor->
props)) {
2350 "in any defined filter graph, or was already used elsewhere.\n", map->
linklabel);
2386 "Cannot map stream #%d:%d - unsupported type.\n",
2390 "If you want unsupported types ignored instead " 2391 "of failing, please use the -ignore_unknown option\n" 2392 "If you want them copied, please use -copy_unknown\n");
2440 #if FF_API_LAVF_AVCTX 2476 if (!option || foption)
2482 "output file #%d (%s) is not an encoding option.\n", e->
key,
2489 if (!strcmp(e->
key,
"gop_timecode"))
2493 "output file #%d (%s) has not been used for any stream. The most " 2494 "likely reason is either wrong type (e.g. a video option with " 2495 "no video streams) or that it is a private option of some encoder " 2496 "which was not actually used for any stream.\n", e->
key,
2514 "Error initializing a simple filtergraph between streams " 2533 }
else if (ost->
enc->pix_fmts) {
2546 }
else if (ost->
enc->sample_fmts) {
2557 }
else if (ost->
enc->supported_samplerates) {
2559 while (ost->
enc->supported_samplerates[count])
2569 }
else if (ost->
enc->channel_layouts) {
2571 while (ost->
enc->channel_layouts[count])
2594 "No input streams but output needs an input stream\n");
2623 av_log(
NULL,
AV_LOG_FATAL,
"Invalid input file index %d while processing metadata maps\n", in_file_index);
2627 in_file_index >= 0 ?
2669 if (!output_streams[i]->stream_copy) {
2682 const char *to_dealloc = p2;
2697 if (!strcmp(key,
"program_num"))
2698 progid = strtol(p2,
NULL, 0);
2708 const char *to_dealloc = p2;
2717 "No '=' character in program string %s.\n",
2725 if (!strcmp(key,
"title")) {
2727 }
else if (!strcmp(key,
"program_num")) {
2728 }
else if (!strcmp(key,
"st")) {
2729 int st_num = strtol(p2,
NULL, 0);
2744 const char *stream_spec;
2808 static const char *
const frame_rates[] = {
"25",
"30000/1001",
"24000/1001" };
2810 if (!strncmp(arg,
"pal-", 4)) {
2813 }
else if (!strncmp(arg,
"ntsc-", 5)) {
2816 }
else if (!strncmp(arg,
"film-", 5)) {
2833 }
else if ((fr == 29970) || (fr == 23976)) {
2853 if (!strcmp(arg,
"vcd")) {
2880 }
else if (!strcmp(arg,
"svcd")) {
2902 }
else if (!strcmp(arg,
"dvd")) {
2924 }
else if (!strncmp(arg,
"dv", 2)) {
2929 parse_option(o,
"pix_fmt", !strncmp(arg,
"dv50", 4) ?
"yuv422p" :
2930 norm ==
PAL ?
"yuv420p" :
"yuv411p",
options);
2957 time_t today2 = time(
NULL);
2958 struct tm *today = localtime(&today2);
2965 snprintf(filename,
sizeof(filename),
"vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
3012 char filename[1000],
line[1000], tmp_line[1000];
3013 const char *codec_name =
NULL;
3019 if (!(f =
get_preset_file(filename,
sizeof(filename), arg, *opt ==
'f', codec_name))) {
3020 if(!strncmp(arg,
"libx264-lossless", strlen(
"libx264-lossless"))){
3027 while (fgets(line,
sizeof(line), f)) {
3028 char *
key = tmp_line, *
value, *endptr;
3030 if (strcspn(line,
"#\n\r") == 0)
3032 av_strlcpy(tmp_line, line,
sizeof(tmp_line));
3046 filename, line, key, value);
3072 if(!strcmp(opt,
"ab")){
3075 }
else if(!strcmp(opt,
"b")){
3089 if(!strcmp(opt,
"qscale")){
3104 if(!strcmp(opt,
"profile")){
3154 char layout_str[32];
3165 snprintf(layout_str,
sizeof(layout_str),
"%"PRIu64, layout);
3172 snprintf(layout_str,
sizeof(layout_str),
"%d", channels);
3173 stream_str = strchr(opt,
':');
3174 ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
3229 int show_advanced = 0, show_avoptions = 0;
3232 if (!strcmp(opt,
"long"))
3234 else if (!strcmp(opt,
"full"))
3235 show_advanced = show_avoptions = 1;
3243 " -h -- print basic options\n" 3244 " -h long -- print more options\n" 3245 " -h full -- print all options (including all format and codec specific options, very long)\n" 3246 " -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol\n" 3247 " See man %s for detailed description of the options.\n" 3254 "instead of just one file):",
3282 if (show_avoptions) {
3289 #if CONFIG_SWRESAMPLE 3329 "%s.\n", inout, g->
arg);
3354 memset(&octx, 0,
sizeof(octx));
3411 if (!strcmp(arg,
"-"))
3423 #define OFFSET(x) offsetof(OptionsContext, x) 3429 "force format",
"fmt" },
3431 "overwrite output files" },
3433 "never overwrite output files" },
3435 "Ignore unknown stream types" },
3437 "Copy unknown stream types" },
3440 "codec name",
"codec" },
3443 "codec name",
"codec" },
3446 "preset name",
"preset" },
3449 "set input stream mapping",
3450 "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
3452 "map an audio channel from one stream to another",
"file.stream.channel[:syncfile.syncstream]" },
3455 "set metadata information of outfile from infile",
3456 "outfile[,metadata]:infile[,metadata]" },
3459 "set chapters mapping",
"input_file_index" },
3462 "record or transcode \"duration\" seconds of audio/video",
3465 "record or transcode stop time",
"time_stop" },
3467 "set the limit file size in bytes",
"limit_size" },
3470 "set the start time offset",
"time_off" },
3473 "set the start time offset relative to EOF",
"time_off" },
3476 "enable/disable seeking by timestamp with -ss" },
3479 "enable/disable accurate seeking with -ss" },
3482 "set the input ts offset",
"time_off" },
3485 "set the input ts scale",
"scale" },
3487 "set the recording timestamp ('now' to set the current time)",
"time" },
3489 "add metadata",
"string=string" },
3491 "add program with specified streams",
"title=string:st=number..." },
3494 "set the number of data frames to output",
"number" },
3496 "add timings for benchmarking" },
3498 "add timings for each task" },
3500 "write program-readable progress information",
"url" },
3502 "enable or disable interaction on standard input" },
3504 "set max runtime in seconds in CPU user time",
"limit" },
3506 "dump each input packet" },
3508 "when dumping packets, also dump the payload" },
3511 "read input at native frame rate",
"" },
3513 "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" " 3514 "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")",
"type" },
3516 "video sync method",
"" },
3518 "frame drop threshold",
"" },
3520 "audio sync method",
"" },
3522 "audio drift threshold",
"threshold" },
3524 "copy timestamps" },
3526 "shift input timestamps to start at 0 when using copyts" },
3528 "copy input stream time base when stream copying",
"mode" },
3531 "finish encoding within shortest input" },
3539 "timestamp discontinuity delta threshold",
"threshold" },
3541 "timestamp error delta threshold",
"threshold" },
3543 "exit on error",
"error" },
3545 "abort on the specified condition flags",
"flags" },
3548 "copy initial non-keyframes" },
3550 "copy or discard frames before start time" },
3552 "set the number of frames to output",
"number" },
3555 "force codec tag/fourcc",
"fourcc/tag" },
3558 "use fixed quality scale (VBR)",
"q" },
3561 "use fixed quality scale (VBR)",
"q" },
3563 "set profile",
"profile" },
3565 "set stream filtergraph",
"filter_graph" },
3567 "number of non-complex filter threads" },
3569 "read stream filtergraph description from a file",
"filename" },
3571 "reinit filtergraph on input parameter changes",
"" },
3573 "create a complex filtergraph",
"graph_description" },
3575 "number of threads for -filter_complex" },
3577 "create a complex filtergraph",
"graph_description" },
3579 "read complex filtergraph description from a file",
"filename" },
3581 "enable automatic conversion filters globally" },
3583 "print progress report during encoding", },
3585 "set the period at which ffmpeg updates stats and -progress output",
"time" },
3588 "add an attachment to the output file",
"filename" },
3591 "extract an attachment into a file",
"filename" },
3593 OPT_OFFSET, { .off =
OFFSET(
loop) },
"set number of times input stream shall be looped",
"loop count" },
3595 "print timestamp debugging info" },
3597 "ratio of decoding errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.",
"maximum error rate" },
3603 "disposition",
"" },
3605 { .off =
OFFSET(thread_queue_size) },
3606 "set the maximum number of queued packets from the demuxer" },
3608 "read and decode the streams to fill missing information with heuristics" },
3612 "set the number of video frames to output",
"number" },
3615 "set frame rate (Hz value, fraction or abbreviation)",
"rate" },
3618 "set max frame rate (Hz value, fraction or abbreviation)",
"rate" },
3621 "set frame size (WxH or abbreviation)",
"size" },
3624 "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)",
"aspect" },
3627 "set pixel format",
"format" },
3629 "set the number of bits per raw sample",
"number" },
3631 "deprecated use -g 1" },
3636 "rate control override for specific intervals",
"override" },
3639 "force video codec ('copy' to copy stream)",
"codec" },
3645 "set initial TimeCode value.",
"hh:mm:ss[:;.]ff" },
3647 "select the pass number (1 to 3)",
"n" },
3650 "select two pass log file name prefix",
"prefix" },
3652 "this option is deprecated, use the yadif filter instead" },
3654 "calculate PSNR of compressed frames" },
3656 "dump video coding statistics to file" },
3658 "dump video coding statistics to file",
"file" },
3660 "Version of the vstats format to use."},
3662 "set video filters",
"filter_graph" },
3665 "specify intra matrix coeffs",
"matrix" },
3668 "specify inter matrix coeffs",
"matrix" },
3671 "specify intra matrix coeffs",
"matrix" },
3674 "top=1/bottom=0/auto=-1 field first",
"" },
3677 "force video tag/fourcc",
"fourcc/tag" },
3679 "show QP histogram" },
3682 "force the selected framerate, disable the best supported framerate selection" },
3685 "set the value of an outfile streamid",
"streamIndex:value" },
3688 "force key frames at specified timestamps",
"timestamps" },
3690 "audio bitrate (please use -b:a)",
"bitrate" },
3692 "video bitrate (please use -b:v)",
"bitrate" },
3695 "use HW accelerated decoding",
"hwaccel name" },
3698 "select a device for HW acceleration",
"devicename" },
3701 "select output format used with HW accelerated decoding",
"format" },
3702 #if CONFIG_VIDEOTOOLBOX 3706 "show available HW acceleration methods" },
3709 "automatically insert correct rotate filters" },
3712 "automatically insert a scale filter at the end of the filter graph" },
3716 "set the number of audio frames to output",
"number" },
3718 "set audio quality (codec-specific)",
"quality", },
3721 "set audio sampling rate (in Hz)",
"rate" },
3724 "set number of audio channels",
"channels" },
3729 "force audio codec ('copy' to copy stream)",
"codec" },
3732 "force audio tag/fourcc",
"fourcc/tag" },
3734 "change audio volume (256=normal)" ,
"volume" },
3737 "set sample format",
"format" },
3740 "set channel layout",
"layout" },
3742 "set audio filters",
"filter_graph" },
3744 "set the maximum number of channels to try to guess the channel layout" },
3748 "disable subtitle" },
3750 "force subtitle codec ('copy' to copy stream)",
"codec" },
3752 ,
"force subtitle tag/fourcc",
"fourcc/tag" },
3754 "fix subtitles duration" },
3756 "set canvas size (WxH or abbreviation)",
"size" },
3760 "deprecated, use -channel",
"channel" },
3762 "deprecated, use -standard",
"standard" },
3767 "set the maximum demux-decode delay",
"seconds" },
3769 "set the initial demux-decode delay",
"seconds" },
3771 "specify a file in which to print sdp information",
"file" },
3774 "set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5)",
"ratio" },
3776 "set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). " 3777 "two special values are defined - " 3778 "0 = use frame rate (video) or sample rate (audio)," 3779 "-1 = match source time base",
"ratio" },
3782 "A comma-separated list of bitstream filters",
"bitstream_filters" },
3784 "deprecated",
"audio bitstream_filters" },
3786 "deprecated",
"video bitstream_filters" },
3789 "set the audio options to the indicated preset",
"preset" },
3791 "set the video options to the indicated preset",
"preset" },
3793 "set the subtitle options to the indicated preset",
"preset" },
3795 "set options from indicated preset file",
"filename" },
3798 "maximum number of packets that can be buffered while waiting for all streams to initialize",
"packets" },
3800 "set the threshold after which max_muxing_queue_size is taken into account",
"bytes" },
3804 "force data codec ('copy' to copy stream)",
"codec" },
3810 "set VAAPI hardware device (DRM path or X11 display name)",
"device" },
3815 "set QSV hardware device (DirectX adapter index, DRM path or X11 display name)",
"device"},
3819 "initialise hardware device",
"args" },
3821 "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)
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
int64_t avio_size(AVIOContext *s)
Get the filesize.
#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.
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
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)
#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 event_flags
Flags indicating events happening on the stream, a combination of AVSTREAM_EVENT_FLAG_*.
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the given stream matches a stream specifier.
AVRational max_frame_rate
FILE * av_fopen_utf8(const char *path, const char *mode)
Open a file using a UTF-8 filename.
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)
static const char *const opt_name_discard[]
#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.
static const char *const opt_name_muxing_queue_data_threshold[]
char * stats_in
pass2 encoding statistics input buffer Concatenated stuff from stats_out of pass1 should be placed he...
static const char *const opt_name_frame_aspect_ratios[]
static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata)
#define FF_ARRAY_ELEMS(a)
static int file_overwrite
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static OutputStream * new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index)
static int find_stream_info
const AVClass * sws_get_class(void)
Get the AVClass for swsContext.
static const char *const opt_name_force_fps[]
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
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.
static const char *const opt_name_guess_layout_max[]
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 format(the sample packing is implied by the sample format) and sample rate.The lists are not just lists
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
#define CMDUTILS_COMMON_OPTIONS
This struct describes the properties of an encoded stream.
int64_t start_time
start time in microseconds == AV_TIME_BASE units
static const char *const opt_name_max_frames[]
static int opt_preset(void *optctx, const char *opt, const char *arg)
static const Preset presets[]
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 int opt_audio_qscale(void *optctx, const char *opt, const char *arg)
static const char *const opt_name_filter_scripts[]
static const AVCodec * choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
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.
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
int copy_initial_nonkeyframes
enum AVSampleFormat sample_fmt
audio sample format
static const char *const opt_name_copy_initial_nonkeyframes[]
Opaque data information usually continuous.
int opt_default(void *optctx, const char *opt, const char *arg)
Fallback for options that are not explicitly handled, these will be parsed through AVOptions...
static int open_input_file(OptionsContext *o, const char *filename)
static const OptionGroupDef groups[]
static int opt_sdp_file(void *optctx, const char *opt, const char *arg)
uint16_t * chroma_intra_matrix
custom intra quantization matrix
int id
unique ID to identify the chapter
Undefined Behavior In the C some operations are like signed integer derefere