Go to the documentation of this file.
27 #include "libavutil/ffversion.h"
75 # ifdef pthread_mutex_lock
76 # undef pthread_mutex_lock
78 # define pthread_mutex_lock(a) do{}while(0)
79 # ifdef pthread_mutex_unlock
80 # undef pthread_mutex_unlock
82 # define pthread_mutex_unlock(a) do{}while(0)
145 #define SHOW_OPTIONAL_FIELDS_AUTO -1
146 #define SHOW_OPTIONAL_FIELDS_NEVER 0
147 #define SHOW_OPTIONAL_FIELDS_ALWAYS 1
169 #define SECTION_MAX_NB_CHILDREN 11
245 #define SECTION_FLAG_IS_WRAPPER 1
246 #define SECTION_FLAG_IS_ARRAY 2
247 #define SECTION_FLAG_HAS_VARIABLE_FIELDS 4
249 #define SECTION_FLAG_HAS_TYPE 8
256 const char *(* get_type)(
const void *
data);
365 static const struct {
371 { 1.0, 1.0,
"",
"" },
372 { 1.024e3, 1e3,
"Ki",
"K" },
373 { 1.048576e6, 1e6,
"Mi",
"M" },
374 { 1.073741824e9, 1e9,
"Gi",
"G" },
375 { 1.099511627776e12, 1e12,
"Ti",
"T" },
376 { 1.125899906842624e15, 1e15,
"Pi",
"P" },
409 static int print_prefix = 1;
410 void *new_log_buffer;
421 if (new_log_buffer) {
434 for (
i=strlen(msg) - 1;
i>=0 && msg[
i] ==
'\n';
i--) {
440 if (parent && *parent) {
443 (*parent)->get_category ? (*parent)->get_category(parent) :(*parent)->category;
468 vald = vali = uv.
val.
i;
475 mins = (int)secs / 60;
476 secs = secs - mins * 60;
479 snprintf(buf, buf_size,
"%d:%02d:%09.6f", hours, mins, secs);
481 const char *prefix_string =
"";
501 snprintf(buf, buf_size,
"%f", vald);
503 snprintf(buf, buf_size,
"%"PRId64, vali);
515 #define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS 1
516 #define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER 2
541 #define SECTION_MAX_NB_LEVELS 12
583 #define OFFSET(x) offsetof(WriterContext, x)
586 {
"string_validation",
"set string validation mode",
588 {
"sv",
"set string validation mode",
593 {
"string_validation_replacement",
"set string validation replacement string",
OFFSET(string_validation_replacement),
AV_OPT_TYPE_STRING, {.str=
""}},
594 {
"svr",
"set string validation replacement string",
OFFSET(string_validation_replacement),
AV_OPT_TYPE_STRING, {.str=
"\xEF\xBF\xBD"}},
601 if (!prev &&
ctx->writer &&
ctx->writer->priv_class &&
ctx->priv)
622 if ((*wctx)->writer->uninit)
623 (*wctx)->writer->uninit(*wctx);
626 if ((*wctx)->writer->priv_class)
638 static void bprint_bytes(AVBPrint *bp,
const uint8_t *ubuf,
size_t ubuf_size)
642 for (
i = 0;
i < ubuf_size;
i++)
700 (*wctx)->writer = writer;
703 (*wctx)->nb_sections = nb_sections;
708 void *priv_ctx = (*wctx)->priv;
719 av_log(*wctx,
AV_LOG_ERROR,
"Failed to parse option string '%s' provided to writer context\n", args);
726 av_log(*wctx,
AV_LOG_ERROR,
"Failed to set option '%s' with value '%s' provided to writer context\n",
738 const uint8_t *p = (*wctx)->string_validation_replacement;
739 const uint8_t *endp = p + strlen(p);
741 const uint8_t *p0 = p;
749 "Invalid UTF8 sequence %s found in string validation replace '%s'\n",
750 bp.str, (*wctx)->string_validation_replacement);
774 if ((*wctx)->writer->init)
775 ret = (*wctx)->writer->init(*wctx);
790 int parent_section_id;
793 parent_section_id = wctx->
level ?
814 int parent_section_id = wctx->
level ?
841 const uint8_t *p, *endp;
843 int invalid_chars_nb = 0,
ret = 0;
851 const uint8_t *p0 = p;
858 "Invalid UTF-8 sequence %s found in string '%s'\n", bp.str,
src);
868 "Invalid UTF-8 sequence found in string '%s'\n",
src);
885 "%d invalid UTF-8 sequence(s) found in string '%s', replaced with '%s'\n",
894 #define PRINT_STRING_OPT 1
895 #define PRINT_STRING_VALIDATE 2
913 if (
ret < 0)
goto end;
915 if (
ret < 0)
goto end;
920 "Invalid key=value string combination %s=%s in section %s\n",
949 if ((!is_duration && ts ==
AV_NOPTS_VALUE) || (is_duration && ts == 0)) {
952 double d = ts *
av_q2d(*time_base);
963 if ((!is_duration && ts ==
AV_NOPTS_VALUE) || (is_duration && ts == 0)) {
981 for (
i = 0;
i < l;
i++) {
987 for (
i = 0;
i < l;
i++)
1008 p = buf + strlen(buf);
1015 int columns,
int bytes,
int offset_add)
1025 for (
i = 0;
i < l;
i++) {
1039 #define writer_w8(wctx_, b_) (wctx_)->writer_w8(wctx_, b_)
1040 #define writer_put_str(wctx_, str_) (wctx_)->writer_put_str(wctx_, str_)
1041 #define writer_printf(wctx_, fmt_, ...) (wctx_)->writer_printf(wctx_, fmt_, __VA_ARGS__)
1043 #define MAX_REGISTERED_WRITERS_NB 64
1049 static int next_registered_writer_idx = 0;
1072 #define DEFINE_WRITER_CLASS(name) \
1073 static const char *name##_get_name(void *ctx) \
1077 static const AVClass name##_class = { \
1078 .class_name = #name, \
1079 .item_name = name##_get_name, \
1080 .option = name##_options \
1093 #define OFFSET(x) offsetof(DefaultContext, x)
1096 {
"noprint_wrappers",
"do not print headers and footers",
OFFSET(noprint_wrappers),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1097 {
"nw",
"do not print headers and footers",
OFFSET(noprint_wrappers),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1109 for (
i = 0;
src[
i] &&
i < dst_size-1;
i++)
1124 if (parent_section &&
1179 .priv_class = &default_class,
1191 for (p =
src; *p; p++) {
1212 char meta_chars[] = { sep,
'"',
'\n',
'\r',
'\0' };
1213 int needs_quoting = !!
src[strcspn(
src, meta_chars)];
1240 const char * (*escape_str)(AVBPrint *
dst,
const char *
src,
const char sep,
void *log_ctx);
1247 #define OFFSET(x) offsetof(CompactContext, x)
1268 av_log(wctx,
AV_LOG_ERROR,
"Item separator '%s' specified, but must contain a single character\n",
1295 if (parent_section &&
1318 (*p >=
'0' && *p <=
'9') ||
1319 (*p >=
'a' && *p <=
'z') ||
1320 (*p >=
'A' && *p <=
'Z') ?
av_tolower(*p) :
'_';
1353 if (!compact->
nokey)
1365 if (!compact->
nokey)
1379 .priv_class = &compact_class,
1385 #define OFFSET(x) offsetof(CompactContext, x)
1410 .priv_class = &csv_class,
1423 #define OFFSET(x) offsetof(FlatContext, x)
1428 {
"hierarchical",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1429 {
"h",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1439 if (strlen(
flat->sep_str) != 1) {
1440 av_log(wctx,
AV_LOG_ERROR,
"Item separator '%s' specified, but must contain a single character\n",
1453 for (p =
src; *p; p++) {
1454 if (!((*p >=
'0' && *p <=
'9') ||
1455 (*p >=
'a' && *p <=
'z') ||
1456 (*p >=
'A' && *p <=
'Z')))
1468 for (p =
src; *p; p++) {
1492 if (!parent_section)
1496 if (
flat->hierarchical ||
1534 .priv_class = &flat_class,
1545 #define OFFSET(x) offsetof(INIContext, x)
1548 {
"hierarchical",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1549 {
"h",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1560 while (
c =
src[
i++]) {
1572 if ((
unsigned char)
c < 32)
1591 if (!parent_section) {
1638 .priv_class = &ini_class,
1651 #define OFFSET(x) offsetof(JSONContext, x)
1673 static const char json_escape[] = {
'"',
'\\',
'\b',
'\f',
'\n',
'\r',
'\t', 0};
1674 static const char json_subst[] = {
'"',
'\\',
'b',
'f',
'n',
'r',
't', 0};
1677 for (p =
src; *p; p++) {
1678 char *
s = strchr(json_escape, *p);
1682 }
else if ((
unsigned char)*p < 32) {
1691 #define JSON_INDENT() writer_printf(wctx, "%*c", json->indent_level * 4, ' ')
1737 if (wctx->
level == 0) {
1755 const char *
key,
const char *
value)
1805 .priv_class = &json_class,
1819 #define OFFSET(x) offsetof(XMLContext, x)
1822 {
"fully_qualified",
"specify if the output should be fully qualified",
OFFSET(fully_qualified),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1823 {
"q",
"specify if the output should be fully qualified",
OFFSET(fully_qualified),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1824 {
"xsd_strict",
"ensure that the output is XSD compliant",
OFFSET(xsd_strict),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1837 #define CHECK_COMPLIANCE(opt, opt_name) \
1839 av_log(wctx, AV_LOG_ERROR, \
1840 "XSD-compliant output selected but option '%s' was selected, XML output may be non-compliant.\n" \
1841 "You need to disable such option with '-no%s'\n", opt_name, opt_name); \
1842 return AVERROR(EINVAL); \
1852 #define XML_INDENT() writer_printf(wctx, "%*c", xml->indent_level * 4, ' ')
1861 if (wctx->
level == 0) {
1862 const char *qual =
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
1863 "xmlns:ffprobe=\"http://www.ffmpeg.org/schema/ffprobe\" "
1864 "xsi:schemaLocation=\"http://www.ffmpeg.org/schema/ffprobe ffprobe.xsd\"";
1866 writer_put_str(wctx,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
1905 if (wctx->
level == 0) {
1918 const char *str,
int64_t num,
const int is_int)
1977 .priv_class = &xml_class,
1997 #define print_fmt(k, f, ...) do { \
1998 av_bprint_clear(&pbuf); \
1999 av_bprintf(&pbuf, f, __VA_ARGS__); \
2000 writer_print_string(w, k, pbuf.str, 0); \
2003 #define print_list_fmt(k, f, n, m, ...) do { \
2004 av_bprint_clear(&pbuf); \
2005 for (int idx = 0; idx < n; idx++) { \
2006 for (int idx2 = 0; idx2 < m; idx2++) { \
2007 if (idx > 0 || idx2 > 0) \
2008 av_bprint_chars(&pbuf, ' ', 1); \
2009 av_bprintf(&pbuf, f, __VA_ARGS__); \
2012 writer_print_string(w, k, pbuf.str, 0); \
2015 #define print_int(k, v) writer_print_integer(w, k, v)
2016 #define print_q(k, v, s) writer_print_rational(w, k, v, s)
2017 #define print_str(k, v) writer_print_string(w, k, v, 0)
2018 #define print_str_opt(k, v) writer_print_string(w, k, v, PRINT_STRING_OPT)
2019 #define print_str_validate(k, v) writer_print_string(w, k, v, PRINT_STRING_VALIDATE)
2020 #define print_time(k, v, tb) writer_print_time(w, k, v, tb, 0)
2021 #define print_ts(k, v) writer_print_ts(w, k, v, 0)
2022 #define print_duration_time(k, v, tb) writer_print_time(w, k, v, tb, 1)
2023 #define print_duration_ts(k, v) writer_print_ts(w, k, v, 1)
2024 #define print_val(k, v, u) do { \
2025 struct unit_value uv; \
2028 writer_print_string(w, k, value_string(val_str, sizeof(val_str), uv), 0); \
2031 #define print_section_header(s) writer_print_section_header(w, NULL, s)
2032 #define print_section_header_data(s, d) writer_print_section_header(w, d, s)
2033 #define print_section_footer(s) writer_print_section_footer(w, s)
2035 #define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n) \
2037 ret = av_reallocp_array(&(ptr), (new_n), sizeof(*(ptr))); \
2040 memset( (ptr) + (cur_n), 0, ((new_n) - (cur_n)) * sizeof(*(ptr)) ); \
2079 print_int(
"chroma_resampling_explicit_filter_flag",
2088 print_int(
"spatial_resampling_filter_flag",
2090 print_int(
"el_spatial_resampling_filter_flag",
2103 print_str(
"nlq_method_idc_name",
"none");
2106 print_str(
"nlq_method_idc_name",
"linear_dz");
2109 print_str(
"nlq_method_idc_name",
"unknown");
2118 for (
int c = 0;
c < 3;
c++) {
2146 print_str(
"mapping_idc_name",
"polynomial");
2161 print_str(
"mapping_idc_name",
"unknown");
2197 color->ycc_to_rgb_matrix[idx].num,
2198 color->ycc_to_rgb_matrix[idx].den);
2201 color->ycc_to_rgb_offset[idx].num,
2202 color->ycc_to_rgb_offset[idx].den);
2205 color->rgb_to_lms_matrix[idx].num,
2206 color->rgb_to_lms_matrix[idx].den);
2214 print_int(
"signal_full_range_flag",
color->signal_full_range_flag);
2231 print_q(
"window_upper_left_corner_x",
2233 print_q(
"window_upper_left_corner_y",
2235 print_q(
"window_lower_right_corner_x",
2237 print_q(
"window_lower_right_corner_y",
2239 print_q(
"window_upper_left_corner_x",
2241 print_q(
"window_upper_left_corner_y",
2249 print_int(
"semimajor_axis_internal_ellipse",
2251 print_int(
"semimajor_axis_external_ellipse",
2253 print_int(
"semiminor_axis_external_ellipse",
2258 print_q(
"targeted_system_display_maximum_luminance",
2261 print_int(
"num_rows_targeted_system_display_actual_peak_luminance",
2263 print_int(
"num_cols_targeted_system_display_actual_peak_luminance",
2267 print_q(
"targeted_system_display_actual_peak_luminance",
2274 for (
int i = 0;
i < 3;
i++) {
2279 print_int(
"num_distribution_maxrgb_percentiles",
2282 print_int(
"distribution_maxrgb_percentage",
2284 print_q(
"distribution_maxrgb_percentile",
2287 print_q(
"fraction_bright_pixels",
2291 print_int(
"num_rows_mastering_display_actual_peak_luminance",
2293 print_int(
"num_cols_mastering_display_actual_peak_luminance",
2297 print_q(
"mastering_display_actual_peak_luminance",
2311 print_q(
"bezier_curve_anchors",
2316 print_q(
"color_saturation_weight",
2347 print_q(
"targeted_system_display_maximum_luminance",
2360 print_int(
"base_param_Delta_enable_mode",
2407 const char *
const film_grain_type_names[] = {
2431 print_str(
"color_trc", color_trc ? color_trc :
"unknown");
2432 print_str(
"color_space", color_space ? color_space :
"unknown");
2434 switch (fgp->
type) {
2440 const int num_ar_coeffs_uv = num_ar_coeffs_y + !!aom->
num_y_points;
2463 for (
int uv = 0; uv < 2; uv++) {
2493 for (
int c = 0;
c < 3;
c++) {
2539 if (
isnan(rotation))
2606 const char *
comp =
"unknown";
2797 const uint8_t *side_metadata;
2851 for (
int i = 0;
i <
frame->nb_side_data;
i++) {
2860 if (
isnan(rotation))
2871 uint32_t *tc = (uint32_t*)sd->
data;
2872 int m =
FFMIN(tc[0],3);
2874 for (
int j = 1; j <= m ; j++) {
2952 print_ts (
"best_effort_timestamp",
frame->best_effort_timestamp);
2976 print_q(
"sample_aspect_ratio", sar,
':');
3009 if (
frame->nb_side_data)
3027 int ret = 0, got_frame = 0;
3078 return got_frame || *packet_new;
3083 av_log(log_ctx, log_level,
"id:%d", interval->
id);
3089 av_log(log_ctx, log_level,
" start:N/A");
3095 av_log(log_ctx, log_level,
"#%"PRId64, interval->
end);
3099 av_log(log_ctx, log_level,
" end:N/A");
3102 av_log(log_ctx, log_level,
"\n");
3111 int ret = 0,
i = 0, frame_count = 0;
3112 int64_t start = -INT64_MAX, end = interval->
end;
3123 "Could not seek to relative position since current "
3124 "timestamp is not defined\n");
3128 target = *cur_ts + interval->
start;
3130 target = interval->
start;
3172 end = start + interval->
end;
3177 if (frame_count >= interval->
end)
3179 }
else if (has_end && *cur_ts !=
AV_NOPTS_VALUE && *cur_ts >= end) {
3251 for (
int i = 0;
i <
sizeof(disposition) * CHAR_BIT;
i++) {
3254 if (disposition_str)
3255 print_int(disposition_str, !!(disposition & (1
U <<
i)));
3260 #define IN_PROGRAM 1
3261 #define IN_STREAM_GROUP 2
3278 const SectionID section_disposition[] = {
3318 char profile_num[12];
3346 print_q(
"sample_aspect_ratio", sar,
':');
3351 print_q(
"display_aspect_ratio", dar,
':');
3368 print_str(
"field_order",
"progressive");
3517 for (
i = 0;
i <
program->nb_stream_indexes;
i++) {
3575 SectionID subsection_id, parameter_section_id;
3592 switch(param->
type) {
3596 print_int(
"subblock_duration",
mix->subblock_duration);
3598 print_q(
"start_point_value",
mix->start_point_value,
'/');
3599 print_q(
"end_point_value",
mix->end_point_value,
'/');
3600 print_q(
"control_point_value",
mix->control_point_value,
'/');
3601 print_q(
"control_point_relative_time",
mix->control_point_relative_time,
'/');
3694 print_q(
"integrated_loudness",
layout->integrated_loudness,
'/');
3697 print_q(
"dialogue_anchored_loudness",
layout->dialogue_anchored_loudness,
'/');
3698 print_q(
"album_anchored_loudness",
layout->album_anchored_loudness,
'/');
3863 const char *print_filename)
3868 int scan_all_pmts_set = 0;
3876 scan_all_pmts_set = 1;
3883 if (print_filename) {
3888 if (scan_all_pmts_set)
3903 for (
i = 0;
i < orig_nb_streams;
i++)
3930 "Failed to probe codec for input stream %d\n",
3938 "Unsupported codec with id %d for input stream %d\n",
4002 const char *print_filename)
4015 #define CHECK_END if (ret < 0) goto end
4101 print_fmt(
"copyright",
"Copyright (c) %d-%d the FFmpeg developers",
4104 print_str(
"configuration", FFMPEG_CONFIGURATION);
4110 #define SHOW_LIB_VERSION(libname, LIBNAME) \
4112 if (CONFIG_##LIBNAME) { \
4113 unsigned int version = libname##_version(); \
4114 writer_print_section_header(w, NULL, SECTION_ID_LIBRARY_VERSION); \
4115 print_str("name", "lib" #libname); \
4116 print_int("major", LIB##LIBNAME##_VERSION_MAJOR); \
4117 print_int("minor", LIB##LIBNAME##_VERSION_MINOR); \
4118 print_int("micro", LIB##LIBNAME##_VERSION_MICRO); \
4119 print_int("version", version); \
4120 print_str("ident", LIB##LIBNAME##_IDENT); \
4121 writer_print_section_footer(w); \
4139 #define PRINT_PIX_FMT_FLAG(flagname, name) \
4141 print_int(name, !!(pixdesc->flags & AV_PIX_FMT_FLAG_##flagname)); \
4241 "'%s' matches section with unique name '%s'\n", section_name,
4252 const char *p =
arg;
4260 if (!section_name) {
4262 "Missing section name for option '%s'\n", opt);
4268 while (*p && *p !=
':') {
4273 "Adding '%s' to the entries to show in section '%s'\n",
4274 entry, section_name);
4304 "Argument '%s' provided as input filename, but '%s' was already specified.\n",
4308 if (!strcmp(
arg,
"-"))
4327 "Argument '%s' provided as output filename, but '%s' was already specified.\n",
4331 if (!strcmp(
arg,
"-"))
4367 char *next, *p, *spec =
av_strdup(interval_spec);
4378 next = strchr(spec,
'%');
4420 lli = strtoll(p, &tail, 10);
4421 if (*tail || lli < 0) {
4423 "Invalid or negative value '%s' for duration number of frames\n", p);
4426 interval->
end = lli;
4448 char *p, *spec =
av_strdup(intervals_spec);
4453 for (n = 0, p = spec; *p; p++)
4467 for (
i = 0; p;
i++) {
4471 next = strchr(p,
',');
4528 "W... = Section is a wrapper (contains other sections, no local entries)\n"
4529 ".A.. = Section contains an array of elements of the same type\n"
4530 "..V. = Section may contain a variable number of fields with variable keys\n"
4531 "...T = Section contain a unique type\n"
4532 "FLAGS NAME/UNIQUE_NAME\n"
4545 #define DEFINE_OPT_SHOW_SECTION(section, target_section_id) \
4546 static int opt_show_##section(void *optctx, const char *opt, const char *arg) \
4548 mark_section_show_entries(SECTION_ID_##target_section_id, 1, NULL); \
4570 "use binary prefixes for byte units" },
4572 "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
4574 "prettify the format of displayed values, make it more human readable" },
4576 "set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)",
"format" },
4583 {
"show_error",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_error },
"show probing error" },
4584 {
"show_format",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_format },
"show format/container info" },
4585 {
"show_frames",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_frames },
"show frames info" },
4587 "show a set of specified entries",
"entry_list" },
4591 {
"show_packets",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_packets },
"show packets info" },
4592 {
"show_programs",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_programs },
"show programs info" },
4593 {
"show_stream_groups",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_stream_groups },
"show stream groups info" },
4594 {
"show_streams",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_streams },
"show streams info" },
4595 {
"show_chapters",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_chapters },
"show chapters info" },
4598 {
"show_program_version",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_program_version },
"show ffprobe version" },
4599 {
"show_library_versions",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_library_versions },
"show library versions" },
4601 {
"show_pixel_formats",
OPT_TYPE_FUNC, 0, { .func_arg = &opt_show_pixel_formats },
"show pixel format descriptions" },
4611 "read and decode the streams to fill missing information with heuristics" },
4626 #define SET_DO_SHOW(id, varname) do { \
4627 if (check_section_show_entries(SECTION_ID_##id)) \
4628 do_show_##varname = 1; \
4636 char *w_name =
NULL, *w_args =
NULL;
4637 int ret, input_ret,
i;
4674 SET_DO_SHOW(PIXEL_FORMAT_FLAGS, pixel_format_flags);
4675 SET_DO_SHOW(PIXEL_FORMAT_COMPONENTS, pixel_format_components);
4678 SET_DO_SHOW(STREAM_GROUP_DISPOSITION, stream_group_disposition);
4680 SET_DO_SHOW(STREAM_GROUP_COMPONENTS, stream_group_components);
4682 SET_DO_SHOW(STREAM_DISPOSITION, stream_disposition);
4683 SET_DO_SHOW(PROGRAM_STREAM_DISPOSITION, stream_disposition);
4684 SET_DO_SHOW(STREAM_GROUP_STREAM_DISPOSITION, stream_disposition);
4690 SET_DO_SHOW(STREAM_GROUP_TAGS, stream_group_tags);
4693 SET_DO_SHOW(STREAM_GROUP_STREAM_TAGS, stream_tags);
4698 "-bitexact and -show_program_version or -show_library_versions "
4699 "options are incompatible\n");
4715 "No name specified for the output format\n");
4726 "Unknown hash algorithm '%s'\nKnown algorithms:",
static void compact_print_section_header(WriterContext *wctx, const void *data)
static void error(const char *err)
static const char * flat_escape_key_str(AVBPrint *dst, const char *src, const char sep)
int main(int argc, char **argv)
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
@ SECTION_ID_STREAM_SIDE_DATA_LIST
static int opt_format(void *optctx, const char *opt, const char *arg)
static void clear_log(int need_lock)
static void mark_section_show_entries(SectionID section_id, int show_all_entries, AVDictionary *entries)
@ AV_PKT_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
void show_help_options(const OptionDef *options, const char *msg, int req_flags, int rej_flags)
Print help for all options matching specified flags.
union AVStreamGroup::@365 params
Group type-specific parameters.
static const Writer * writer_get_by_name(const char *name)
int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end, unsigned int flags)
Read and decode a single UTF-8 code point (character) from the buffer in *buf, and update *buf to poi...
AVHDRPlusColorTransformParams params[3]
The color transform parameters for every processing window.
AVIAMFSubmixElement ** elements
Array of submix elements.
static const AVOption flat_options[]
AVBPrint section_pbuf[SECTION_MAX_NB_LEVELS]
generic print buffer dedicated to each section, used by various writers
#define AV_LOG_WARNING
Something somehow does not look correct.
unsigned int nb_layers
Number of layers, or channel groups, in the Audio Element.
#define AV_BPRINT_SIZE_UNLIMITED
#define AV_TIMECODE_STR_SIZE
enum AVDOVINLQMethod nlq_method_idc
static int use_byte_value_binary_prefix
int level
current level, starting from 0
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVStreamGroup ** stream_groups
A list of all stream groups in the file.
#define MAX_REGISTERED_WRITERS_NB
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
int base_param_k2
indicates k2_0 in the base parameter, base_param_k2 <= 1: k2_0 = base_param_k2 base_param_k2 > 1: res...
int64_t id
Group type-specific group ID.
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
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
static void writer_print_integer(WriterContext *wctx, const char *key, int64_t val)
static AVCodecContext * dec_ctx
#define SECTION_MAX_NB_LEVELS
@ SECTION_ID_STREAM_SIDE_DATA
AVIAMFSubmixLayout ** layouts
Array of submix layouts.
static int do_show_frame_tags
@ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT
Ambient viewing environment metadata, as defined by H.274.
static int mix(int c0, int c1)
static int show_stream_groups(WriterContext *w, InputFile *ifile)
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
static int opt_show_optional_fields(void *optctx, const char *opt, const char *arg)
static int read_intervals_nb
static int opt_output_file_o(void *optctx, const char *opt, const char *arg)
static int show_stream_group(WriterContext *w, InputFile *ifile, AVStreamGroup *stg)
enum AVMediaType codec_type
General type of the encoded data.
struct AVStreamGroupTileGrid * tile_grid
enum AVSphericalProjection projection
Projection type.
AVColorTransferCharacteristic
Color Transfer Characteristic.
AVRational base_param_Delta
base_param_Delta in the base parameter, in multiples of 1.0/127.
static int show_streams(WriterContext *w, InputFile *ifile)
int bit_depth_luma
Intended bit depth, or 0 for unknown/unspecified.
static void writer_put_str_printf(WriterContext *wctx, const char *str)
int base_enable_flag
This flag indicates that transfer the base paramter(for value of 1)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
static void default_print_int(WriterContext *wctx, const char *key, int64_t value)
#define AV_HASH_MAX_SIZE
Maximum value that av_hash_get_size() will currently return.
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
#define print_val(k, v, u)
@ AV_PKT_DATA_FRAME_CROPPING
The number of pixels to discard from the top/bottom/left/right border of the decoded frame to obtain ...
static void compact_print_section_footer(WriterContext *wctx)
@ SECTION_ID_PACKET_SIDE_DATA_LIST
unsigned int nb_chapters
Number of chapters in AVChapter array.
This struct describes the properties of an encoded stream.
AVRational percentile
The linearized maxRGB value at a specific percentile in the processing window in the scene.
const AVClass * priv_class
AVClass for the private context.
Ambient viewing environment metadata as defined by H.274.
enum AVColorSpace color_space
unsigned int default_w
Default weight value as defined in section 3.6 of IAMF.
int(* init)(WriterContext *wctx)
static char * value_string(char *buf, int buf_size, struct unit_value uv)
#define AVERROR_EOF
End of file.
uint8_t * data
The data buffer.
static int read_packets(WriterContext *w, InputFile *ifile)
int horizontal_offset
Offset in pixels from the left edge of the canvas where the actual image meant for presentation start...
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
@ AV_PKT_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata (based on SMPTE-2086:2014).
const char * long_name
A more descriptive name for this codec.
static void json_print_section_header(WriterContext *wctx, const void *data)
static void show_packet(WriterContext *w, InputFile *ifile, AVPacket *pkt, int packet_idx)
#define AV_PKT_FLAG_DISCARD
Flag is used to discard packets which are required to maintain valid decoder state but are not requir...
int three_Spline_num
The number of three Spline.
@ AV_FRAME_DATA_DOVI_METADATA
Parsed Dolby Vision metadata, suitable for passing to a software implementation.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
void(* print_section_footer)(WriterContext *wctx)
const char * name
Name of the codec described by this descriptor.
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 output
static int * selected_streams
@ SECTION_ID_PROGRAM_TAGS
uint8_t uv_points[2][10][2]
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
@ AV_FRAME_DATA_FILM_GRAIN_PARAMS
Film grain parameters for a frame, described by AVFilmGrainParams.
int blending_mode_id
Specifies the blending mode used to blend the simulated film grain with the decoded images.
unsigned int nb_submixes
Number of submixes in the presentation.
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
int disposition
Stream group disposition - a combination of AV_DISPOSITION_* flags.
@ AV_FRAME_DATA_S12M_TIMECODE
Timecode which conforms to SMPTE ST 12-1.
const AVClass * priv_class
private class of the writer, if any
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
unsigned MaxCLL
Max content light level (cd/m^2).
const struct section * section[SECTION_MAX_NB_LEVELS]
section per each level
static const char * json_escape_str(AVBPrint *dst, const char *src, void *log_ctx)
static int opt_input_file_i(void *optctx, const char *opt, const char *arg)
unsigned int nb_section_packet_frame
nb_section_packet or nb_section_frame according if is_packets_and_frames
This structure describes decoded (raw) audio or video data.
AVStream ** streams
A list of all streams in the file.
#define writer_put_str(wctx_, str_)
void(* print_integer)(WriterContext *wctx, const char *, int64_t)
This structure stores auxiliary information for decoding, presenting, or otherwise processing the cod...
static int validate_string(WriterContext *wctx, char **dstp, const char *src)
static void flat_print_section_header(WriterContext *wctx, const void *data)
@ SECTION_ID_STREAM_GROUP_COMPONENTS
int64_t mmr_coef[AV_DOVI_MAX_PIECES][3][7]
@ SECTION_ID_FRAME_SIDE_DATA_COMPONENT
enum AVIAMFParamDefinitionType type
Parameters type.
int parse_number(const char *context, const char *numstr, enum OptionType type, double min, double max, double *dst)
Parse a string and return its corresponding value as a double.
@ SECTION_ID_PIXEL_FORMAT_COMPONENTS
uint8_t num_cols_targeted_system_display_actual_peak_luminance
The number of columns in the targeted_system_display_actual_peak_luminance array.
int depth
Number of bits in the component.
void av_spherical_tile_bounds(const AVSphericalMapping *map, size_t width, size_t height, size_t *left, size_t *top, size_t *right, size_t *bottom)
Convert the bounding fields from an AVSphericalVideo from 0.32 fixed point to pixels.
AVRational ambient_light_x
Normalized x chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
AVRational enable_strength
3Spline_enable_Strength of three Spline.
static void json_print_int(WriterContext *wctx, const char *key, int64_t value)
const char * element_name
name of the contained element, if provided
@ SECTION_ID_PIXEL_FORMAT_FLAGS
AVRational avg_frame_rate
Average framerate.
int vertical_offset
Offset in pixels from the top edge of the canvas where the actual image meant for presentation starts...
int avio_open(AVIOContext **s, const char *filename, int flags)
Create and initialize a AVIOContext for accessing the resource indicated by url.
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
static void print_dovi_metadata(WriterContext *w, const AVDOVIMetadata *dovi)
AVDictionary * format_opts
static void print_iamf_submix_params(WriterContext *w, const AVIAMFSubmix *submix)
#define SECTION_MAX_NB_CHILDREN
enum AVColorSpace color_space
static int do_show_stream_tags
static char * ini_escape_str(AVBPrint *dst, const char *src)
enum AVDOVIMappingMethod mapping_idc[AV_DOVI_MAX_PIECES]
#define print_section_header(s)
@ SECTION_ID_PIXEL_FORMAT
static void writer_printf_printf(WriterContext *wctx, const char *fmt,...)
#define AV_LOG_VERBOSE
Detailed information.
@ SECTION_ID_PROGRAM_STREAM
void show_help_children(const AVClass *class, int flags)
Show help for all options with given flags in class and all its children.
Parameters as defined in section 3.6.1 of IAMF.
int flags
A combination of AV_OPT_FLAG_*.
@ AV_FRAME_DATA_DISPLAYMATRIX
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
@ SECTION_ID_STREAM_GROUP_SUBCOMPONENT
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
@ AV_SPHERICAL_EQUIRECTANGULAR_TILE
Video represents a portion of a sphere mapped on a flat surface using equirectangular projection.
static int check_section_show_entries(int section_id)
uint32_t baseline
The distance between the centres of the lenses of the camera system, in micrometers.
static void print_section(SectionID id, int level)
AVRational default_mix_gain
Default mix gain value to apply when there are no AVIAMFParamDefinition with element_mix_config's par...
int th_mode
The mode of three Spline.
int id
unique id identifying a section
static const AVOption writer_options[]
enum AVChannelOrder order
Channel order used in this layout.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
int vertical
Offset in pixels from the top edge of the canvas where the tile should be placed.
@ SECTION_ID_STREAM_GROUP_BLOCKS
const char * avcodec_profile_name(enum AVCodecID codec_id, int profile)
Return a name for the specified profile, if available.
static int do_show_stream_group_components
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
static void writer_register_all(void)
uint8_t mapping_color_space
static const char * output_filename
int nb_channels
Number of channels in this layout.
static int show_tags(WriterContext *w, AVDictionary *tags, int section_id)
int64_t avio_size(AVIOContext *s)
Get the filesize.
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
enum AVColorTransferCharacteristic color_trc
static int do_show_format_tags
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
uint64_t seed
Seed to use for the synthesis process, if the codec allows for it.
const char * av_chroma_location_name(enum AVChromaLocation location)
static void ini_print_section_header(WriterContext *wctx, const void *data)
static void print_film_grain_params(WriterContext *w, const AVFilmGrainParams *fgp)
const char * unique_name
unique section name, in case the name is ambiguous
void(* print_string)(WriterContext *wctx, const char *, const char *)
static int do_show_frames
static void xml_print_section_header(WriterContext *wctx, const void *data)
@ AV_FIELD_BT
Bottom coded first, top displayed first.
static av_cold int compact_init(WriterContext *wctx)
static void print_dispositions(WriterContext *w, uint32_t disposition, SectionID section_id)
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
static void xml_print_section_footer(WriterContext *wctx)
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
@ AV_PKT_DATA_DOVI_CONF
DOVI configuration ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2....
static int do_show_library_versions
AVRational horizontal_field_of_view
Horizontal field of view, in degrees.
static av_always_inline int process_frame(WriterContext *w, InputFile *ifile, AVFrame *frame, const AVPacket *pkt, int *packet_new)
enum AVColorPrimaries color_primaries
static void writer_print_data(WriterContext *wctx, const char *name, const uint8_t *data, int size)
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
static int match_section(const char *section_name, int show_all_entries, AVDictionary *entries)
static void print_iamf_param_definition(WriterContext *w, const char *name, const AVIAMFParamDefinition *param, SectionID section_id)
#define SECTION_FLAG_HAS_TYPE
For these sections the element_name field is mandatory.
static const char unit_hertz_str[]
#define AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES
exclude control codes not accepted by XML
static void xml_print_value(WriterContext *wctx, const char *key, const char *str, int64_t num, const int is_int)
@ AV_FIELD_TT
Top coded_first, top displayed first.
static int writer_close(WriterContext **wctx)
#define SHOW_OPTIONAL_FIELDS_NEVER
int three_Spline_enable_flag
indicates 3Spline_enable_flag in the base parameter, This flag indicates that transfer three Spline o...
static void writer_print_data_hash(WriterContext *wctx, const char *name, const uint8_t *data, int size)
static int show_optional_fields
static void json_print_section_footer(WriterContext *wctx)
const char * av_color_space_name(enum AVColorSpace space)
@ SECTION_ID_STREAM_GROUP
static int opt_pretty(void *optctx, const char *opt, const char *arg)
const struct AVCodec * codec
AVBufferRef * opaque_ref
AVBufferRef for free use by the API user.
static const AVOption json_options[]
static const AVOption default_options[]
static const char * writer_get_name(void *p)
const char * av_hash_get_name(const AVHashContext *ctx)
AVStreamGroupTileGrid holds information on how to combine several independent images on a single canv...
int grain_scale_shift
Signals the down shift applied to the generated gaussian numbers during synthesis.
static void print_chroma_location(WriterContext *w, enum AVChromaLocation chroma_location)
AVRational th_delta1
3Spline_TH_Delta1 of three Spline.
void(* uninit)(WriterContext *wctx)
if it could not because there are no more frames
#define SECTION_FLAG_HAS_VARIABLE_FIELDS
the section may contain a variable number of fields with variable keys.
Submix layout as defined in section 3.7.6 of IAMF.
const char * avformat_stream_group_name(enum AVStreamGroupParamsType type)
uint8_t dv_md_compression
static const Writer json_writer
int coded_width
Width of the canvas.
int refs
number of reference frames
void av_opt_free(void *obj)
Free all allocated objects in obj.
#define AVERROR_OPTION_NOT_FOUND
Option not found.
uint8_t num_windows
The number of processing windows.
#define AV_BPRINT_SIZE_AUTOMATIC
static void print_tile_grid_params(WriterContext *w, const AVStreamGroup *stg, const AVStreamGroupTileGrid *tile_grid)
static double val(void *priv, double ch)
static av_cold int json_init(WriterContext *wctx)
void show_help_default(const char *opt, const char *arg)
Per-fftool specific help handler.
int coded_height
Width of the canvas.
static const char * c_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
Apply C-language-like string escaping.
@ SECTION_ID_FRAME_SIDE_DATA_PIECE
#define us(width, name, range_min, range_max, subs,...)
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int limit_output_range
Signals to clip to limited color levels after film grain application.
static int show_log(WriterContext *w, int section_ids, int section_id, int log_level)
int64_t duration
Decoding: duration of the stream, in stream time base.
AVRational ambient_illuminance
Environmental illuminance of the ambient viewing environment in lux.
static const char * input_filename
#define print_duration_ts(k, v)
int num_y_points
Number of points, and the scale and value for each point of the piecewise linear scaling function for...
enum AVIAMFAudioElementType audio_element_type
Audio element type as defined in section 3.6 of IAMF.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
Recon Gain Info Parameter Data as defined in section 3.8.3 of IAMF.
int avformat_network_init(void)
Do global initialization of network libraries.
@ AV_FIELD_TB
Top coded first, bottom displayed first.
static int do_read_packets
This structure describes how to handle film grain synthesis for AOM codecs.
const char * av_stereo3d_view_name(unsigned int view)
Provide a human-readable name of a given stereo3d view.
static int opt_read_intervals(void *optctx, const char *opt, const char *arg)
uint8_t intensity_interval_upper_bound[3][256]
Specifies the upper bound of each intensity interval for which the set of model values applies for th...
void avsubtitle_free(AVSubtitle *sub)
Free all allocated data in the given subtitle struct.
@ AV_PKT_DATA_WEBVTT_SETTINGS
The optional settings (rendering instructions) that immediately follow the timestamp specifier of a W...
@ AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN
Subblocks are of struct type AVIAMFReconGain.
static void close_input_file(InputFile *ifile)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int parse_read_intervals(const char *intervals_spec)
int64_t bit_rate
Total stream bitrate in bit/s, 0 if not available.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
enum AVColorTransferCharacteristic color_trc
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
Decode a subtitle message.
static void json_print_item_str(WriterContext *wctx, const char *key, const char *value)
static const Writer default_writer
AVDictionary * annotations
A dictionary of strings describing the submix in different languages.
static void writer_print_time(WriterContext *wctx, const char *key, int64_t ts, const AVRational *time_base, int is_duration)
static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
#define FF_ARRAY_ELEMS(a)
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
static void print_iamf_audio_element_params(WriterContext *w, const AVStreamGroup *stg, const AVIAMFAudioElement *audio_element)
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,...
#define AV_PROFILE_UNKNOWN
static uint64_t * nb_streams_frames
int width
Intended display resolution.
#define AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES
Within AV_ESCAPE_MODE_XML, additionally escape double quotes for double quoted attributes.
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
int avformat_open_input(AVFormatContext **ps, const char *url, const AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
Get a human-readable string describing the channel layout properties.
@ SECTION_ID_STREAM_GROUP_STREAMS
void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, char *line, int line_size, int *print_prefix)
Format a line of log the same way as the default callback.
void(* print_rational)(WriterContext *wctx, AVRational *q, char *sep)
AVCodecContext * avcodec_alloc_context3(const AVCodec *codec)
Allocate an AVCodecContext and set its fields to default values.
const char * av_packet_side_data_name(enum AVPacketSideDataType type)
static int do_count_frames
int64_t end
chapter start/end time in time_base units
static void * writer_child_next(void *obj, void *prev)
#define print_section_footer(s)
int64_t end
start, end in second/AV_TIME_BASE units
This struct describes the properties of a single codec described by an AVCodecID.
static void log_read_interval(const ReadInterval *interval, void *log_ctx, int log_level)
uint8_t mmr_order[AV_DOVI_MAX_PIECES]
static const char unit_bit_per_second_str[]
static int show_program(WriterContext *w, InputFile *ifile, AVProgram *program)
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
static const AVOption xml_options[]
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
const struct AVInputFormat * iformat
The input container format.
static av_always_inline void * av_iamf_param_definition_get_subblock(const AVIAMFParamDefinition *par, unsigned int idx)
Get the subblock at the specified.
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int av_hash_alloc(AVHashContext **ctx, const char *name)
Allocate a hash context for the algorithm specified by name.
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().
AVRational targeted_system_display_maximum_luminance
The nominal maximum display luminance of the targeted system display, in units of 0....
static const char * get_frame_side_data_type(const void *data)
#define print_fmt(k, f,...)
int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
Return decoded output data from a decoder or encoder (when the AV_CODEC_FLAG_RECON_FRAME flag is used...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
enum AVIAMFHeadphonesMode headphones_rendering_mode
A value that indicates whether the referenced channel-based Audio Element shall be rendered to stereo...
static void xml_print_str(WriterContext *wctx, const char *key, const char *value)
#define AVIO_FLAG_WRITE
write-only
static int do_show_stream_group_tags
unsigned int index
Group index in AVFormatContext.
static int probe_file(WriterContext *wctx, const char *filename, const char *print_filename)
uint8_t mastering_display_actual_peak_luminance_flag
This flag shall be equal to 0 in bitstreams conforming to this version of this Specification.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
void(* writer_w8)(WriterContext *wctx, int b)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame)
Guess the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio.
static void flat_print_str(WriterContext *wctx, const char *key, const char *value)
static const char * get_raw_string_type(const void *data)
AVChannelLayout ch_layout
@ AV_PKT_DATA_STEREO3D
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
static void ffprobe_show_program_version(WriterContext *w)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int64_t pts
Same as packet pts, in AV_TIME_BASE.
static enum AVPixelFormat pixel_formats[]
static int do_show_chapter_tags
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
static int do_show_pixel_format_components
int nested_section[SECTION_MAX_NB_LEVELS]
int64_t rc_max_rate
maximum bitrate
@ SECTION_ID_STREAM_GROUP_SUBPIECE
static const Writer flat_writer
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
int16_t comp_model_value[3][256][6]
Specifies the model values for the component for each intensity interval.
int nb_coded_side_data
Amount of entries in coded_side_data.
static const char * flat_escape_value_str(AVBPrint *dst, const char *src)
static int do_show_chapters
This structure describes the bitrate properties of an encoded bitstream.
@ AV_FILM_GRAIN_PARAMS_NONE
int probe_score
format probing score.
static int show_chapters(WriterContext *w, InputFile *ifile)
uint8_t poly_order[AV_DOVI_MAX_PIECES]
@ AV_FRAME_DATA_DYNAMIC_HDR_VIVID
HDR Vivid dynamic metadata associated with a video frame.
static int find_stream_info
#define FF_CODEC_PROPERTY_FILM_GRAIN
int flags
Additional information about the frame packing.
static int do_show_pixel_format_flags
uint8_t percentage
The percentage value corresponding to a specific percentile linearized RGB value in the processing wi...
#define SECTION_FLAG_IS_WRAPPER
the section only contains other sections, but has no data at its own level
void avio_flush(AVIOContext *s)
Force flushing of buffered data.
int model_id
Specifies the film grain simulation mode.
static int open_input_file(InputFile *ifile, const char *filename, const char *print_filename)
uint64_t linear_deadzone_threshold
const char * av_color_range_name(enum AVColorRange range)
@ AVDISCARD_ALL
discard all
void init_dynload(void)
Initialize dynamic library loading.
static ReadInterval * read_intervals
Demixing Info Parameter Data as defined in section 3.8.2 of IAMF.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
@ SECTION_ID_STREAM_GROUPS
int avcodec_parameters_to_context(AVCodecContext *codec, const struct AVCodecParameters *par)
Fill the codec context based on the values from the supplied codec parameters.
#define LIBAVUTIL_VERSION_INT
AVIOContext * avio
the I/O context used to write
uint8_t application_version
Application version in the application defining document in ST-2094 suite.
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.
static void compact_print_str(WriterContext *wctx, const char *key, const char *value)
const char * av_hash_names(int i)
Get the names of available hash algorithms.
static void print_ambient_viewing_environment(WriterContext *w, const AVAmbientViewingEnvironment *env)
#define SET_DO_SHOW(id, varname)
static void writer_print_section_header(WriterContext *wctx, const void *data, int section_id)
static void print_color_range(WriterContext *w, enum AVColorRange color_range)
const char program_name[]
program name, defined by the program for show_version().
static const Writer compact_writer
uint8_t dv_bl_signal_compatibility_id
#define AV_DICT_MULTIKEY
Allow to store several equal keys in the dictionary.
uint8_t nb_components
The number of components each pixel has, (1-4)
void av_hash_init(AVHashContext *ctx)
Initialize or reset a hash context.
static void ERROR(const char *str)
static int do_read_frames
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, enum AVEscapeMode mode, int flags)
Escape the content in src and append it to dstbuf.
@ SECTION_ID_LIBRARY_VERSION
void avcodec_free_context(AVCodecContext **avctx)
Free the codec context and everything associated with it and write NULL to the provided pointer.
static const struct @11 si_prefixes[]
static struct AVHashContext * hash
Rational number (pair of numerator and denominator).
unsigned int duration
The accumulated duration of all blocks in this parameter definition, in units of 1 / parameter_rate.
#define writer_printf(wctx_, fmt_,...)
#define SHOW_OPTIONAL_FIELDS_ALWAYS
enum AVPacketSideDataType type
int filter_codec_opts(const AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec, AVDictionary **dst, AVDictionary **opts_used)
Filter out options for given codec.
AVRational horizontal_disparity_adjustment
Relative shift of the left and right images, which changes the zero parallax plane.
AVIOContext * pb
I/O context.
void av_log_set_flags(int arg)
A layer defining a Channel Layout in the Audio Element.
@ SECTION_ID_STREAM_GROUP_PIECE
@ AV_FRAME_DATA_ICC_PROFILE
The data contains an ICC profile as an opaque octet buffer following the format described by ISO 1507...
This struct represents dynamic metadata for color volume transform - CUVA 005.1:2021 standard.
char * name
name of this writer instance
@ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
Mastering display metadata associated with a video frame.
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
int av_parse_time(int64_t *timeval, const char *timestr, int duration)
Parse timestr and return in *time a corresponding number of microseconds.
static void print_pkt_side_data(WriterContext *w, AVCodecParameters *par, const AVPacketSideData *sd, SectionID id_data)
#define AV_DICT_DONT_OVERWRITE
Don't overwrite existing entries.
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
Initialize the AVCodecContext to use the given AVCodec.
static av_cold int xml_init(WriterContext *wctx)
const struct section * sections
array containing all sections
void avio_w8(AVIOContext *s, int b)
void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
Update a hash context with additional data.
static const Writer csv_writer
static void print_color_trc(WriterContext *w, enum AVColorTransferCharacteristic color_trc)
static void print_stream_group_params(WriterContext *w, AVStreamGroup *stg)
AVChannelLayout ch_layout
Audio only.
int subsampling_x
Intended subsampling ratio, or 0 for luma-only streams.
int64_t mmr_constant[AV_DOVI_MAX_PIECES]
static int do_show_programs
@ AV_FRAME_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
static int read_interval_packets(WriterContext *w, InputFile *ifile, const ReadInterval *interval, int64_t *cur_ts)
static const OptionDef real_options[]
@ AV_PKT_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
@ AVCOL_RANGE_UNSPECIFIED
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
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 const char unit_byte_str[]
const int program_birth_year
program birth year, defined by the program for show_banner()
int sample_rate
Audio only.
unsigned int output_gain_flags
Output gain channel flags as defined in section 3.6.2 of IAMF.
#define pthread_mutex_unlock(a)
void av_hash_freep(AVHashContext **ctx)
Free hash context and set hash context pointer to NULL.
static int show_format(WriterContext *w, InputFile *ifile)
int64_t nb_frames
number of frames in this stream if known or 0
unsigned int audio_element_id
The id of the Audio Element this submix element references.
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
static void xml_print_int(WriterContext *wctx, const char *key, int64_t value)
#define print_duration_time(k, v, tb)
@ AV_PKT_DATA_SPHERICAL
This side data should be associated with a video stream and corresponds to the AVSphericalMapping str...
int extradata_size
Size of the extradata content in bytes.
Submix layout as defined in section 3.7 of IAMF.
static int show_value_unit
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
enum AVStereo3DPrimaryEye primary_eye
Which eye is the primary eye when rendering in 2D.
static const AVColorPrimariesDesc color_primaries[AVCOL_PRI_NB]
static const char * print_input_filename
int num_uv_points[2]
If chroma_scaling_from_luma is set to 0, signals the chroma scaling function parameters.
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
AVDictionary * codec_opts
static const char * csv_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
Quote fields containing special characters, check RFC4180.
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
static int writer_open(WriterContext **wctx, const Writer *writer, const char *args, const struct section *sections, int nb_sections, const char *output)
static AVFormatContext * fmt_ctx
@ WRITER_STRING_VALIDATION_IGNORE
#define writer_w8(wctx_, b_)
const char * av_spherical_projection_name(enum AVSphericalProjection projection)
Provide a human-readable name of a given AVSphericalProjection.
@ SECTION_ID_STREAM_GROUP_PIECES
int(* init)(AVBSFContext *ctx)
@ AV_SPHERICAL_CUBEMAP
Video frame is split into 6 faces of a cube, and arranged on a 3x2 layout.
#define av_ts2timestr(ts, tb)
Convenience macro, the return value should be used only directly in function arguments but never stan...
unsigned int string_validation_utf8_flags
unsigned int subblock_duration
Duration for the given subblock, in units of 1 / parameter_rate.
void av_log_set_callback(void(*callback)(void *, int, const char *, va_list))
Set the logging callback.
uint8_t num_rows_mastering_display_actual_peak_luminance
The number of rows in the mastering_display_actual_peak_luminance array.
static int do_show_packet_tags
int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
Check if the stream st contained in s is matched by the stream specifier spec.
@ SECTION_ID_STREAM_DISPOSITION
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
@ AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT
Ambient viewing environment metadata, as defined by H.274.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define PRINT_PIX_FMT_FLAG(flagname, name)
static void writer_w8_avio(WriterContext *wctx, int b)
#define AV_PIX_FMT_FLAG_RGB
The pixel format contains RGB-like data (as opposed to YUV/grayscale).
AVClassCategory category
Category used for visualization (like color).
int component_model_present[3]
Indicates if the modelling of film grain for a given component is present.
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
@ AV_PKT_DATA_DYNAMIC_HDR10_PLUS
HDR10+ dynamic metadata associated with a video frame.
uint8_t num_windows
The number of processing windows.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
const char * av_stereo3d_primary_eye_name(unsigned int eye)
Provide a human-readable name of a given stereo3d primary eye.
char * url
input or output URL.
#define SECTION_FLAG_IS_ARRAY
the section contains an array of elements of the same type
AVRational pkt_timebase
Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed.
#define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n)
@ SECTION_ID_STREAM_GROUP_COMPONENT
void uninit_opts(void)
Uninitialize the cmdutils option system, in particular free the *_opts contexts and their contents.
AVClassCategory(* get_category)(void *ctx)
Callback to return the instance category.
@ SECTION_ID_CHAPTER_TAGS
@ AV_ESCAPE_MODE_XML
Use XML non-markup character data escaping.
static int show_private_data
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.
AVRational mastering_display_actual_peak_luminance[25][25]
The normalized actual peak luminance of the mastering display used for mastering the image essence.
struct AVIAMFAudioElement * iamf_audio_element
static int opt_show_versions(void *optctx, const char *opt, const char *arg)
This structure describes how to handle film grain synthesis in video for specific codecs.
static int opt_input_file(void *optctx, const char *arg)
int profile
Codec-specific bitstream restrictions that the stream conforms to.
@ AVCHROMA_LOC_UNSPECIFIED
static void ffprobe_show_library_versions(WriterContext *w)
printf("static const uint8_t my_array[100] = {\n")
@ SECTION_ID_PACKETS_AND_FRAMES
static int use_value_prefix
int nested_section[SECTION_MAX_NB_LEVELS]
int64_t min_bitrate
Minimum bitrate of the stream, in bits per second.
uint32_t end_display_time
static void show_error(WriterContext *w, int err)
int flags
a combination or WRITER_FLAG_*
int av_packet_unpack_dictionary(const uint8_t *data, size_t size, AVDictionary **dict)
Unpack a dictionary from side_data.
void show_banner(int argc, char **argv, const OptionDef *options)
Print the program banner to stderr.
static void ini_print_str(WriterContext *wctx, const char *key, const char *value)
static void writer_put_str_avio(WriterContext *wctx, const char *str)
static void print_frame_side_data(WriterContext *w, const AVFrame *frame, const AVStream *stream)
int base_param_k1
indicates k1_0 in the base parameter, base_param_k1 <= 1: k1_0 = base_param_k1 base_param_k1 > 1: res...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
uint32_t padding
Number of pixels to pad from the edge of each cube face.
unsigned int constant_subblock_duration
The duration of every subblock in the case where all subblocks, with the optional exception of the la...
unsigned int nb_section_frame
number of the frame section in case we are in "packets_and_frames" section
Information on how to combine one or more audio streams, as defined in section 3.6 of IAMF.
const SectionID children_ids[SECTION_MAX_NB_CHILDREN+1]
list of children section IDS, terminated by -1
int64_t poly_coef[AV_DOVI_MAX_PIECES][3]
@ SECTION_ID_FRAME_SIDE_DATA_LIST
unsigned int nb_tiles
Amount of tiles in the grid.
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 offset
@ SECTION_ID_STREAM_GROUP_STREAM_TAGS
Mix Gain Parameter Data as defined in section 3.8.1 of IAMF.
int flags
A combination of AV_PKT_FLAG values.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
static int do_show_format
int64_t avg_bitrate
Average bitrate of the stream, in bits per second.
AVFilmGrainH274Params h274
#define va_copy(dst, src)
static int writer_print_string(WriterContext *wctx, const char *key, const char *val, int flags)
static void ini_print_int(WriterContext *wctx, const char *key, int64_t value)
static void compact_print_int(WriterContext *wctx, const char *key, int64_t value)
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
AVStream ** streams
A list of streams in the group.
int8_t ar_coeffs_y[24]
Luma auto-regression coefficients.
AVDictionary * entries_to_show
struct AVIAMFMixPresentation * iamf_mix_presentation
static int do_show_stream_disposition
static int do_show_stream_groups
#define AV_LOG_INFO
Standard information.
@ AV_FRAME_DATA_VIEW_ID
This side data must be associated with a video frame.
uint8_t num_rows_targeted_system_display_actual_peak_luminance
The number of rows in the targeted system_display_actual_peak_luminance array.
int priv_size
private size for the writer context
AVChromaLocation
Location of chroma samples.
static const Writer * registered_writers[MAX_REGISTERED_WRITERS_NB+1]
void(* writer_printf)(WriterContext *wctx, const char *fmt,...)
static int do_count_packets
static const AVInputFormat * iformat
#define SHOW_OPTIONAL_FIELDS_AUTO
static av_always_inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
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
@ AV_PKT_DATA_STRINGS_METADATA
A list of zero terminated key/value strings.
static struct section sections[]
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
uint64_t vbv_delay
The delay between the time the packet this structure is associated with is received and the time when...
void(* writer_put_str)(WriterContext *wctx, const char *str)
@ SECTION_ID_PROGRAM_STREAM_TAGS
int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt)
Supply raw packet data as input to a decoder.
const AVOption * av_opt_next(const void *obj, const AVOption *last)
Iterate over all AVOptions belonging to obj.
@ AV_PKT_DATA_CPB_PROPERTIES
This side data corresponds to the AVCPBProperties struct.
@ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL
Content light level (based on CTA-861.3).
int width
Width of the final image for presentation.
int32_t roll
Rotation around the forward vector [-180, 180].
enum AVColorPrimaries color_primaries
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
char * av_timecode_make_smpte_tc_string2(char *buf, AVRational rate, uint32_t tcsmpte, int prevent_df, int skip_field)
Get the timecode string from the SMPTE timecode format.
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
unsigned int parameter_id
Identifier for the paremeter substream.
unsigned properties
Properties of the stream that gets decoded.
int64_t id
unique ID to identify the chapter
static void print_color_space(WriterContext *w, enum AVColorSpace color_space)
static void ffprobe_show_pixel_formats(WriterContext *w)
@ WRITER_STRING_VALIDATION_NB
int setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *local_codec_opts, AVDictionary ***dst)
Setup AVCodecContext options for avformat_find_stream_info().
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
static void show_usage(void)
unsigned int nb_item[SECTION_MAX_NB_LEVELS]
number of the item printed in the given section, starting from 0
This structure describes how to handle film grain synthesis for codecs using the ITU-T H....
static const AVOption csv_options[]
@ SECTION_ID_STREAM_GROUP_STREAM
AVRational targeted_system_display_maximum_luminance
The nominal maximum display luminance of the targeted system display, in multiples of 1....
static void show_subtitle(WriterContext *w, AVSubtitle *sub, AVStream *stream, AVFormatContext *fmt_ctx)
static void print_private_data(WriterContext *w, void *priv_data)
uint16_t num_intensity_intervals[3]
Specifies the number of intensity intervals for which a specific set of model values has been estimat...
#define av_malloc_array(a, b)
AVColorSpace
YUV colorspace type.
@ AV_FIELD_BB
Bottom coded first, bottom displayed first.
Information on how to render and mix one or more AVIAMFAudioElement to generate the final audio outpu...
int64_t max_bitrate
Maximum bitrate of the stream, in bits per second.
uint32_t num_y_partitions
static void writer_print_ts(WriterContext *wctx, const char *key, int64_t ts, int is_duration)
union unit_value::@12 val
int parse_options(void *optctx, int argc, char **argv, const OptionDef *options, int(*parse_arg_function)(void *, const char *))
static int opt_show_entries(void *optctx, const char *opt, const char *arg)
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
static av_const int av_toupper(int c)
Locale-independent conversion of ASCII characters to uppercase.
@ SECTION_ID_FRAME_SIDE_DATA
@ SECTION_ID_FRAME_SIDE_DATA_COMPONENT_LIST
static int opt_sections(void *optctx, const char *opt, const char *arg)
const char *(* escape_str)(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
void * priv
private data for use by the filter
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int scaling_shift
Specifies the shift applied to the chroma components.
@ AV_PKT_DATA_MPEGTS_STREAM_ID
MPEGTS stream ID as uint8_t, this is required to pass the stream ID information from the demuxer to t...
New fields can be added to the end with minor version bumps.
enum AVColorRange color_range
Video only.
static char * upcase_string(char *dst, size_t dst_size, const char *src)
static int do_show_stream_group_disposition
Coefficients of the non-linear inverse quantization.
int base_param_Delta_enable_mode
This flag indicates that delta mode of base paramter(for value of 1)
AVPacketSideData * coded_side_data
Additional data associated with the entire stream.
@ SECTION_ID_PACKET_SIDE_DATA
static int use_value_sexagesimal_format
@ SECTION_ID_LIBRARY_VERSIONS
#define AV_FRAME_FLAG_INTERLACED
A flag to mark frames whose content is interlaced.
void * av_calloc(size_t nmemb, size_t size)
uint8_t intensity_interval_lower_bound[3][256]
Specifies the lower ounds of each intensity interval for whichthe set of model values applies for the...
@ SECTION_ID_FRAME_SIDE_DATA_TIMECODE
unsigned int nb_subblocks
Number of subblocks in the array.
@ AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE
enum AVFieldOrder field_order
Video only.
@ SECTION_ID_PROGRAM_VERSION
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
static const char * none_escape_str(AVBPrint *dst, const char *src, const char sep, void *log_ctx)
AVDOVIReshapingCurve curves[3]
int horizontal
Offset in pixels from the left edge of the canvas where the tile should be placed.
static const Writer ini_writer
void parse_loglevel(int argc, char **argv, const OptionDef *options)
Find the '-loglevel' option in the command line args and apply it.
struct AVStreamGroupTileGrid::@364 * offsets
An nb_tiles sized array of offsets in pixels from the topleft edge of the canvas, indicating where ea...
uint64_t linear_deadzone_slope
static void json_print_str(WriterContext *wctx, const char *key, const char *value)
unsigned int nb_layouts
Number of layouts in the submix.
char * string_validation_replacement
const char *(* get_type)(const void *data)
function returning a type if defined, must be defined when SECTION_FLAG_HAS_TYPE is defined
int disposition
Stream disposition - a combination of AV_DISPOSITION_* flags.
AVBufferRef * av_buffer_allocz(size_t size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
int id
Format-specific stream ID.
@ AV_FRAME_DATA_GOP_TIMECODE
The GOP timecode in 25 bit timecode format.
static LogBuffer * log_buffer
void avcodec_flush_buffers(AVCodecContext *avctx)
Reset the internal codec state / flush internal buffers.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int64_t buffer_size
The size of the buffer to which the ratecontrol is applied, in bits.
int32_t pitch
Rotation around the right vector [-90, 90].
AVDictionary * metadata
Metadata that applies to the whole group.
void log_callback_help(void *ptr, int level, const char *fmt, va_list vl)
Trivial log callback.
static void flat_print_int(WriterContext *wctx, const char *key, int64_t value)
enum AVStereo3DType type
How views are packed within the video.
static int parse_read_interval(const char *interval_spec, ReadInterval *interval)
Parse interval specification, according to the format: INTERVAL ::= [START|+START_OFFSET][%[END|+END_...
HDR Vivid three spline params.
void av_bprintf(AVBPrint *buf, const char *fmt,...)
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
static av_cold int flat_init(WriterContext *wctx)
#define AV_LOG_SKIP_REPEATED
Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 woul...
#define CMDUTILS_COMMON_OPTIONS
#define AV_DICT_MATCH_CASE
Only get an entry with exact-case key match.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int avio_vprintf(AVIOContext *s, const char *fmt, va_list ap)
Writes a formatted string to the context taking a va_list.
static int log_buffer_size
enum AVChromaLocation chroma_location
@ AV_PKT_DATA_WEBVTT_IDENTIFIER
The optional first identifier line of a WebVTT cue.
int avformat_network_deinit(void)
Undo the initialization done by avformat_network_init.
const Writer * writer
the Writer of which this is an instance
AVRational base_param_m_n
base_param_m_n in the base parameter, in multiples of 1.0/10.
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.
@ AV_FRAME_DATA_DYNAMIC_HDR_PLUS
HDR dynamic metadata associated with a video frame.
AVRational base_param_m_a
base_param_m_a in the base parameter, in multiples of 1.0/1023.
main external API structure.
int index
stream index in AVFormatContext
char * av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit)
Get the timecode string from the 25-bit timecode format (MPEG GOP format).
int ar_coeff_lag
Specifies the auto-regression lag.
uint8_t mapping_chroma_format_idc
unsigned int nb_streams
Number of elements in AVStreamGroup.streams.
static const char * get_packet_side_data_type(const void *data)
@ AV_FILM_GRAIN_PARAMS_H274
The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
AVRational default_mix_gain
Default mix gain value to apply when there are no AVIAMFParamDefinition with output_mix_config's para...
static uint64_t * nb_streams_packets
uint8_t targeted_system_display_actual_peak_luminance_flag
This flag shall be equal to 0 in bit streams conforming to this version of this Specification.
static int do_show_program_version
int uv_offset[2]
Offset used for component scaling function.
#define DEFINE_OPT_SHOW_SECTION(section, target_section_id)
#define PRINT_STRING_VALIDATE
@ AV_OPT_TYPE_INT
Underlying C type is int.
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...
AVRational th_enable
3Spline_TH_enable of three Spline.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
@ SECTION_ID_PIXEL_FORMATS
@ SECTION_ID_STREAM_GROUP_BLOCK
int av_dict_parse_string(AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags)
Parse the key/value pairs list and add the parsed entries to a dictionary.
#define print_str_validate(k, v)
enum AVFrameSideDataType type
static char * output_format
int log2_scale_factor
Specifies a scale factor used in the film grain characterization equations.
int uv_mult[2]
Specifies the luma/chroma multipliers for the index to the component scaling function.
@ AV_PKT_DATA_AFD
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
AVComponentDescriptor comp[4]
Parameters that describe how pixels are packed.
static const AVOption ini_options[]
AVRational r_frame_rate
Real base framerate of the stream.
static void print_dynamic_hdr10_plus(WriterContext *w, const AVDynamicHDRPlus *metadata)
@ AV_PKT_DATA_SKIP_SAMPLES
Recommmends skipping the specified number of samples.
#define CHECK_COMPLIANCE(opt, opt_name)
static const OptionDef * options
static int do_show_pixel_formats
@ AV_CODEC_ID_PROBE
codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
@ AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN
Subblocks are of struct type AVIAMFMixGain.
const AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
Color tone mapping parameters at a processing window in a dynamic metadata for CUVA 005....
uint8_t num_model_values[3]
Specifies the number of model values present for each intensity interval in which the film grain has ...
enum AVColorRange color_range
Intended video signal characteristics.
#define DEFINE_WRITER_CLASS(name)
static int opt_print_filename(void *optctx, const char *opt, const char *arg)
unsigned int nb_elements
Number of elements in the submix.
static const char * get_stream_group_type(const void *data)
int overlap_flag
Signals whether to overlap film grain blocks.
int coded_width
Bitstream width / height, may be different from width/height e.g.
@ AV_PKT_DATA_AUDIO_SERVICE_TYPE
This side data should be associated with an audio stream and corresponds to enum AVAudioServiceType.
char * av_strdup(const char *s)
Duplicate a string.
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
void(* print_section_header)(WriterContext *wctx, const void *data)
static int do_show_program_tags
@ WRITER_STRING_VALIDATION_REPLACE
void av_log_default_callback(void *ptr, int level, const char *fmt, va_list vl)
Default logging callback.
AVIAMFParamDefinition * demixing_info
Demixing information used to reconstruct a scalable channel audio representation.
static void writer_printf_avio(WriterContext *wctx, const char *fmt,...)
unsigned int dmixp_mode
Pre-defined combination of demixing parameters.
AVIAMFParamDefinition * output_mix_config
Information required for post-processing the mixed audio signal to generate the audio signal for play...
enum AVStreamGroupParamsType type
Group type.
enum AVIAMFAmbisonicsMode ambisonics_mode
Ambisonics mode as defined in section 3.6.3 of IAMF.
union AVFilmGrainParams::@434 codec
Additional fields may be added both here and in any structure included.
void av_hash_final_hex(struct AVHashContext *ctx, uint8_t *dst, int size)
Finalize a hash context and store the hexadecimal representation of the actual hash value as a string...
int video_delay
Video only.
const char * item_start_end
Structure to hold side data for an AVFrame.
AVHDRVividColorTransformParams params[3]
The color transform parameters for every processing window.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
static void default_print_section_header(WriterContext *wctx, const void *data)
@ SECTION_ID_STREAM_GROUP_TAGS
AVDictionary * annotations
A dictionary of strings describing the mix in different languages.
@ SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST
@ WRITER_STRING_VALIDATION_FAIL
unsigned int nb_stream_groups
Number of elements in AVFormatContext.stream_groups.
int height
Height of the final image for presentation.
enum AVStereo3DView view
Determines which views are packed.
AVRational output_gain
Output gain as defined in section 3.6.2 of IAMF.
static const AVOption compact_options[]
int has_nested_elems[SECTION_MAX_NB_LEVELS]
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
#define AV_OPT_FLAG_EXPORT
The option is intended for exporting values to the caller.
This structure stores compressed data.
unsigned MaxFALL
Max average light level per frame (cd/m^2).
uint16_t pivots[AV_DOVI_MAX_PIECES+1]
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
int nb_sections
number of sections
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.
static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_idx, InputStream *ist, int container)
int64_t pos
byte position in stream, -1 if unknown
AVRational targeted_system_display_actual_peak_luminance[25][25]
The normalized actual peak luminance of the targeted system display.
static void print_dynamic_hdr_vivid(WriterContext *w, const AVDynamicHDRVivid *metadata)
const char * av_frame_side_data_name(enum AVFrameSideDataType type)
#define SHOW_LIB_VERSION(libname, LIBNAME)
static void writer_print_rational(WriterContext *wctx, const char *key, AVRational q, char sep)
AVIAMFParamDefinition * element_mix_config
Information required required for applying any processing to the referenced and rendered Audio Elemen...
unsigned int parameter_rate
Sample rate for the paremeter substream.
Submix element as defined in section 3.7 of IAMF.
#define flags(name, subs,...)
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
@ AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
uint8_t system_start_code
The system start code.
int64_t start_time
Position of the first frame of the component, in AV_TIME_BASE fractional seconds.
static void writer_print_section_footer(WriterContext *wctx)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
@ SECTION_ID_FRAME_SIDE_DATA_PIECE_LIST
int base_param_k3
indicates k3_0 in the base parameter, base_param_k3 == 1: k3_0 = base_param_k3 base_param_k3 == 2: k3...
@ SECTION_ID_PROGRAM_STREAMS
const char * av_stereo3d_type_name(unsigned int type)
Provide a human-readable name of a given stereo3d type.
int parent_log_context_offset
Offset in the structure where a pointer to the parent context for logging is stored.
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
@ SECTION_ID_STREAM_GROUP_DISPOSITION
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
AVClassCategory parent_category
@ SECTION_ID_PROGRAM_STREAM_DISPOSITION
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
AVRational th_delta2
3Spline_TH_Delta2 of three Spline.
AVIAMFParamDefinition * recon_gain_info
Recon gain information used to reconstruct a scalable channel audio representation.
Stereo 3D type: this structure describes how two videos are packed within a single video surface,...
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
@ SECTION_ID_STREAM_GROUP_SUBPIECES
static char * show_data_hash
@ SECTION_ID_STREAM_GROUP_STREAM_DISPOSITION
AVRational th_enable_mb
three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive and in multiples of 1....
const char *(* item_name)(void *ctx)
A pointer to a function which returns the name of a context instance ctx associated with the class.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
static void print_primaries(WriterContext *w, enum AVColorPrimaries color_primaries)
AVRational ambient_light_y
Normalized y chromaticity coordinate of the environmental ambient light in the nominal viewing enviro...
static int do_show_streams
int chroma_scaling_from_luma
Signals whether to derive the chroma scaling function from the luma.
unsigned int idx
Index of the stream in the group this tile references.
static void print_iamf_mix_presentation_params(WriterContext *w, const AVStreamGroup *stg, const AVIAMFMixPresentation *mix_presentation)
AVColorRange
Visual content value range.
AVRational time_base
time base in which the start/end timestamps are specified
@ AV_FILM_GRAIN_PARAMS_AV1
The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
AVHDRVivid3SplineParams three_spline[2]
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
AVRational base_param_m_p
base_param_m_p in the base parameter, in multiples of 1.0/16383.
enum AVFilmGrainParamsType type
Specifies the codec for which this structure is valid.
AVIAMFSubmix ** submixes
Array of submixes.
static 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...
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
static char * stream_specifier
static void writer_print_integers(WriterContext *wctx, const char *name, uint8_t *data, int size, const char *format, int columns, int bytes, int offset_add)
static void log_callback(void *ptr, int level, const char *fmt, va_list vl)
int initial_padding
Audio only.
void * priv_data
Format private data.
Dolby Vision RPU data mapping parameters.
#define print_time(k, v, tb)
static void default_print_str(WriterContext *wctx, const char *key, const char *value)
This structure describes how to handle spherical videos, outlining information about projection,...
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
#define print_str_opt(k, v)
static av_const int av_tolower(int c)
Locale-independent conversion of ASCII characters to lowercase.
unsigned int nb_section_packet
number of the packet section in case we are in "packets_and_frames" section
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
uint32_t start_display_time
int terminate_line[SECTION_MAX_NB_LEVELS]
static void default_print_section_footer(WriterContext *wctx)
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
@ SECTION_ID_PIXEL_FORMAT_COMPONENT
int32_t yaw
Rotation around the up vector [-180, 180].
AVRational base_param_m_b
base_param_m_b in the base parameter, in multiples of 1/1023.
#define AV_DICT_DONT_STRDUP_KEY
Take ownership of a key that's been allocated with av_malloc() or another memory allocation function.
AVRational base_param_m_m
base_param_m_m in the base parameter, in multiples of 1.0/10.
static const char unit_second_str[]
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.
uint8_t num_cols_mastering_display_actual_peak_luminance
The number of columns in the mastering_display_actual_peak_luminance array.
uint32_t num_x_partitions
int ar_coeff_shift
Specifies the range of the auto-regressive coefficients.
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.
static const AVClass writer_class
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
static int do_show_packets
@ AV_IAMF_PARAMETER_DEFINITION_DEMIXING
Subblocks are of struct type AVIAMFDemixingInfo.
static int show_programs(WriterContext *w, InputFile *ifile)
@ SECTION_ID_STREAM_GROUP_SUBCOMPONENTS
#define av_fourcc2str(fourcc)
#define pthread_mutex_lock(a)
#define print_list_fmt(k, f, n, m,...)
static void writer_w8_printf(WriterContext *wctx, int b)
static void bprint_bytes(AVBPrint *bp, const uint8_t *ubuf, size_t ubuf_size)
FF_VISIBILITY_POP_HIDDEN av_cold void avdevice_register_all(void)
Initialize libavdevice and register all the input and output devices.
int8_t ar_coeffs_uv[2][25]
Chroma auto-regression coefficients.
static int writer_register(const Writer *writer)