Go to the documentation of this file.
45 #define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass"
47 #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
50 for (i = 0; i < o->nb_ ## name; i++) {\
51 char *spec = o->name[i].specifier;\
52 if ((ret = check_stream_specifier(fmtctx, st, spec)) > 0)\
53 outvar = o->name[i].u.type;\
59 #define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\
62 for (i = 0; i < o->nb_ ## name; i++) {\
63 char *spec = o->name[i].specifier;\
64 if (!strcmp(spec, mediatype))\
65 outvar = o->name[i].u.type;\
70 #if CONFIG_VIDEOTOOLBOX
137 int i, *
count = (
int*)(so + 1);
160 memset(o, 0,
sizeof(*o));
177 printf(
"Hardware acceleration methods:\n");
194 char *p = strchr(e->
key,
':');
218 const AVClass *pclass = &
class;
226 "If you are looking for an option to preserve the quality (which is not "
227 "what -%s was for), use -qscale 0 or an equivalent quality factor option.\n",
268 static int opt_map(
void *optctx,
const char *opt,
const char *
arg)
272 int i, negative = 0, file_idx, disabled = 0;
273 int sync_file_idx = -1, sync_stream_idx = 0;
287 if (sync = strchr(
map,
',')) {
289 sync_file_idx = strtol(sync + 1, &sync, 0);
304 "match any streams.\n",
arg);
317 const char *
c =
map + 1;
326 if (allow_unused = strchr(
map,
'?'))
328 file_idx = strtol(
map, &p, 0);
340 *p ==
':' ? p + 1 : p) > 0)
346 *p ==
':' ? p + 1 : p) <= 0)
358 if (sync_file_idx >= 0) {
371 }
else if (disabled) {
373 "To ignore this, add a trailing '?' to the map.\n",
arg);
377 "To ignore this, add a trailing '?' to the map.\n",
arg);
420 n = sscanf(
arg,
"%d.%d.%d:%d.%d",
424 if (
n != 3 &&
n != 5) {
426 "[file.stream.channel|-1][:syncfile:syncstream]\n");
452 if (allow_unused = strchr(mapchan,
'?'))
461 "To ignore this, add a trailing '?' to the map_channel.\n",
479 static int opt_vaapi_device(
void *optctx,
const char *opt,
const char *
arg)
482 const char *prefix =
"vaapi:";
501 if (!strcmp(
arg,
"list")) {
503 printf(
"Supported hardware device types:\n");
543 if (*(++
arg) && *
arg !=
':') {
547 *stream_spec = *
arg ==
':' ?
arg + 1 :
"";
567 char type_in, type_out;
568 const char *istream_spec =
NULL, *ostream_spec =
NULL;
569 int idx_in = 0, idx_out = 0;
575 if (type_out ==
'g' || !*outspec)
577 if (type_out ==
's' || !*outspec)
579 if (type_out ==
'c' || !*outspec)
584 if (type_in ==
'g' || type_out ==
'g')
586 if (type_in ==
's' || type_out ==
's')
588 if (type_in ==
'c' || type_out ==
'c')
595 #define METADATA_CHECK_INDEX(index, nb_elems, desc)\
596 if ((index) < 0 || (index) >= (nb_elems)) {\
597 av_log(NULL, AV_LOG_FATAL, "Invalid %s index %d while processing metadata maps.\n",\
602 #define SET_DICT(type, meta, context, index)\
605 meta = &context->metadata;\
608 METADATA_CHECK_INDEX(index, context->nb_chapters, "chapter")\
609 meta = &context->chapters[index]->metadata;\
612 METADATA_CHECK_INDEX(index, context->nb_programs, "program")\
613 meta = &context->programs[index]->metadata;\
617 default: av_assert0(0);\
620 SET_DICT(type_in, meta_in, ic, idx_in);
621 SET_DICT(type_out, meta_out, oc, idx_out);
624 if (type_in ==
's') {
638 if (type_out ==
's') {
657 struct tm time = *gmtime((time_t*)&recording_timestamp);
658 if (!strftime(
buf,
sizeof(
buf),
"creation_time=%Y-%m-%dT%H:%M:%S%z", &time))
663 "tag instead.\n", opt);
670 const char *
codec_string = encoder ?
"encoder" :
"decoder";
698 char *codec_name =
NULL;
720 const char *hwaccel =
NULL;
721 char *hwaccel_output_format =
NULL;
722 char *codec_tag =
NULL;
724 char *discard_str =
NULL;
750 uint32_t
tag = strtol(codec_tag, &next, 0);
799 if (st->codec->lowres) {
825 if (!strcmp(hwaccel,
"nvdec"))
828 if (!strcmp(hwaccel,
"none"))
830 else if (!strcmp(hwaccel,
"auto"))
868 if (hwaccel_device) {
875 hwaccel_output_format, ic, st);
876 if (hwaccel_output_format) {
880 "format: %s", hwaccel_output_format);
896 char *canvas_size =
NULL;
928 fprintf(stderr,
"Error, both -y and -n supplied. Exiting.\n");
933 if (proto_name && !strcmp(proto_name,
"file") &&
avio_check(filename, 0) == 0) {
935 fprintf(stderr,
"File '%s' already exists. Overwrite ? [y/N] ", filename);
938 signal(SIGINT, SIG_DFL);
952 if (proto_name && !strcmp(proto_name,
"file")) {
957 if (!strcmp(filename, file->
ctx->
url)) {
1010 char * data_codec_name =
NULL;
1011 int scan_all_pmts_set = 0;
1035 if (!strcmp(filename,
"-"))
1039 strcmp(filename,
"/dev/stdin");
1087 if (data_codec_name)
1102 scan_all_pmts_set = 1;
1112 if (scan_all_pmts_set)
1129 for (
i = 0;
i < orig_nb_streams;
i++)
1168 int64_t seek_timestamp = timestamp;
1171 int dts_heuristic = 0;
1179 if (dts_heuristic) {
1241 "input file #%d (%s) is not a decoding option.\n", e->
key,
1248 "input file #%d (%s) has not been used for any stream. The most "
1249 "likely reason is either wrong type (e.g. a video option with "
1250 "no video streams) or that it is a private option of some decoder "
1251 "which was not actually used for any stream.\n", e->
key,
1294 char filename[1000];
1295 const char *
base[3] = { getenv(
"AVCONV_DATADIR"),
1304 snprintf(filename,
sizeof(filename),
"%s%s/%s-%s.avpreset",
base[
i],
1305 i != 1 ?
"" :
"/.avconv", codec_name, preset_name);
1309 snprintf(filename,
sizeof(filename),
"%s%s/%s.avpreset",
base[
i],
1310 i != 1 ?
"" :
"/.avconv", preset_name);
1320 char *codec_name =
NULL;
1330 "output stream #%d:%d. Default encoder for format %s (codec %s) is "
1331 "probably disabled. Please choose an encoder manually.\n",
1336 }
else if (!strcmp(codec_name,
"copy"))
1337 ost->stream_copy = 1;
1342 ost->encoding_needed = !
ost->stream_copy;
1345 ost->stream_copy = 1;
1346 ost->encoding_needed = 0;
1357 const char *bsfs =
NULL, *time_base =
NULL;
1358 char *next, *codec_tag =
NULL;
1389 if (!
ost->enc_ctx) {
1393 ost->enc_ctx->codec_type =
type;
1396 if (!
ost->ref_par) {
1411 if (!
buf[0] ||
buf[0] ==
'#') {
1415 if (!(
arg = strchr(
buf,
'='))) {
1422 }
while (!
s->eof_reached);
1427 "Preset %s specified for stream %d:%d, but could not be opened.\n",
1443 q.
num <= 0 || q.
den <= 0) {
1458 ost->enc_timebase = q;
1461 ost->max_frames = INT64_MAX;
1471 ost->copy_prior_start = -1;
1475 while (bsfs && *bsfs) {
1477 char *bsf, *bsf_options_str, *bsf_name;
1482 bsf_name =
av_strtok(bsf,
"=", &bsf_options_str);
1493 ost->nb_bitstream_filters + 1,
1494 sizeof(*
ost->bsf_ctx));
1504 ost->nb_bitstream_filters++;
1506 if (bsf_options_str &&
filter->priv_class) {
1508 const char * shorthand[2] = {
NULL};
1511 shorthand[0] = opt->
name;
1527 uint32_t
tag = strtol(codec_tag, &next, 0);
1531 ost->enc_ctx->codec_tag =
tag;
1543 ost->max_muxing_queue_size = 128;
1558 ost->source_index = source_index;
1559 if (source_index >= 0) {
1567 if (!
ost->muxing_queue)
1576 const char *p = str;
1624 if (
ost->filters_script &&
ost->filters) {
1630 if (
ost->filters_script)
1632 else if (
ost->filters)
1642 if (
ost->filters_script ||
ost->filters) {
1644 "%s '%s' was defined for %s output stream %d:%d but codec copy was selected.\n"
1645 "Filtering and streamcopy cannot be used together.\n",
1646 ost->filters ?
"Filtergraph" :
"Filtergraph script",
1647 ost->filters ?
ost->filters :
ost->filters_script,
1658 char *frame_rate =
NULL, *frame_aspect_ratio =
NULL;
1662 video_enc =
ost->enc_ctx;
1673 if (frame_aspect_ratio) {
1676 q.
num <= 0 || q.
den <= 0) {
1680 ost->frame_aspect_ratio = q;
1686 av_log(
NULL,
AV_LOG_ERROR,
"Only '-vf %s' read, ignoring remaining -vf options: Use ',' to separate filters\n",
ost->filters);
1688 if (!
ost->stream_copy) {
1689 const char *p =
NULL;
1691 char *frame_pix_fmt =
NULL;
1692 char *intra_matrix =
NULL, *inter_matrix =
NULL;
1693 char *chroma_intra_matrix =
NULL;
1705 if (frame_pix_fmt && *frame_pix_fmt ==
'+') {
1706 ost->keep_pix_fmt = 1;
1707 if (!*++frame_pix_fmt)
1708 frame_pix_fmt =
NULL;
1727 if (chroma_intra_matrix) {
1746 for (
i = 0; p;
i++) {
1748 int e = sscanf(p,
"%d,%d,%d", &
start, &
end, &q);
1792 if (
ost->logfile_prefix &&
1797 char logfilename[1024];
1800 snprintf(logfilename,
sizeof(logfilename),
"%s-%d.log",
1801 ost->logfile_prefix ?
ost->logfile_prefix :
1804 if (!strcmp(
ost->enc->name,
"libx264")) {
1808 char *logbuffer =
read_file(logfilename);
1821 "Cannot write log file '%s' for pass-1 encoding: %s\n",
1822 logfilename, strerror(errno));
1831 if (
ost->forced_keyframes)
1836 ost->top_field_first = -1;
1847 if (
ost->stream_copy)
1863 audio_enc =
ost->enc_ctx;
1869 av_log(
NULL,
AV_LOG_ERROR,
"Only '-af %s' read, ignoring remaining -af options: Use ',' to separate filters\n",
ost->filters);
1871 if (!
ost->stream_copy) {
1872 char *sample_fmt =
NULL;
1895 if ((
map->ofile_idx == -1 ||
ost->file_index ==
map->ofile_idx) &&
1896 (
map->ostream_idx == -1 ||
ost->st->
index ==
map->ostream_idx)) {
1899 if (
map->channel_idx == -1) {
1901 }
else if (
ost->source_index < 0) {
1911 ost->audio_channels_mapped + 1,
1912 sizeof(*
ost->audio_channels_map)
1916 ost->audio_channels_map[
ost->audio_channels_mapped++] =
map->channel_idx;
1922 if (
ost->stream_copy)
1933 if (!
ost->stream_copy) {
1946 if (!
ost->stream_copy) {
1957 ost->stream_copy = 1;
1970 subtitle_enc =
ost->enc_ctx;
1976 if (!
ost->stream_copy) {
1998 p = strchr(idx_str,
':');
2001 "Invalid value '%s' for option '%s', required syntax is 'index:value'\n",
2024 for (
i = 0;
i <
is->nb_chapters;
i++) {
2029 int64_t rt = (
ofile->recording_time == INT64_MAX) ? INT64_MAX :
2033 if (in_ch->
end < ts_off)
2035 if (rt != INT64_MAX && in_ch->
start > rt + ts_off)
2042 out_ch->id = in_ch->
id;
2044 out_ch->start =
FFMAX(0, in_ch->
start - ts_off);
2045 out_ch->end =
FFMIN(rt, in_ch->
end - ts_off);
2060 switch (ofilter->
type) {
2069 ost->source_index = -1;
2070 ost->filter = ofilter;
2075 if (
ost->stream_copy) {
2077 "which is fed from a complex filtergraph. Filtering and streamcopy "
2078 "cannot be used together.\n",
ost->file_index,
ost->
index);
2082 if (
ost->avfilter && (
ost->filters ||
ost->filters_script)) {
2083 const char *opt =
ost->filters ?
"-vf/-af/-filter" :
"-filter_script";
2085 "%s '%s' was specified through the %s option "
2086 "for output stream %d:%d, which is fed from a complex filtergraph.\n"
2087 "%s and -filter_complex cannot be used together for the same stream.\n",
2088 ost->filters ?
"Filtergraph" :
"Filtergraph script",
2089 ost->filters ?
ost->filters :
ost->filters_script,
2118 int format_flags = 0;
2148 if (!strcmp(filename,
"-"))
2182 switch (ofilter->
type) {
2197 int area = 0, idx = -1;
2222 int best_score = 0, idx = -1;
2231 score > best_score) {
2250 int input_props = 0, output_props = 0;
2255 if (input_descriptor)
2257 if (output_descriptor)
2260 input_props & output_props ||
2262 input_descriptor && output_descriptor &&
2263 (!input_descriptor->
props ||
2264 !output_descriptor->
props)) {
2288 if (
map->linklabel) {
2297 if (
out && !strcmp(
out->name,
map->linklabel)) {
2306 "in any defined filter graph, or was already used elsewhere.\n",
map->linklabel);
2316 map->file_index,
map->stream_index);
2342 "Cannot map stream #%d:%d - unsupported type.\n",
2343 map->file_index,
map->stream_index);
2346 "If you want unsupported types ignored instead "
2347 "of failing, please use the -ignore_unknown option\n"
2348 "If you want them copied, please use -copy_unknown\n");
2354 +
map->sync_stream_index];
2386 ost->stream_copy = 0;
2396 #if FF_API_LAVF_AVCTX
2401 if ((
ost->stream_copy ||
ost->attachment_filename)
2438 "output file #%d (%s) is not an encoding option.\n", e->
key,
2445 if (!strcmp(e->
key,
"gop_timecode"))
2449 "output file #%d (%s) has not been used for any stream. The most "
2450 "likely reason is either wrong type (e.g. a video option with "
2451 "no video streams) or that it is a private option of some encoder "
2452 "which was not actually used for any stream.\n", e->
key,
2461 if (
ost->encoding_needed &&
ost->source_index >= 0) {
2470 "Error initializing a simple filtergraph between streams "
2482 switch (
ost->enc_ctx->codec_type) {
2484 f->frame_rate =
ost->frame_rate;
2485 f->width =
ost->enc_ctx->width;
2486 f->height =
ost->enc_ctx->height;
2488 f->format =
ost->enc_ctx->pix_fmt;
2489 }
else if (
ost->enc->pix_fmts) {
2496 memcpy(
f->formats,
ost->enc->pix_fmts, (
count + 1) *
sizeof(*
f->formats));
2501 f->format =
ost->enc_ctx->sample_fmt;
2502 }
else if (
ost->enc->sample_fmts) {
2509 memcpy(
f->formats,
ost->enc->sample_fmts, (
count + 1) *
sizeof(*
f->formats));
2511 if (
ost->enc_ctx->sample_rate) {
2512 f->sample_rate =
ost->enc_ctx->sample_rate;
2513 }
else if (
ost->enc->supported_samplerates) {
2515 while (
ost->enc->supported_samplerates[
count])
2518 if (!
f->sample_rates)
2520 memcpy(
f->sample_rates,
ost->enc->supported_samplerates,
2521 (
count + 1) *
sizeof(*
f->sample_rates));
2523 if (
ost->enc_ctx->channels) {
2525 }
else if (
ost->enc->channel_layouts) {
2527 while (
ost->enc->channel_layouts[
count])
2530 if (!
f->channel_layouts)
2532 memcpy(
f->channel_layouts,
ost->enc->channel_layouts,
2533 (
count + 1) *
sizeof(*
f->channel_layouts));
2550 "No input streams but output needs an input stream\n");
2579 av_log(
NULL,
AV_LOG_FATAL,
"Invalid input file index %d while processing metadata maps\n", in_file_index);
2583 in_file_index >= 0 ?
2635 const char *to_dealloc = p2;
2650 if (!strcmp(
key,
"program_num"))
2651 progid = strtol(p2,
NULL, 0);
2661 const char *to_dealloc = p2;
2670 "No '=' character in program string %s.\n",
2678 if (!strcmp(
key,
"title")) {
2680 }
else if (!strcmp(
key,
"program_num")) {
2681 }
else if (!strcmp(
key,
"st")) {
2682 int st_num = strtol(p2,
NULL, 0);
2697 const char *stream_spec;
2717 ost->rotate_overridden = 1;
2718 ost->rotate_override_value = theta;
2761 static const char *
const frame_rates[] = {
"25",
"30000/1001",
"24000/1001" };
2763 if (!strncmp(
arg,
"pal-", 4)) {
2766 }
else if (!strncmp(
arg,
"ntsc-", 5)) {
2769 }
else if (!strncmp(
arg,
"film-", 5)) {
2786 }
else if ((fr == 29970) || (fr == 23976)) {
2806 if (!strcmp(
arg,
"vcd")) {
2833 }
else if (!strcmp(
arg,
"svcd")) {
2855 }
else if (!strcmp(
arg,
"dvd")) {
2877 }
else if (!strncmp(
arg,
"dv", 2)) {
2883 norm ==
PAL ?
"yuv420p" :
"yuv411p",
options);
2910 time_t today2 = time(
NULL);
2911 struct tm *today = localtime(&today2);
2918 snprintf(filename,
sizeof(filename),
"vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
2965 char filename[1000],
line[1000], tmp_line[1000];
2966 const char *codec_name =
NULL;
2973 if(!strncmp(
arg,
"libx264-lossless", strlen(
"libx264-lossless"))){
2981 char *
key = tmp_line, *
value, *endptr;
2983 if (strcspn(
line,
"#\n\r") == 0)
3022 if(!strcmp(opt,
"ab")){
3025 }
else if(!strcmp(opt,
"b")){
3039 if(!strcmp(opt,
"qscale")){
3052 if(!strcmp(opt,
"profile")){
3099 char layout_str[32];
3118 stream_str = strchr(opt,
':');
3119 ac_str_size = 3 + (stream_str ? strlen(stream_str) : 0);
3174 int show_advanced = 0, show_avoptions = 0;
3177 if (!strcmp(opt,
"long"))
3179 else if (!strcmp(opt,
"full"))
3180 show_advanced = show_avoptions = 1;
3188 " -h -- print basic options\n"
3189 " -h long -- print more options\n"
3190 " -h full -- print all options (including all format and codec specific options, very long)\n"
3191 " -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf\n"
3192 " See man %s for detailed description of the options.\n"
3199 "instead of just one file:",
3227 if (show_avoptions) {
3234 #if CONFIG_SWRESAMPLE
3256 [GROUP_INFILE] = {
"input url",
"i",
OPT_INPUT },
3274 "%s.\n", inout,
g->arg);
3299 memset(&octx, 0,
sizeof(octx));
3351 static int opt_progress(
void *optctx,
const char *opt,
const char *
arg)
3356 if (!strcmp(
arg,
"-"))
3368 #define OFFSET(x) offsetof(OptionsContext, x)
3374 "force format",
"fmt" },
3376 "overwrite output files" },
3378 "never overwrite output files" },
3380 "Ignore unknown stream types" },
3382 "Copy unknown stream types" },
3385 "codec name",
"codec" },
3388 "codec name",
"codec" },
3391 "preset name",
"preset" },
3394 "set input stream mapping",
3395 "[-]input_file_id[:stream_specifier][,sync_file_id[:stream_specifier]]" },
3397 "map an audio channel from one stream to another",
"file.stream.channel[:syncfile.syncstream]" },
3400 "set metadata information of outfile from infile",
3401 "outfile[,metadata]:infile[,metadata]" },
3404 "set chapters mapping",
"input_file_index" },
3407 "record or transcode \"duration\" seconds of audio/video",
3410 "record or transcode stop time",
"time_stop" },
3412 "set the limit file size in bytes",
"limit_size" },
3415 "set the start time offset",
"time_off" },
3418 "set the start time offset relative to EOF",
"time_off" },
3421 "enable/disable seeking by timestamp with -ss" },
3424 "enable/disable accurate seeking with -ss" },
3427 "set the input ts offset",
"time_off" },
3430 "set the input ts scale",
"scale" },
3432 "set the recording timestamp ('now' to set the current time)",
"time" },
3434 "add metadata",
"string=string" },
3436 "add program with specified streams",
"title=string:st=number..." },
3439 "set the number of data frames to output",
"number" },
3441 "add timings for benchmarking" },
3443 "add timings for each task" },
3445 "write program-readable progress information",
"url" },
3447 "enable or disable interaction on standard input" },
3449 "set max runtime in seconds",
"limit" },
3451 "dump each input packet" },
3453 "when dumping packets, also dump the payload" },
3456 "read input at native frame rate",
"" },
3458 "specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\" "
3459 "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")",
"type" },
3461 "video sync method",
"" },
3463 "frame drop threshold",
"" },
3465 "audio sync method",
"" },
3467 "audio drift threshold",
"threshold" },
3469 "copy timestamps" },
3471 "shift input timestamps to start at 0 when using copyts" },
3473 "copy input stream time base when stream copying",
"mode" },
3476 "finish encoding within shortest input" },
3484 "timestamp discontinuity delta threshold",
"threshold" },
3486 "timestamp error delta threshold",
"threshold" },
3488 "exit on error",
"error" },
3490 "abort on the specified condition flags",
"flags" },
3493 "copy initial non-keyframes" },
3495 "copy or discard frames before start time" },
3497 "set the number of frames to output",
"number" },
3500 "force codec tag/fourcc",
"fourcc/tag" },
3503 "use fixed quality scale (VBR)",
"q" },
3506 "use fixed quality scale (VBR)",
"q" },
3508 "set profile",
"profile" },
3510 "set stream filtergraph",
"filter_graph" },
3512 "number of non-complex filter threads" },
3514 "read stream filtergraph description from a file",
"filename" },
3516 "reinit filtergraph on input parameter changes",
"" },
3518 "create a complex filtergraph",
"graph_description" },
3520 "number of threads for -filter_complex" },
3522 "create a complex filtergraph",
"graph_description" },
3524 "read complex filtergraph description from a file",
"filename" },
3526 "print progress report during encoding", },
3529 "add an attachment to the output file",
"filename" },
3532 "extract an attachment into a file",
"filename" },
3534 OPT_OFFSET, { .off =
OFFSET(
loop) },
"set number of times input stream shall be looped",
"loop count" },
3536 "print timestamp debugging info" },
3538 "ratio of errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.",
"maximum error rate" },
3544 "disposition",
"" },
3546 { .off =
OFFSET(thread_queue_size) },
3547 "set the maximum number of queued packets from the demuxer" },
3549 "read and decode the streams to fill missing information with heuristics" },
3553 "set the number of video frames to output",
"number" },
3556 "set frame rate (Hz value, fraction or abbreviation)",
"rate" },
3559 "set frame size (WxH or abbreviation)",
"size" },
3562 "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)",
"aspect" },
3565 "set pixel format",
"format" },
3567 "set the number of bits per raw sample",
"number" },
3569 "deprecated use -g 1" },
3574 "rate control override for specific intervals",
"override" },
3577 "force video codec ('copy' to copy stream)",
"codec" },
3583 "set initial TimeCode value.",
"hh:mm:ss[:;.]ff" },
3585 "select the pass number (1 to 3)",
"n" },
3588 "select two pass log file name prefix",
"prefix" },
3590 "this option is deprecated, use the yadif filter instead" },
3592 "calculate PSNR of compressed frames" },
3594 "dump video coding statistics to file" },
3596 "dump video coding statistics to file",
"file" },
3598 "Version of the vstats format to use."},
3600 "set video filters",
"filter_graph" },
3603 "specify intra matrix coeffs",
"matrix" },
3606 "specify inter matrix coeffs",
"matrix" },
3609 "specify intra matrix coeffs",
"matrix" },
3612 "top=1/bottom=0/auto=-1 field first",
"" },
3615 "force video tag/fourcc",
"fourcc/tag" },
3617 "show QP histogram" },
3620 "force the selected framerate, disable the best supported framerate selection" },
3623 "set the value of an outfile streamid",
"streamIndex:value" },
3626 "force key frames at specified timestamps",
"timestamps" },
3628 "audio bitrate (please use -b:a)",
"bitrate" },
3630 "video bitrate (please use -b:v)",
"bitrate" },
3633 "use HW accelerated decoding",
"hwaccel name" },
3636 "select a device for HW acceleration",
"devicename" },
3639 "select output format used with HW accelerated decoding",
"format" },
3640 #if CONFIG_VIDEOTOOLBOX
3644 "show available HW acceleration methods" },
3647 "automatically insert correct rotate filters" },
3651 "set the number of audio frames to output",
"number" },
3653 "set audio quality (codec-specific)",
"quality", },
3656 "set audio sampling rate (in Hz)",
"rate" },
3659 "set number of audio channels",
"channels" },
3664 "force audio codec ('copy' to copy stream)",
"codec" },
3667 "force audio tag/fourcc",
"fourcc/tag" },
3669 "change audio volume (256=normal)" ,
"volume" },
3672 "set sample format",
"format" },
3675 "set channel layout",
"layout" },
3677 "set audio filters",
"filter_graph" },
3679 "set the maximum number of channels to try to guess the channel layout" },
3683 "disable subtitle" },
3685 "force subtitle codec ('copy' to copy stream)",
"codec" },
3687 ,
"force subtitle tag/fourcc",
"fourcc/tag" },
3689 "fix subtitles duration" },
3691 "set canvas size (WxH or abbreviation)",
"size" },
3695 "deprecated, use -channel",
"channel" },
3697 "deprecated, use -standard",
"standard" },
3702 "set the maximum demux-decode delay",
"seconds" },
3704 "set the initial demux-decode delay",
"seconds" },
3706 "specify a file in which to print sdp information",
"file" },
3709 "set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5)",
"ratio" },
3711 "set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). "
3712 "two special values are defined - "
3713 "0 = use frame rate (video) or sample rate (audio),"
3714 "-1 = match source time base",
"ratio" },
3717 "A comma-separated list of bitstream filters",
"bitstream_filters" },
3719 "deprecated",
"audio bitstream_filters" },
3721 "deprecated",
"video bitstream_filters" },
3724 "set the audio options to the indicated preset",
"preset" },
3726 "set the video options to the indicated preset",
"preset" },
3728 "set the subtitle options to the indicated preset",
"preset" },
3730 "set options from indicated preset file",
"filename" },
3733 "maximum number of packets that can be buffered while waiting for all streams to initialize",
"packets" },
3737 "force data codec ('copy' to copy stream)",
"codec" },
3743 "set VAAPI hardware device (DRM path or X11 display name)",
"device" },
3748 "set QSV hardware device (DirectX adapter index, DRM path or X11 display name)",
"device"},
3752 "initialise hardware device",
"args" },
3754 "set hardware device used when filtering",
"device" },
int id
unique ID to identify the chapter
#define AV_LOG_WARNING
Something somehow does not look correct.
@ 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.
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
#define VSYNC_PASSTHROUGH
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
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 avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
int sample_rate
samples per second
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 u(width, name, range_min, range_max)
static enum AVSampleFormat sample_fmts[]
#define MKTAG(a, b, c, d)
static const struct PPFilter filters[]
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.
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.
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)
AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
int64_t start_time
start time in microseconds == AV_TIME_BASE units
static av_cold int end(AVCodecContext *avctx)
static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
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 int copy_unknown_streams
static const char * subtitle_codec_name
enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type)
Guess the codec ID based upon muxer and filename.
AVRational avg_frame_rate
Average framerate.
AVDictionary * format_opts
#define AV_DICT_APPEND
If the entry already exists, append to it.
#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.
void * av_mallocz_array(size_t nmemb, size_t size)
#define AV_LOG_VERBOSE
Detailed information.
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.
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
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.
char * videotoolbox_pixfmt
#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.
#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)
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.
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.
static int opt_video_channel(void *optctx, const char *opt, const char *arg)
int frame_bits_per_raw_sample
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...
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.
ff_const59 struct AVInputFormat * iformat
The input container format.
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx)
Allocate a context for a given bitstream filter.
A list of option groups that all have the same group type (e.g.
static void uninit_options(OptionsContext *o)
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)
@ AVDISCARD_NONE
discard nothing
int flags
AV_CODEC_FLAG_*.
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)
AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.
int qsv_init(AVCodecContext *s)
static int opt_audio_filters(void *optctx, const char *opt, const char *arg)
int nb_audio_channel_maps
const AVBitStreamFilter * av_bsf_get_by_name(const char *name)
static int opt_filter_complex_script(void *optctx, const char *opt, const char *arg)
static int input_stream_potentially_available
int metadata_chapters_manual
AVCodec * audio_codec
Forced audio codec.
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
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)
static OutputStream * new_audio_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
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,...
const AVClass * av_bsf_get_class(void)
Get the AVClass for AVBSFContext.
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)
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)
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
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.
AVDictionary * filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, AVCodec *codec)
Filter out options for given codec.
union SpecifierOpt::@22 u
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.
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.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
int flags
Flags modifying the (de)muxer behaviour.
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
static void parse_meta_type(char *arg, char *type, int *index, const char **stream_spec)
Parse a metadata specifier passed as 'arg' parameter.
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().
static int opt_audio_qscale(void *optctx, const char *opt, const char *arg)
#define AVIO_FLAG_WRITE
write-only
struct OutputStream * ost
int metadata_streams_manual
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
#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.
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
static AVCodec * choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st)
#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.
int cuvid_init(AVCodecContext *s)
void assert_avoptions(AVDictionary *m)
static int opt_video_frames(void *optctx, const char *opt, const char *arg)
#define AV_OPT_FLAG_AUDIO_PARAM
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.
static void init_output_filter(OutputFilter *ofilter, OptionsContext *o, AVFormatContext *oc)
OutputStream ** output_streams
@ 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)
static uint8_t * get_line(AVIOContext *s)
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.
SpecifierOpt * frame_sizes
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)
int av_opt_set_from_string(void *ctx, const char *opts, const char *const *shorthand, const char *key_val_sep, const char *pairs_sep)
Parse the key-value pairs list in opts.
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.
void avio_w8(AVIOContext *s, int b)
SpecifierOpt * max_frames
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
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.
ff_const59 struct AVOutputFormat * oformat
The output container format.
static void error(const char *err)
#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...
AVCodecID
Identify the syntax and semantics of the bitstream.
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)
int lowres
low resolution decoding, 1-> 1/2 size, 2->1/4 size
static int opt_vstats_file(void *optctx, const char *opt, const char *arg)
AVDictionary * codec_opts
const OptionDef options[]
static int opt_bitrate(void *optctx, const char *opt, const char *arg)
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
static const uint8_t frame_sizes[]
AVBufferRef * hw_device_ctx
int gop_size
the number of pictures in a group of pictures, or 0 for intra_only
static int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
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)
#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
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")
@ 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)
const char const char void * val
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
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.
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)
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 int opt_video_standard(void *optctx, const char *opt, const char *arg)
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
#define AV_LOG_INFO
Standard information.
static const char * video_codec_name
int channels
number of audio channels
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
AVCodecParameters * avcodec_parameters_alloc(void)
Allocate a new AVCodecParameters and set its fields to default values (unknown/invalid/0).
@ AV_PIX_FMT_VIDEOTOOLBOX
hardware decoding through Videotoolbox
int av_parse_video_rate(AVRational *rate, const char *arg)
Parse str and store the detected values in *rate.
ff_const59 AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
static AVCodec * find_codec_or_die(const char *name, enum AVMediaType type, int encoder)
int init_complex_filtergraph(FilterGraph *fg)
#define i(width, name, range_min, range_max)
SpecifierOpt * metadata_map
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
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.
SpecifierOpt * audio_sample_rate
static AVInputFormat * file_iformat
static int opt_video_codec(void *optctx, const char *opt, const char *arg)
static int opt_qscale(void *optctx, const char *opt, const char *arg)
AVCodec * subtitle_codec
Forced subtitle 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
int videotoolbox_init(AVCodecContext *s)
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.
const char * name
Name of the codec implementation.
float dts_error_threshold
int opt_timelimit(void *optctx, const char *opt, const char *arg)
Limit the execution time.
FilterGraph ** filtergraphs
const AVIOInterruptCB int_cb
static uint8_t * read_file(const char *filename)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const AVOption * av_opt_next(const void *obj, const AVOption *last)
Iterate over all AVOptions belonging to obj.
static int opt_audio_frames(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 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)
AVDictionary * resample_opts
int disposition
AV_DISPOSITION_* bit field.
int id
Format-specific stream ID.
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
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.
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
#define AV_INPUT_BUFFER_PADDING_SIZE
#define FF_ARRAY_ELEMS(a)
#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.
AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified 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
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options)
Parse one given option.
static const char * audio_codec_name
float audio_drift_threshold
AVCodec * data_codec
Forced data codec.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static AVDictionary * strip_specifiers(AVDictionary *dict)
SpecifierOpt * frame_pix_fmts
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)
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
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)
int coded_width
Bitstream width / height, may be different from width/height e.g.
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.
A reference to a data buffer.
#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.
const VDPAUPixFmtMap * map
AVCodec * video_codec
Forced video codec.
int void avio_flush(AVIOContext *s)
Force flushing of buffered data.
const char ** attachments
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
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
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.
#define flags(name, subs,...)
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.
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.
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
AVRational time_base
time base in which the start/end timestamps are specified
int64_t recording_time
desired length of the resulting file in microseconds == AV_TIME_BASE units
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.
int codec_info_nb_frames
Number of frames that have been demuxed during avformat_find_stream_info()
#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.
const AVCodecDescriptor * avcodec_descriptor_get_by_name(const char *name)
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
#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)
#define DEFAULT_PASS_LOGFILENAME_PREFIX
static int opt_sameq(void *optctx, const char *opt, const char *arg)
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.