25 #if HAVE_SYS_RESOURCE_H
27 #include <sys/resource.h>
55 #define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
57 #define SPECIFIER_OPT_FMT_str "%s"
58 #define SPECIFIER_OPT_FMT_i "%i"
59 #define SPECIFIER_OPT_FMT_i64 "%"PRId64
60 #define SPECIFIER_OPT_FMT_ui64 "%"PRIu64
61 #define SPECIFIER_OPT_FMT_f "%f"
62 #define SPECIFIER_OPT_FMT_dbl "%lf"
111 #define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\
113 char namestr[128] = "";\
114 const char *spec = so->specifier && so->specifier[0] ? so->specifier : "";\
115 for (i = 0; opt_name_##name[i]; i++)\
116 av_strlcatf(namestr, sizeof(namestr), "-%s%s", opt_name_##name[i], opt_name_##name[i+1] ? (opt_name_##name[i+2] ? ", " : " or ") : "");\
117 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",\
118 namestr, st->index, opt_name_##name[0], spec[0] ? ":" : "", spec, so->u.type);\
121 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
123 int i, ret, matches = 0;\
125 for (i = 0; i < o->nb_ ## name; i++) {\
126 char *spec = o->name[i].specifier;\
127 if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0) {\
128 outvar = o->name[i].u.type;\
135 WARN_MULTIPLE_OPT_USAGE(name, type, so, st);\
138 #define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\
141 for (i = 0; i < o->nb_ ## name; i++) {\
142 char *spec = o->name[i].specifier;\
143 if (!strcmp(spec, mediatype))\
144 outvar = o->name[i].u.type;\
198 void *dst = (uint8_t*)o + po->
u.
off;
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,
':');
289 const AVClass *pclass = &
class;
298 if (user_stats_period <= 0) {
333 static int opt_map(
void *optctx,
const char *opt,
const char *
arg)
337 int i, negative = 0, file_idx, disabled = 0;
338 int sync_file_idx = -1, sync_stream_idx = 0;
352 if (sync = strchr(
map,
',')) {
354 sync_file_idx = strtol(sync + 1, &sync, 0);
369 "match any streams.\n",
arg);
382 const char *
c =
map + 1;
391 if (allow_unused = strchr(
map,
'?'))
393 file_idx = strtol(
map, &p, 0);
405 *p ==
':' ? p + 1 : p) > 0)
411 *p ==
':' ? p + 1 : p) <= 0)
423 if (sync_file_idx >= 0) {
436 }
else if (disabled) {
438 "To ignore this, add a trailing '?' to the map.\n",
arg);
442 "To ignore this, add a trailing '?' to the map.\n",
arg);
485 n = sscanf(
arg,
"%d.%d.%d:%d.%d",
489 if (n != 3 && n != 5) {
491 "[file.stream.channel|-1][:syncfile:syncstream]\n");
517 if (allow_unused = strchr(mapchan,
'?'))
526 "To ignore this, add a trailing '?' to the map_channel.\n",
544 static int opt_vaapi_device(
void *optctx,
const char *opt,
const char *
arg)
546 const char *prefix =
"vaapi:";
559 static int opt_qsv_device(
void *optctx,
const char *opt,
const char *
arg)
561 const char *prefix =
"qsv=__qsv_device:hw_any,child_device=";
577 if (!strcmp(
arg,
"list")) {
579 printf(
"Supported hardware device types:\n");
619 if (*(++
arg) && *
arg !=
':') {
623 *stream_spec = *
arg ==
':' ?
arg + 1 :
"";
643 char type_in, type_out;
644 const char *istream_spec =
NULL, *ostream_spec =
NULL;
645 int idx_in = 0, idx_out = 0;
651 if (type_out ==
'g' || !*outspec)
653 if (type_out ==
's' || !*outspec)
655 if (type_out ==
'c' || !*outspec)
660 if (type_in ==
'g' || type_out ==
'g')
662 if (type_in ==
's' || type_out ==
's')
664 if (type_in ==
'c' || type_out ==
'c')
671 #define METADATA_CHECK_INDEX(index, nb_elems, desc)\
672 if ((index) < 0 || (index) >= (nb_elems)) {\
673 av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\
678 #define SET_DICT(type, meta, context, index)\
681 meta = &context->metadata;\
684 METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\
685 meta = &context->chapters[index]->metadata;\
688 METADATA_CHECK_INDEX(index, context->nb_programs, "program")\
689 meta = &context->programs[index]->metadata;\
693 default: av_assert0(0);\
696 SET_DICT(type_in, meta_in, ic, idx_in);
697 SET_DICT(type_out, meta_out, oc, idx_out);
700 if (type_in ==
's') {
714 if (type_out ==
's') {
733 struct tm time = *gmtime((time_t*)&recording_timestamp);
734 if (!strftime(buf,
sizeof(buf),
"creation_time=%Y-%m-%dT%H:%M:%S%z", &time))
739 "tag instead.\n", opt);
746 const char *
codec_string = encoder ?
"encoder" :
"decoder";
774 char *codec_name =
NULL;
798 const char *hwaccel =
NULL;
799 char *hwaccel_output_format =
NULL;
800 char *codec_tag =
NULL;
802 char *discard_str =
NULL;
825 uint32_t
tag = strtol(codec_tag, &next, 0);
899 hwaccel_output_format, ic, st);
901 if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel,
"cuvid")) {
903 "WARNING: defaulting hwaccel_output_format to cuda for compatibility "
904 "with old commandlines. This behaviour is DEPRECATED and will be removed "
905 "in the future. Please explicitly set \"-hwaccel_output_format cuda\".\n");
907 }
else if (!hwaccel_output_format && hwaccel && !strcmp(hwaccel,
"qsv")) {
909 "WARNING: defaulting hwaccel_output_format to qsv for compatibility "
910 "with old commandlines. This behaviour is DEPRECATED and will be removed "
911 "in the future. Please explicitly set \"-hwaccel_output_format qsv\".\n");
913 }
else if (hwaccel_output_format) {
917 "format: %s", hwaccel_output_format);
925 if (!strcmp(hwaccel,
"nvdec") || !strcmp(hwaccel,
"cuvid"))
928 if (!strcmp(hwaccel,
"none"))
930 else if (!strcmp(hwaccel,
"auto"))
955 if (hwaccel_device) {
971 char *canvas_size =
NULL;
1003 fprintf(stderr,
"Error, both -y and -n supplied. Exiting.\n");
1008 if (proto_name && !strcmp(proto_name,
"file") &&
avio_check(filename, 0) == 0) {
1010 fprintf(stderr,
"File '%s' already exists. Overwrite? [y/N] ", filename);
1013 signal(SIGINT, SIG_DFL);
1027 if (proto_name && !strcmp(proto_name,
"file")) {
1032 if (!strcmp(filename, file->
ctx->
url)) {
1053 filename = e->
value;
1085 char * data_codec_name =
NULL;
1086 int scan_all_pmts_set = 0;
1110 if (!strcmp(filename,
"-"))
1114 strcmp(filename,
"/dev/stdin");
1171 if (data_codec_name)
1186 scan_all_pmts_set = 1;
1196 if (scan_all_pmts_set)
1213 for (
i = 0;
i < orig_nb_streams;
i++)
1252 int64_t seek_timestamp = timestamp;
1255 int dts_heuristic = 0;
1263 if (dts_heuristic) {
1296 if (
f->readrate < 0.0f) {
1300 if (
f->readrate &&
f->rate_emu) {
1335 "input file #%d (%s) is not a decoding option.\n", e->
key,
1342 "input file #%d (%s) has not been used for any stream. The most "
1343 "likely reason is either wrong type (e.g. a video option with "
1344 "no video streams) or that it is a private option of some decoder "
1345 "which was not actually used for any stream.\n", e->
key,
1383 char filename[1000];
1384 const char *
base[3] = { getenv(
"AVCONV_DATADIR"),
1393 snprintf(filename,
sizeof(filename),
"%s%s/%s-%s.avpreset",
base[
i],
1394 i != 1 ?
"" :
"/.avconv", codec_name, preset_name);
1398 snprintf(filename,
sizeof(filename),
"%s%s/%s.avpreset",
base[
i],
1399 i != 1 ?
"" :
"/.avconv", preset_name);
1409 char *codec_name =
NULL;
1419 "output stream #%d:%d. Default encoder for format %s (codec %s) is "
1420 "probably disabled. Please choose an encoder manually.\n",
1425 }
else if (!strcmp(codec_name,
"copy"))
1426 ost->stream_copy = 1;
1431 ost->encoding_needed = !
ost->stream_copy;
1434 ost->stream_copy = 1;
1435 ost->encoding_needed = 0;
1446 const char *bsfs =
NULL, *time_base =
NULL;
1447 char *next, *codec_tag =
NULL;
1475 if (!
ost->enc_ctx) {
1479 ost->enc_ctx->codec_type =
type;
1482 if (!
ost->ref_par) {
1488 if (!
ost->filtered_frame)
1510 if (!buf[0] || buf[0] ==
'#')
1512 if (!(
arg = strchr(buf,
'='))) {
1518 }
while (!
s->eof_reached);
1524 "Preset %s specified for stream %d:%d, but could not be opened.\n",
1540 q.
num <= 0 || q.
den <= 0) {
1555 ost->enc_timebase = q;
1558 ost->max_frames = INT64_MAX;
1568 ost->copy_prior_start = -1;
1572 if (bsfs && *bsfs) {
1582 uint32_t
tag = strtol(codec_tag, &next, 0);
1586 ost->enc_ctx->codec_tag =
tag;
1598 ost->max_muxing_queue_size = 128;
1601 ost->muxing_queue_data_size = 0;
1603 ost->muxing_queue_data_threshold = 50*1024*1024;
1618 ost->source_index = source_index;
1619 if (source_index >= 0) {
1627 if (!
ost->muxing_queue)
1631 ost->copy_initial_nonkeyframes, oc, st);
1639 const char *p =
str;
1684 if (
ost->filters_script &&
ost->filters) {
1690 if (
ost->filters_script)
1692 else if (
ost->filters)
1702 if (
ost->filters_script ||
ost->filters) {
1704 "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n"
1705 "Filtering and streamcopy cannot be used together.\n",
1706 ost->filters ?
"Filtergraph" :
"Filtergraph script",
1707 ost->filters ?
ost->filters :
ost->filters_script,
1718 char *frame_rate =
NULL, *max_frame_rate =
NULL, *frame_aspect_ratio =
NULL;
1722 video_enc =
ost->enc_ctx;
1736 if (frame_rate && max_frame_rate) {
1741 if ((frame_rate || max_frame_rate) &&
1743 av_log(
NULL,
AV_LOG_ERROR,
"Using -vsync passthrough and -r/-fpsmax can produce invalid output files\n");
1746 if (frame_aspect_ratio) {
1749 q.
num <= 0 || q.
den <= 0) {
1753 ost->frame_aspect_ratio = q;
1759 if (!
ost->stream_copy) {
1760 const char *p =
NULL;
1762 char *frame_pix_fmt =
NULL;
1763 char *intra_matrix =
NULL, *inter_matrix =
NULL;
1764 char *chroma_intra_matrix =
NULL;
1775 if (frame_pix_fmt && *frame_pix_fmt ==
'+') {
1776 ost->keep_pix_fmt = 1;
1777 if (!*++frame_pix_fmt)
1778 frame_pix_fmt =
NULL;
1795 if (chroma_intra_matrix) {
1814 for (
i = 0; p;
i++) {
1816 int e = sscanf(p,
"%d,%d,%d", &start, &end, &q);
1860 if (
ost->logfile_prefix &&
1865 char logfilename[1024];
1868 snprintf(logfilename,
sizeof(logfilename),
"%s-%d.log",
1869 ost->logfile_prefix ?
ost->logfile_prefix :
1872 if (!strcmp(
ost->enc->name,
"libx264")) {
1876 char *logbuffer =
read_file(logfilename);
1889 "Cannot write log file '%s' for pass-1 encoding: %s\n",
1890 logfilename, strerror(errno));
1899 if (
ost->forced_keyframes)
1904 ost->top_field_first = -1;
1922 if (
ifile->nb_streams == 1 &&
ifile->input_ts_offset == 0)
1937 if (!
ost->last_frame)
1941 if (
ost->stream_copy)
1957 audio_enc =
ost->enc_ctx;
1963 if (!
ost->stream_copy) {
1966 char *sample_fmt =
NULL;
1977 #if FF_API_OLD_CHANNEL_LAYOUT
1986 #if FF_API_OLD_CHANNEL_LAYOUT
2014 if ((
map->ofile_idx == -1 ||
ost->file_index ==
map->ofile_idx) &&
2015 (
map->ostream_idx == -1 ||
ost->st->
index ==
map->ostream_idx)) {
2018 if (
map->channel_idx == -1) {
2020 }
else if (
ost->source_index < 0) {
2030 ost->audio_channels_mapped + 1,
2031 sizeof(*
ost->audio_channels_map)
2035 ost->audio_channels_map[
ost->audio_channels_mapped++] =
map->channel_idx;
2041 if (
ost->stream_copy)
2052 if (!
ost->stream_copy) {
2065 if (!
ost->stream_copy) {
2076 ost->stream_copy = 1;
2089 subtitle_enc =
ost->enc_ctx;
2093 if (!
ost->stream_copy) {
2115 p = strchr(idx_str,
':');
2118 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
2141 for (
i = 0;
i <
is->nb_chapters;
i++) {
2146 int64_t rt = (
ofile->recording_time == INT64_MAX) ? INT64_MAX :
2150 if (in_ch->
end < ts_off)
2152 if (rt != INT64_MAX && in_ch->
start > rt + ts_off)
2159 out_ch->id = in_ch->
id;
2161 out_ch->start =
FFMAX(0, in_ch->
start - ts_off);
2162 out_ch->end =
FFMIN(rt, in_ch->
end - ts_off);
2176 int have_manual = 0;
2186 if (
ost->source_index >= 0) {
2203 #if LIBAVFORMAT_VERSION_MAJOR >= 60
2231 have_default[
type] = 1;
2243 switch (ofilter->
type) {
2252 ost->filter = ofilter;
2257 if (
ost->stream_copy) {
2259 "which is fed from a complex filtergraph. Filtering and streamcopy "
2260 "cannot be used together.\n",
ost->file_index,
ost->
index);
2264 if (
ost->avfilter && (
ost->filters ||
ost->filters_script)) {
2265 const char *opt =
ost->filters ?
"-vf/-af/-filter" :
"-filter_script";
2267 "%s '%s' was specified through the %s option "
2268 "for output stream %d:%d, which is fed from a complex filtergraph.\n"
2269 "%s and -filter_complex cannot be used together for the same stream.\n",
2270 ost->filters ?
"Filtergraph" :
"Filtergraph script",
2271 ost->filters ?
ost->filters :
ost->filters_script,
2326 if (!strcmp(filename,
"-"))
2355 switch (ofilter->
type) {
2370 int best_score = 0, idx = -1;
2374 int file_best_score = 0, file_best_idx = -1;
2375 for (
i = 0;
i <
ifile->nb_streams;
i++) {
2386 score > file_best_score) {
2389 file_best_score = score;
2390 file_best_idx =
ifile->ist_index +
i;
2393 if (file_best_idx >= 0) {
2396 if (file_best_score > best_score) {
2397 best_score = file_best_score;
2398 idx = file_best_idx;
2408 int best_score = 0, idx = -1;
2411 int file_best_score = 0, file_best_idx = -1;
2412 for (
i = 0;
i <
ifile->nb_streams;
i++) {
2421 score > file_best_score) {
2422 file_best_score = score;
2423 file_best_idx =
ifile->ist_index +
i;
2426 if (file_best_idx >= 0) {
2428 if (file_best_score > best_score) {
2429 best_score = file_best_score;
2430 idx = file_best_idx;
2448 int input_props = 0, output_props = 0;
2453 if (input_descriptor)
2455 if (output_descriptor)
2458 input_props & output_props ||
2460 input_descriptor && output_descriptor &&
2461 (!input_descriptor->
props ||
2462 !output_descriptor->
props)) {
2486 if (
map->linklabel) {
2495 if (
out && !strcmp(
out->name,
map->linklabel)) {
2504 "in any defined filter graph, or was already used elsewhere.\n",
map->linklabel);
2514 map->file_index,
map->stream_index);
2540 "Cannot map stream #%d:%d - unsupported type.\n",
2541 map->file_index,
map->stream_index);
2544 "If you want unsupported types ignored instead "
2545 "of failing, please use the -ignore_unknown option\n"
2546 "If you want them copied, please use -copy_unknown\n");
2552 +
map->sync_stream_index];
2560 uint8_t *attachment;
2584 ost->stream_copy = 0;
2623 "output file #%d (%s) is not an encoding option.\n", e->
key,
2630 if (!strcmp(e->
key,
"gop_timecode"))
2634 "output file #%d (%s) has not been used for any stream. The most "
2635 "likely reason is either wrong type (e.g. a video option with "
2636 "no video streams) or that it is a private option of some encoder "
2637 "which was not actually used for any stream.\n", e->
key,
2646 if (
ost->encoding_needed &&
ost->source_index >= 0) {
2656 "Error initializing a simple filtergraph between streams "
2662 }
else if (
ost->stream_copy &&
ost->source_index >= 0) {
2670 switch (
ost->enc_ctx->codec_type) {
2672 f->frame_rate =
ost->frame_rate;
2673 f->width =
ost->enc_ctx->width;
2674 f->height =
ost->enc_ctx->height;
2676 f->format =
ost->enc_ctx->pix_fmt;
2678 f->formats =
ost->enc->pix_fmts;
2683 f->format =
ost->enc_ctx->sample_fmt;
2685 f->formats =
ost->enc->sample_fmts;
2687 if (
ost->enc_ctx->sample_rate) {
2688 f->sample_rate =
ost->enc_ctx->sample_rate;
2690 f->sample_rates =
ost->enc->supported_samplerates;
2692 if (
ost->enc_ctx->ch_layout.nb_channels) {
2694 }
else if (
ost->enc->ch_layouts) {
2695 f->ch_layouts =
ost->enc->ch_layouts;
2712 "No input streams but output needs an input stream\n");
2741 av_log(
NULL,
AV_LOG_FATAL,
"Invalid input file index %d while processing metadata maps\n", in_file_index);
2745 in_file_index >= 0 ?
2800 const char *to_dealloc = p2;
2815 if (!strcmp(
key,
"program_num"))
2816 progid = strtol(p2,
NULL, 0);
2826 const char *to_dealloc = p2;
2835 "No '=' character in program string %s.\n",
2843 if (!strcmp(
key,
"title")) {
2845 }
else if (!strcmp(
key,
"program_num")) {
2846 }
else if (!strcmp(
key,
"st")) {
2847 int st_num = strtol(p2,
NULL, 0);
2862 const char *stream_spec;
2882 ost->rotate_overridden = 1;
2883 ost->rotate_override_value = theta;
2932 static const char *
const frame_rates[] = {
"25",
"30000/1001",
"24000/1001" };
2934 if (!strncmp(
arg,
"pal-", 4)) {
2937 }
else if (!strncmp(
arg,
"ntsc-", 5)) {
2940 }
else if (!strncmp(
arg,
"film-", 5)) {
2957 }
else if ((fr == 29970) || (fr == 23976)) {
2977 if (!strcmp(
arg,
"vcd")) {
3004 }
else if (!strcmp(
arg,
"svcd")) {
3026 }
else if (!strcmp(
arg,
"dvd")) {
3048 }
else if (!strncmp(
arg,
"dv", 2)) {
3054 norm ==
PAL ?
"yuv420p" :
"yuv411p",
options);
3081 time_t today2 = time(
NULL);
3082 struct tm *today = localtime(&today2);
3089 snprintf(filename,
sizeof(filename),
"vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
3136 char filename[1000],
line[1000], tmp_line[1000];
3137 const char *codec_name =
NULL;
3144 if(!strncmp(
arg,
"libx264-lossless", strlen(
"libx264-lossless"))){
3152 char *
key = tmp_line, *
value, *endptr;
3154 if (strcspn(
line,
"#\n\r") == 0)
3196 if(!strcmp(opt,
"ab")){
3199 }
else if(!strcmp(opt,
"b")){
3213 if(!strcmp(opt,
"qscale")){
3228 if(!strcmp(opt,
"profile")){
3259 " use a string argument as described in the manual.\n");
3318 int show_advanced = 0, show_avoptions = 0;
3321 if (!strcmp(opt,
"long"))
3323 else if (!strcmp(opt,
"full"))
3324 show_advanced = show_avoptions = 1;
3332 " -h -- print basic options\n"
3333 " -h long -- print more options\n"
3334 " -h full -- print all options (including all format and codec specific options, very long)\n"
3335 " -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol\n"
3336 " See man %s for detailed description of the options.\n"
3343 "instead of just one file):",
3371 if (show_avoptions) {
3378 #if CONFIG_SWRESAMPLE
3400 [GROUP_INFILE] = {
"input url",
"i",
OPT_INPUT },
3418 "%s.\n", inout,
g->arg);
3443 memset(&octx, 0,
sizeof(octx));
3495 static int opt_progress(
void *optctx,
const char *opt,
const char *
arg)
3500 if (!strcmp(
arg,
"-"))
3516 struct rlimit rl = { lim, lim + 1 };
3517 if (setrlimit(RLIMIT_CPU, &rl))
3518 perror(
"setrlimit");
3525 #define OFFSET(x) offsetof(OptionsContext, x)
3531 "force format",
"fmt" },
3533 "overwrite output files" },
3535 "never overwrite output files" },
3537 "Ignore unknown stream types" },
3539 "Copy unknown stream types" },
3541 "allow recasting stream type in order to force a decoder of different media type" },
3544 "codec name",
"codec" },
3547 "codec name",
"codec" },
3550 "preset name",
"preset" },
3553 "set input stream mapping",
3554 "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
3556 "map an audio channel from one stream to another",
"file.stream.channel[:syncfile.syncstream]" },
3559 "set metadata information of outfile from infile",
3560 "outfile[,metadata]:infile[,metadata]" },
3563 "set chapters mapping",
"input_file_index" },
3566 "record or transcode \"duration\" seconds of audio/video",
3569 "record or transcode stop time",
"time_stop" },
3571 "set the limit file size in bytes",
"limit_size" },
3574 "set the start time offset",
"time_off" },
3577 "set the start time offset relative to EOF",
"time_off" },
3580 "enable/disable seeking by timestamp with -ss" },
3583 "enable/disable accurate seeking with -ss" },
3586 "set the input ts offset",
"time_off" },
3589 "set the input ts scale",
"scale" },
3591 "set the recording timestamp ('now' to set the current time)",
"time" },
3593 "add metadata",
"string=string" },
3595 "add program with specified streams",
"title=string:st=number..." },
3598 "set the number of data frames to output",
"number" },
3600 "add timings for benchmarking" },
3602 "add timings for each task" },
3604 "write program-readable progress information",
"url" },
3606 "enable or disable interaction on standard input" },
3608 "set max runtime in seconds in CPU user time",
"limit" },
3610 "dump each input packet" },
3612 "when dumping packets, also dump the payload" },
3615 "read input at native frame rate; equivalent to -readrate 1",
"" },
3618 "read input at specified rate",
"speed" },
3620 "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" "
3621 "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")",
"type" },
3623 "video sync method",
"" },
3625 "frame drop threshold",
"" },
3627 "audio sync method",
"" },
3629 "audio drift threshold",
"threshold" },
3631 "copy timestamps" },
3633 "shift input timestamps to start at 0 when using copyts" },
3635 "copy input stream time base when stream copying",
"mode" },
3638 "finish encoding within shortest input" },
3646 "timestamp discontinuity delta threshold",
"threshold" },
3648 "timestamp error delta threshold",
"threshold" },
3650 "exit on error",
"error" },
3652 "abort on the specified condition flags",
"flags" },
3655 "copy initial non-keyframes" },
3657 "copy or discard frames before start time" },
3659 "set the number of frames to output",
"number" },
3662 "force codec tag/fourcc",
"fourcc/tag" },
3665 "use fixed quality scale (VBR)",
"q" },
3668 "use fixed quality scale (VBR)",
"q" },
3670 "set profile",
"profile" },
3672 "set stream filtergraph",
"filter_graph" },
3674 "number of non-complex filter threads" },
3676 "read stream filtergraph description from a file",
"filename" },
3678 "reinit filtergraph on input parameter changes",
"" },
3680 "create a complex filtergraph",
"graph_description" },
3682 "number of threads for -filter_complex" },
3684 "create a complex filtergraph",
"graph_description" },
3686 "read complex filtergraph description from a file",
"filename" },
3688 "enable automatic conversion filters globally" },
3690 "print progress report during encoding", },
3692 "set the period at which ffmpeg updates stats and -progress output",
"time" },
3695 "add an attachment to the output file",
"filename" },
3698 "extract an attachment into a file",
"filename" },
3700 OPT_OFFSET, { .off =
OFFSET(
loop) },
"set number of times input stream shall be looped",
"loop count" },
3702 "print timestamp debugging info" },
3704 "ratio of decoding errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.",
"maximum error rate" },
3710 "disposition",
"" },
3712 { .off =
OFFSET(thread_queue_size) },
3713 "set the maximum number of queued packets from the demuxer" },
3715 "read and decode the streams to fill missing information with heuristics" },
3717 { .off =
OFFSET(bits_per_raw_sample) },
3718 "set the number of bits per raw sample",
"number" },
3722 "set the number of video frames to output",
"number" },
3725 "set frame rate (Hz value, fraction or abbreviation)",
"rate" },
3728 "set max frame rate (Hz value, fraction or abbreviation)",
"rate" },
3731 "set frame size (WxH or abbreviation)",
"size" },
3734 "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)",
"aspect" },
3737 "set pixel format",
"format" },
3742 "rate control override for specific intervals",
"override" },
3745 "force video codec ('copy' to copy stream)",
"codec" },
3747 "set initial TimeCode value.",
"hh:mm:ss[:;.]ff" },
3749 "select the pass number (1 to 3)",
"n" },
3752 "select two pass log file name prefix",
"prefix" },
3754 "calculate PSNR of compressed frames" },
3756 "dump video coding statistics to file" },
3758 "dump video coding statistics to file",
"file" },
3760 "Version of the vstats format to use."},
3762 "set video filters",
"filter_graph" },
3765 "specify intra matrix coeffs",
"matrix" },
3768 "specify inter matrix coeffs",
"matrix" },
3771 "specify intra matrix coeffs",
"matrix" },
3774 "top=1/bottom=0/auto=-1 field first",
"" },
3777 "force video tag/fourcc",
"fourcc/tag" },
3779 "show QP histogram" },
3782 "force the selected framerate, disable the best supported framerate selection" },
3785 "set the value of an outfile streamid",
"streamIndex:value" },
3788 "force key frames at specified timestamps",
"timestamps" },
3790 "audio bitrate (please use -b:a)",
"bitrate" },
3792 "video bitrate (please use -b:v)",
"bitrate" },
3795 "use HW accelerated decoding",
"hwaccel name" },
3798 "select a device for HW acceleration",
"devicename" },
3801 "select output format used with HW accelerated decoding",
"format" },
3803 "show available HW acceleration methods" },
3806 "automatically insert correct rotate filters" },
3809 "automatically insert a scale filter at the end of the filter graph" },
3813 "set the number of audio frames to output",
"number" },
3815 "set audio quality (codec-specific)",
"quality", },
3818 "set audio sampling rate (in Hz)",
"rate" },
3821 "set number of audio channels",
"channels" },
3826 "force audio codec ('copy' to copy stream)",
"codec" },
3829 "force audio tag/fourcc",
"fourcc/tag" },
3831 "change audio volume (256=normal)" ,
"volume" },
3834 "set sample format",
"format" },
3837 "set channel layout",
"layout" },
3840 "set channel layout",
"layout" },
3842 "set audio filters",
"filter_graph" },
3844 "set the maximum number of channels to try to guess the channel layout" },
3848 "disable subtitle" },
3850 "force subtitle codec ('copy' to copy stream)",
"codec" },
3852 ,
"force subtitle tag/fourcc",
"fourcc/tag" },
3854 "fix subtitles duration" },
3856 "set canvas size (WxH or abbreviation)",
"size" },
3860 "set the maximum demux-decode delay",
"seconds" },
3862 "set the initial demux-decode delay",
"seconds" },
3864 "specify a file in which to print sdp information",
"file" },
3867 "set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5)",
"ratio" },
3869 "set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). "
3870 "two special values are defined - "
3871 "0 = use frame rate (video) or sample rate (audio),"
3872 "-1 = match source time base",
"ratio" },
3875 "A comma-separated list of bitstream filters",
"bitstream_filters" },
3877 "deprecated",
"audio bitstream_filters" },
3879 "deprecated",
"video bitstream_filters" },
3882 "set the audio options to the indicated preset",
"preset" },
3884 "set the video options to the indicated preset",
"preset" },
3886 "set the subtitle options to the indicated preset",
"preset" },
3888 "set options from indicated preset file",
"filename" },
3891 "maximum number of packets that can be buffered while waiting for all streams to initialize",
"packets" },
3893 "set the threshold after which max_muxing_queue_size is taken into account",
"bytes" },
3897 "force data codec ('copy' to copy stream)",
"codec" },
3903 "set VAAPI hardware device (DRM path or X11 display name)",
"device" },
3908 "set QSV hardware device (DirectX adapter index, DRM path or X11 display name)",
"device"},
3912 "initialise hardware device",
"args" },
3914 "set hardware device used when filtering",
"device" },