Go to the documentation of this file.
27 #include "libavutil/ffversion.h"
60 # ifdef pthread_mutex_lock
61 # undef pthread_mutex_lock
63 # define pthread_mutex_lock(a) do{}while(0)
64 # ifdef pthread_mutex_unlock
65 # undef pthread_mutex_unlock
67 # define pthread_mutex_unlock(a) do{}while(0)
139 #define SECTION_MAX_NB_CHILDREN 10
145 #define SECTION_FLAG_IS_WRAPPER 1
146 #define SECTION_FLAG_IS_ARRAY 2
147 #define SECTION_FLAG_HAS_VARIABLE_FIELDS 4
264 static const struct {
270 { 1.0, 1.0,
"",
"" },
271 { 1.024e3, 1e3,
"Ki",
"K" },
272 { 1.048576e6, 1e6,
"Mi",
"M" },
273 { 1.073741824e9, 1e9,
"Gi",
"G" },
274 { 1.099511627776e12, 1e12,
"Ti",
"T" },
275 { 1.125899906842624e15, 1e15,
"Pi",
"P" },
308 static int print_prefix = 1;
309 void *new_log_buffer;
320 if (new_log_buffer) {
333 for (
i=strlen(msg) - 1;
i>=0 && msg[
i] ==
'\n';
i--) {
339 if (parent && *parent) {
342 (*parent)->get_category ? (*parent)->get_category(parent) :(*parent)->category;
364 union {
double d;
long long int i; }
val;
378 vald = vali = uv.
val.
i;
385 mins = (
int)secs / 60;
386 secs = secs - mins * 60;
389 snprintf(buf, buf_size,
"%d:%02d:%09.6f", hours, mins, secs);
391 const char *prefix_string =
"";
402 index = (
long long int) (log10(vald)) / 3;
411 snprintf(buf, buf_size,
"%f", vald);
413 snprintf(buf, buf_size,
"%lld", vali);
425 #define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS 1
426 #define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER 2
451 #define SECTION_MAX_NB_LEVELS 10
487 #define OFFSET(x) offsetof(WriterContext, x)
490 {
"string_validation",
"set string validation mode",
492 {
"sv",
"set string validation mode",
497 {
"string_validation_replacement",
"set string validation replacement string",
OFFSET(string_validation_replacement),
AV_OPT_TYPE_STRING, {.str=
""}},
498 {
"svr",
"set string validation replacement string",
OFFSET(string_validation_replacement),
AV_OPT_TYPE_STRING, {.str=
"\xEF\xBF\xBD"}},
505 if (!prev &&
ctx->writer &&
ctx->writer->priv_class &&
ctx->priv)
525 if ((*wctx)->writer->uninit)
526 (*wctx)->writer->uninit(*wctx);
529 if ((*wctx)->writer->priv_class)
540 for (
i = 0;
i < ubuf_size;
i++)
561 (*wctx)->writer = writer;
564 (*wctx)->nb_sections = nb_sections;
569 void *priv_ctx = (*wctx)->priv;
580 av_log(*wctx,
AV_LOG_ERROR,
"Failed to parse option string '%s' provided to writer context\n", args);
587 av_log(*wctx,
AV_LOG_ERROR,
"Failed to set option '%s' with value '%s' provided to writer context\n",
599 const uint8_t *p = (*wctx)->string_validation_replacement;
600 const uint8_t *endp = p + strlen(p);
610 "Invalid UTF8 sequence %s found in string validation replace '%s'\n",
611 bp.str, (*wctx)->string_validation_replacement);
620 if ((*wctx)->writer->init)
621 ret = (*wctx)->writer->init(*wctx);
635 int parent_section_id;
638 parent_section_id = wctx->
level ?
659 int parent_section_id = wctx->
level ?
674 const char *
key,
long long int val)
688 int invalid_chars_nb = 0,
ret = 0;
703 "Invalid UTF-8 sequence %s found in string '%s'\n", bp.str,
src);
713 "Invalid UTF-8 sequence found in string '%s'\n",
src);
730 "%d invalid UTF-8 sequence(s) found in string '%s', replaced with '%s'\n",
739 #define PRINT_STRING_OPT 1
740 #define PRINT_STRING_VALIDATE 2
756 if (
ret < 0)
goto end;
758 if (
ret < 0)
goto end;
763 "Invalid key=value string combination %s=%s in section %s\n",
788 int64_t ts,
const AVRational *time_base,
int is_duration)
792 if ((!is_duration && ts ==
AV_NOPTS_VALUE) || (is_duration && ts == 0)) {
795 double d = ts *
av_q2d(*time_base);
806 if ((!is_duration && ts ==
AV_NOPTS_VALUE) || (is_duration && ts == 0)) {
824 for (
i = 0;
i < l;
i++) {
830 for (
i = 0;
i < l;
i++)
851 p = buf + strlen(buf);
858 int columns,
int bytes,
int offset_add)
868 for (
i = 0;
i < l;
i++) {
882 #define MAX_REGISTERED_WRITERS_NB 64
888 static int next_registered_writer_idx = 0;
911 #define DEFINE_WRITER_CLASS(name) \
912 static const char *name##_get_name(void *ctx) \
916 static const AVClass name##_class = { \
917 .class_name = #name, \
918 .item_name = name##_get_name, \
919 .option = name##_options \
932 #define OFFSET(x) offsetof(DefaultContext, x)
935 {
"noprint_wrappers",
"do not print headers and footers",
OFFSET(noprint_wrappers),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
948 for (
i = 0;
src[
i] &&
i < dst_size-1;
i++)
963 if (parent_section &&
1018 .priv_class = &default_class,
1026 static const char *
c_escape_str(AVBPrint *dst,
const char *
src,
const char sep,
void *log_ctx)
1030 for (p =
src; *p; p++) {
1032 case '\b':
av_bprintf(dst,
"%s",
"\\b");
break;
1033 case '\f':
av_bprintf(dst,
"%s",
"\\f");
break;
1034 case '\n':
av_bprintf(dst,
"%s",
"\\n");
break;
1035 case '\r':
av_bprintf(dst,
"%s",
"\\r");
break;
1036 case '\\':
av_bprintf(dst,
"%s",
"\\\\");
break;
1051 char meta_chars[] = { sep,
'"',
'\n',
'\r',
'\0' };
1052 int needs_quoting = !!
src[strcspn(
src, meta_chars)];
1079 const char * (*escape_str)(AVBPrint *dst,
const char *
src,
const char sep,
void *log_ctx);
1086 #define OFFSET(x) offsetof(CompactContext, x)
1107 av_log(wctx,
AV_LOG_ERROR,
"Item separator '%s' specified, but must contain a single character\n",
1170 if (!compact->
nokey)
1182 if (!compact->
nokey)
1196 .priv_class = &compact_class,
1202 #define OFFSET(x) offsetof(CompactContext, x)
1227 .priv_class = &csv_class,
1240 #define OFFSET(x) offsetof(FlatContext, x)
1245 {
"hierarchical",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1246 {
"h",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1256 if (strlen(
flat->sep_str) != 1) {
1257 av_log(wctx,
AV_LOG_ERROR,
"Item separator '%s' specified, but must contain a single character\n",
1270 for (p =
src; *p; p++) {
1271 if (!((*p >=
'0' && *p <=
'9') ||
1272 (*p >=
'a' && *p <=
'z') ||
1273 (*p >=
'A' && *p <=
'Z')))
1285 for (p =
src; *p; p++) {
1287 case '\n':
av_bprintf(dst,
"%s",
"\\n");
break;
1288 case '\r':
av_bprintf(dst,
"%s",
"\\r");
break;
1289 case '\\':
av_bprintf(dst,
"%s",
"\\\\");
break;
1290 case '"':
av_bprintf(dst,
"%s",
"\\\"");
break;
1291 case '`':
av_bprintf(dst,
"%s",
"\\`");
break;
1292 case '$':
av_bprintf(dst,
"%s",
"\\$");
break;
1309 if (!parent_section)
1313 if (
flat->hierarchical ||
1351 .priv_class = &flat_class,
1362 #define OFFSET(x) offsetof(INIContext, x)
1365 {
"hierarchical",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1366 {
"h",
"specify if the section specification should be hierarchical",
OFFSET(hierarchical),
AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
1377 while (
c =
src[
i++]) {
1379 case '\b':
av_bprintf(dst,
"%s",
"\\b");
break;
1380 case '\f':
av_bprintf(dst,
"%s",
"\\f");
break;
1381 case '\n':
av_bprintf(dst,
"%s",
"\\n");
break;
1382 case '\r':
av_bprintf(dst,
"%s",
"\\r");
break;
1383 case '\t':
av_bprintf(dst,
"%s",
"\\t");
break;
1389 if ((
unsigned char)
c < 32)
1408 if (!parent_section) {
1409 printf(
"# ffprobe output\n\n");
1429 printf(
"[%s]\n", buf->str);
1455 .priv_class = &ini_class,
1468 #define OFFSET(x) offsetof(JSONContext, x)
1490 static const char json_escape[] = {
'"',
'\\',
'\b',
'\f',
'\n',
'\r',
'\t', 0};
1491 static const char json_subst[] = {
'"',
'\\',
'b',
'f',
'n',
'r',
't', 0};
1494 for (p =
src; *p; p++) {
1495 char *
s = strchr(json_escape, *p);
1499 }
else if ((
unsigned char)*p < 32) {
1508 #define JSON_INDENT() printf("%*c", json->indent_level * 4, ' ')
1531 printf(
"\"%s\": [\n", buf.str);
1553 if (wctx->
level == 0) {
1571 const char *
key,
const char *
value)
1621 .priv_class = &json_class,
1635 #define OFFSET(x) offsetof(XMLContext, x)
1638 {
"fully_qualified",
"specify if the output should be fully qualified",
OFFSET(fully_qualified),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1639 {
"q",
"specify if the output should be fully qualified",
OFFSET(fully_qualified),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1640 {
"xsd_strict",
"ensure that the output is XSD compliant",
OFFSET(xsd_strict),
AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
1653 #define CHECK_COMPLIANCE(opt, opt_name) \
1655 av_log(wctx, AV_LOG_ERROR, \
1656 "XSD-compliant output selected but option '%s' was selected, XML output may be non-compliant.\n" \
1657 "You need to disable such option with '-no%s'\n", opt_name, opt_name); \
1658 return AVERROR(EINVAL); \
1666 "Interleaved frames and packets are not allowed in XSD. "
1667 "Select only one between the -show_frames and the -show_packets options.\n");
1675 #define XML_INDENT() printf("%*c", xml->indent_level * 4, ' ')
1684 if (wctx->
level == 0) {
1685 const char *qual =
" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' "
1686 "xmlns:ffprobe='http://www.ffmpeg.org/schema/ffprobe' "
1687 "xsi:schemaLocation='http://www.ffmpeg.org/schema/ffprobe ffprobe.xsd'";
1689 printf(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
1690 printf(
"<%sffprobe%s>\n",
1722 if (wctx->
level == 0) {
1754 printf(
" value=\"%s\"/>\n", buf.str);
1783 .priv_class = &xml_class,
1803 #define print_fmt(k, f, ...) do { \
1804 av_bprint_clear(&pbuf); \
1805 av_bprintf(&pbuf, f, __VA_ARGS__); \
1806 writer_print_string(w, k, pbuf.str, 0); \
1809 #define print_int(k, v) writer_print_integer(w, k, v)
1810 #define print_q(k, v, s) writer_print_rational(w, k, v, s)
1811 #define print_str(k, v) writer_print_string(w, k, v, 0)
1812 #define print_str_opt(k, v) writer_print_string(w, k, v, PRINT_STRING_OPT)
1813 #define print_str_validate(k, v) writer_print_string(w, k, v, PRINT_STRING_VALIDATE)
1814 #define print_time(k, v, tb) writer_print_time(w, k, v, tb, 0)
1815 #define print_ts(k, v) writer_print_ts(w, k, v, 0)
1816 #define print_duration_time(k, v, tb) writer_print_time(w, k, v, tb, 1)
1817 #define print_duration_ts(k, v) writer_print_ts(w, k, v, 1)
1818 #define print_val(k, v, u) do { \
1819 struct unit_value uv; \
1822 writer_print_string(w, k, value_string(val_str, sizeof(val_str), uv), 0); \
1825 #define print_section_header(s) writer_print_section_header(w, s)
1826 #define print_section_footer(s) writer_print_section_footer(w, s)
1828 #define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n) \
1830 ret = av_reallocp_array(&(ptr), (new_n), sizeof(*(ptr))); \
1833 memset( (ptr) + (cur_n), 0, ((new_n) - (cur_n)) * sizeof(*(ptr)) ); \
1862 print_q(
"window_upper_left_corner_x",
1864 print_q(
"window_upper_left_corner_y",
1866 print_q(
"window_lower_right_corner_x",
1868 print_q(
"window_lower_right_corner_y",
1870 print_q(
"window_upper_left_corner_x",
1872 print_q(
"window_upper_left_corner_y",
1880 print_int(
"semimajor_axis_internal_ellipse",
1882 print_int(
"semimajor_axis_external_ellipse",
1884 print_int(
"semiminor_axis_external_ellipse",
1889 print_q(
"targeted_system_display_maximum_luminance",
1892 print_int(
"num_rows_targeted_system_display_actual_peak_luminance",
1894 print_int(
"num_cols_targeted_system_display_actual_peak_luminance",
1898 print_q(
"targeted_system_display_actual_peak_luminance",
1905 for (
int i = 0;
i < 3;
i++) {
1910 print_int(
"num_distribution_maxrgb_percentiles",
1913 print_int(
"distribution_maxrgb_percentage",
1915 print_q(
"distribution_maxrgb_percentile",
1918 print_q(
"fraction_bright_pixels",
1922 print_int(
"num_rows_mastering_display_actual_peak_luminance",
1924 print_int(
"num_cols_mastering_display_actual_peak_luminance",
1928 print_q(
"mastering_display_actual_peak_luminance",
1942 print_q(
"bezier_curve_anchors",
1947 print_q(
"color_saturation_weight",
1963 for (
i = 0;
i < nb_side_data;
i++) {
2206 print_int (
"start_display_time",
sub->start_display_time);
2237 print_ts (
"best_effort_timestamp",
frame->best_effort_timestamp);
2257 print_q(
"sample_aspect_ratio", sar,
':');
2263 print_int(
"display_picture_number",
frame->display_picture_number);
2281 if (
frame->channel_layout) {
2284 frame->channel_layout);
2294 if (
frame->nb_side_data) {
2296 for (
i = 0;
i <
frame->nb_side_data;
i++) {
2311 uint32_t *
tc = (uint32_t*)sd->
data;
2314 for (
int j = 1; j <= m ; j++) {
2374 int ret = 0, got_frame = 0;
2425 return got_frame || *packet_new;
2430 av_log(log_ctx, log_level,
"id:%d", interval->
id);
2436 av_log(log_ctx, log_level,
" start:N/A");
2442 av_log(log_ctx, log_level,
"#%"PRId64, interval->
end);
2446 av_log(log_ctx, log_level,
" end:N/A");
2449 av_log(log_ctx, log_level,
"\n");
2458 int ret = 0,
i = 0, frame_count = 0;
2459 int64_t start = -INT64_MAX, end = interval->
end;
2470 "Could not seek to relative position since current "
2471 "timestamp is not defined\n");
2475 target = *cur_ts + interval->
start;
2477 target = interval->
start;
2518 end = start + interval->
end;
2523 if (frame_count >= interval->
end)
2525 }
else if (has_end && *cur_ts !=
AV_NOPTS_VALUE && *cur_ts >= end) {
2618 char profile_num[12];
2645 print_q(
"sample_aspect_ratio", sar,
':');
2650 print_q(
"display_aspect_ratio", dar,
':');
2667 print_str(
"field_order",
"progressive");
2717 if (opt->
flags)
continue;
2755 #define PRINT_DISPOSITION(flagname, name) do { \
2756 print_int(name, !!(stream->disposition & AV_DISPOSITION_##flagname)); \
2798 for (
i = 0;
i <
ifile->nb_streams;
i++)
2830 for (
i = 0;
i <
program->nb_stream_indexes;
i++) {
2921 const char *errbuf_ptr = errbuf;
2933 const char *print_filename)
2938 int scan_all_pmts_set = 0;
2948 scan_all_pmts_set = 1;
2955 if (print_filename) {
2960 if (scan_all_pmts_set)
2971 for (
i = 0;
i < orig_nb_streams;
i++)
2984 sizeof(*
ifile->streams));
2985 if (!
ifile->streams)
2999 "Failed to probe codec for input stream %d\n",
3007 "Unsupported codec with id %d for input stream %d\n",
3055 for (
i = 0;
i <
ifile->nb_streams;
i++)
3060 ifile->nb_streams = 0;
3066 const char *print_filename)
3079 #define CHECK_END if (ret < 0) goto end
3086 for (
i = 0;
i <
ifile.fmt_ctx->nb_streams;
i++) {
3089 ifile.fmt_ctx->streams[
i],
3160 print_fmt(
"copyright",
"Copyright (c) %d-%d the FFmpeg developers",
3163 print_str(
"configuration", FFMPEG_CONFIGURATION);
3169 #define SHOW_LIB_VERSION(libname, LIBNAME) \
3171 if (CONFIG_##LIBNAME) { \
3172 unsigned int version = libname##_version(); \
3173 writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \
3174 print_str("name", "lib" #libname); \
3175 print_int("major", LIB##LIBNAME##_VERSION_MAJOR); \
3176 print_int("minor", LIB##LIBNAME##_VERSION_MINOR); \
3177 print_int("micro", LIB##LIBNAME##_VERSION_MICRO); \
3178 print_int("version", version); \
3179 print_str("ident", LIB##LIBNAME##_IDENT); \
3180 writer_print_section_footer(w); \
3198 #define PRINT_PIX_FMT_FLAG(flagname, name) \
3200 print_int(name, !!(pixdesc->flags & AV_PIX_FMT_FLAG_##flagname)); \
3284 "'%s' matches section with unique name '%s'\n", section_name,
3295 const char *p =
arg;
3303 if (!section_name) {
3305 "Missing section name for option '%s'\n", opt);
3311 while (*p && *p !=
':') {
3316 "Adding '%s' to the entries to show in section '%s'\n",
3317 entry, section_name);
3352 "Option '%s' is deprecated, use '-show_entries format=%s' instead\n",
3363 "Argument '%s' provided as input filename, but '%s' was already specified.\n",
3367 if (!strcmp(
arg,
"-"))
3404 char *next, *p, *spec =
av_strdup(interval_spec);
3415 next = strchr(spec,
'%');
3457 lli = strtoll(p, &tail, 10);
3458 if (*tail || lli < 0) {
3460 "Invalid or negative value '%s' for duration number of frames\n", p);
3463 interval->
end = lli;
3485 char *p, *spec =
av_strdup(intervals_spec);
3490 for (n = 0, p = spec; *p; p++)
3504 for (
i = 0; p;
i++) {
3508 next = strchr(p,
',');
3564 "W.. = Section is a wrapper (contains other sections, no local entries)\n"
3565 ".A. = Section contains an array of elements of the same type\n"
3566 "..V = Section may contain a variable number of fields with variable keys\n"
3567 "FLAGS NAME/UNIQUE_NAME\n"
3580 #define DEFINE_OPT_SHOW_SECTION(section, target_section_id) \
3581 static int opt_show_##section(void *optctx, const char *opt, const char *arg) \
3583 mark_section_show_entries(SECTION_ID_##target_section_id, 1, NULL); \
3604 "use binary prefixes for byte units" },
3606 "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
3608 "prettify the format of displayed values, make it more human readable" },
3610 "set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)",
"format" },
3613 {
"sections",
OPT_EXIT, {.func_arg =
opt_sections},
"print sections structure and section information, and exit" },
3616 {
"show_error", 0, { .func_arg = &opt_show_error },
"show probing error" },
3617 {
"show_format", 0, { .func_arg = &opt_show_format },
"show format/container info" },
3618 {
"show_frames", 0, { .func_arg = &opt_show_frames },
"show frames info" },
3620 "show a particular entry from the format/container info",
"entry" },
3622 "show a set of specified entries",
"entry_list" },
3626 {
"show_packets", 0, { .func_arg = &opt_show_packets },
"show packets info" },
3627 {
"show_programs", 0, { .func_arg = &opt_show_programs },
"show programs info" },
3628 {
"show_streams", 0, { .func_arg = &opt_show_streams },
"show streams info" },
3629 {
"show_chapters", 0, { .func_arg = &opt_show_chapters },
"show chapters info" },
3632 {
"show_program_version", 0, { .func_arg = &opt_show_program_version },
"show ffprobe version" },
3633 {
"show_library_versions", 0, { .func_arg = &opt_show_library_versions },
"show library versions" },
3634 {
"show_versions", 0, { .func_arg = &
opt_show_versions },
"show program and library versions" },
3635 {
"show_pixel_formats", 0, { .func_arg = &opt_show_pixel_formats },
"show pixel format descriptions" },
3644 "read and decode the streams to fill missing information with heuristics" },
3660 #define SET_DO_SHOW(id, varname) do { \
3661 if (check_section_show_entries(SECTION_ID_##id)) \
3662 do_show_##varname = 1; \
3670 char *w_name =
NULL, *w_args =
NULL;
3706 SET_DO_SHOW(PIXEL_FORMAT_FLAGS, pixel_format_flags);
3707 SET_DO_SHOW(PIXEL_FORMAT_COMPONENTS, pixel_format_components);
3711 SET_DO_SHOW(STREAM_DISPOSITION, stream_disposition);
3712 SET_DO_SHOW(PROGRAM_STREAM_DISPOSITION, stream_disposition);
3724 "-bitexact and -show_program_version or -show_library_versions "
3725 "options are incompatible\n");
3741 "No name specified for the output format\n");
3752 "Unknown hash algorithm '%s'\nKnown algorithms:",
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)
@ 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)
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
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.
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.
#define AV_BPRINT_SIZE_UNLIMITED
#define AV_TIMECODE_STR_SIZE
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.
#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
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
#define SECTION_MAX_NB_LEVELS
static void writer_close(WriterContext **wctx)
@ SECTION_ID_STREAM_SIDE_DATA
static av_cold int init(AVCodecContext *avctx)
static int do_show_frame_tags
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 read_intervals_nb
enum AVMediaType codec_type
General type of the encoded data.
enum AVSphericalProjection projection
Projection type.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, buffer_size_t *size)
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
AVColorTransferCharacteristic
Color Transfer Characteristic.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
static int show_streams(WriterContext *w, InputFile *ifile)
static void writer_print_section_header(WriterContext *wctx, int section_id)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
char * av_get_token(const char **buf, const char *term)
Unescape the given string until a non escaped terminating char, and return the token corresponding to...
#define AV_HASH_MAX_SIZE
Maximum value that av_hash_get_size() will currently return.
#define print_val(k, v, u)
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.
static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_idx, InputStream *ist, int in_program)
static float sub(float src0, float src1)
enum AVColorSpace color_space
int(* init)(WriterContext *wctx)
static char * value_string(char *buf, int buf_size, struct unit_value uv)
#define AVERROR_EOF
End of file.
static int read_packets(WriterContext *w, InputFile *ifile)
static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
const char * long_name
A more descriptive name for this codec.
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...
#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.
static int writer_open(WriterContext **wctx, const Writer *writer, const char *args, const struct section *sections, int nb_sections)
static int * selected_streams
@ SECTION_ID_PROGRAM_TAGS
char * av_asprintf(const char *fmt,...)
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
@ 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.
static int validate_string(WriterContext *wctx, char **dstp, const char *src)
static int opt_show_format_entry(void *optctx, const char *opt, const char *arg)
int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)
Decode a subtitle message.
@ 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.
const char * element_name
name of the contained element, if provided
@ SECTION_ID_PIXEL_FORMAT_FLAGS
AVRational avg_frame_rate
Average framerate.
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.
AVDictionary * format_opts
static void writer_print_integer(WriterContext *wctx, const char *key, long long int val)
#define PRINT_DISPOSITION(flagname, name)
#define SECTION_MAX_NB_CHILDREN
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key,...
static int do_show_stream_tags
static char * ini_escape_str(AVBPrint *dst, const char *src)
#define print_section_header(s)
@ SECTION_ID_PIXEL_FORMAT
void * av_mallocz_array(size_t nmemb, size_t size)
#define AV_LOG_VERBOSE
Detailed information.
@ SECTION_ID_PROGRAM_STREAM
static char * print_format
void show_help_children(const AVClass *class, int flags)
Show help for all options with given flags in class and all its children.
const char * avcodec_profile_name(enum AVCodecID codec_id, int profile)
Return a name for the specified profile, if available.
@ 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.
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.