ffprobe.c File Reference

simple media prober based on the FFmpeg libraries More...

#include "config.h"
#include "version.h"
#include <string.h>
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/dict.h"
#include "libavutil/libm.h"
#include "libavutil/timecode.h"
#include "libavdevice/avdevice.h"
#include "libswscale/swscale.h"
#include "libswresample/swresample.h"
#include "libpostproc/postprocess.h"
#include "cmdutils.h"
#include "cmdutils_common_opts.h"
Include dependency graph for ffprobe.c:

Go to the source code of this file.

Data Structures

struct  section
 
struct  unit_value
 
struct  Writer
 
struct  WriterContext
 
struct  DefaultContext
 
struct  CompactContext
 
struct  FlatContext
 
struct  INIContext
 
struct  JSONContext
 
struct  XMLContext
 

Macros

#define SECTION_MAX_NB_CHILDREN   10
 
#define SECTION_FLAG_IS_WRAPPER   1
 the section only contains other sections, but has no data at its own level More...
 
#define SECTION_FLAG_IS_ARRAY   2
 the section contains an array of elements of the same type More...
 
#define SECTION_FLAG_HAS_VARIABLE_FIELDS   4
 the section may contain a variable number of fields with variable keys. More...
 
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS   1
 
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER   2
 
#define SECTION_MAX_NB_LEVELS   10
 
#define MAX_REGISTERED_WRITERS_NB   64
 
#define DEFINE_WRITER_CLASS(name)
 
#define OFFSET(x)   offsetof(DefaultContext, x)
 
#define OFFSET(x)   offsetof(CompactContext, x)
 
#define OFFSET(x)   offsetof(CompactContext, x)
 
#define OFFSET(x)   offsetof(FlatContext, x)
 
#define OFFSET(x)   offsetof(INIContext, x)
 
#define OFFSET(x)   offsetof(JSONContext, x)
 
#define JSON_INDENT()   printf("%*c", json->indent_level * 4, ' ')
 
#define OFFSET(x)   offsetof(XMLContext, x)
 
#define CHECK_COMPLIANCE(opt, opt_name)
 
#define XML_INDENT()   printf("%*c", xml->indent_level * 4, ' ')
 
#define print_fmt(k, f, ...)
 
#define print_int(k, v)   writer_print_integer(w, k, v)
 
#define print_q(k, v, s)   writer_print_rational(w, k, v, s)
 
#define print_str(k, v)   writer_print_string(w, k, v, 0)
 
#define print_str_opt(k, v)   writer_print_string(w, k, v, 1)
 
#define print_time(k, v, tb)   writer_print_time(w, k, v, tb, 0)
 
#define print_ts(k, v)   writer_print_ts(w, k, v, 0)
 
#define print_duration_time(k, v, tb)   writer_print_time(w, k, v, tb, 1)
 
#define print_duration_ts(k, v)   writer_print_ts(w, k, v, 1)
 
#define print_val(k, v, u)
 
#define print_section_header(s)   writer_print_section_header(w, s)
 
#define print_section_footer(s)   writer_print_section_footer(w, s)
 
#define PRINT_DISPOSITION(flagname, name)
 
#define SHOW_LIB_VERSION(libname, LIBNAME)
 
#define DEFINE_OPT_SHOW_SECTION(section, target_section_id)
 
#define SET_DO_SHOW(id, varname)
 

Typedefs

typedef struct WriterContext WriterContext
 
typedef struct Writer Writer
 
typedef struct DefaultContext DefaultContext
 
typedef struct CompactContext CompactContext
 
typedef struct FlatContext FlatContext
 

Enumerations

enum  SectionID {
  SECTION_ID_NONE = -1, SECTION_ID_ERROR, SECTION_ID_FORMAT, SECTION_ID_FORMAT_TAGS,
  SECTION_ID_FRAME, SECTION_ID_FRAMES, SECTION_ID_FRAME_TAGS, SECTION_ID_LIBRARY_VERSION,
  SECTION_ID_LIBRARY_VERSIONS, SECTION_ID_PACKET, SECTION_ID_PACKETS, SECTION_ID_PACKETS_AND_FRAMES,
  SECTION_ID_PROGRAM_VERSION, SECTION_ID_ROOT, SECTION_ID_STREAM, SECTION_ID_STREAM_DISPOSITION,
  SECTION_ID_STREAMS, SECTION_ID_STREAM_TAGS
}
 

Functions

static void exit_program (void)
 
static char * value_string (char *buf, int buf_size, struct unit_value uv)
 
static const char * writer_get_name (void *p)
 
static void writer_close (WriterContext **wctx)
 
static int writer_open (WriterContext **wctx, const Writer *writer, const char *args, const struct section *sections, int nb_sections)
 
static void writer_print_section_header (WriterContext *wctx, int section_id)
 
static void writer_print_section_footer (WriterContext *wctx)
 
static void writer_print_integer (WriterContext *wctx, const char *key, long long int val)
 
static void writer_print_string (WriterContext *wctx, const char *key, const char *val, int opt)
 
static void writer_print_rational (WriterContext *wctx, const char *key, AVRational q, char sep)
 
static void writer_print_time (WriterContext *wctx, const char *key, int64_t ts, const AVRational *time_base, int is_duration)
 
static void writer_print_ts (WriterContext *wctx, const char *key, int64_t ts, int is_duration)
 
static void writer_print_data (WriterContext *wctx, const char *name, uint8_t *data, int size)
 
static int writer_register (const Writer *writer)
 
static const Writerwriter_get_by_name (const char *name)
 
 DEFINE_WRITER_CLASS (default)
 
static char * upcase_string (char *dst, size_t dst_size, const char *src)
 
static void default_print_section_header (WriterContext *wctx)
 
static void default_print_section_footer (WriterContext *wctx)
 
static void default_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void default_print_int (WriterContext *wctx, const char *key, long long int value)
 
static const char * c_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 Apply C-language-like string escaping. More...
 
static const char * csv_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 Quote fields containing special characters, check RFC4180. More...
 
static const char * none_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 
 DEFINE_WRITER_CLASS (compact)
 
static av_cold int compact_init (WriterContext *wctx)
 
static void compact_print_section_header (WriterContext *wctx)
 
static void compact_print_section_footer (WriterContext *wctx)
 
static void compact_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void compact_print_int (WriterContext *wctx, const char *key, long long int value)
 
 DEFINE_WRITER_CLASS (csv)
 
 DEFINE_WRITER_CLASS (flat)
 
static av_cold int flat_init (WriterContext *wctx)
 
static const char * flat_escape_key_str (AVBPrint *dst, const char *src, const char sep)
 
static const char * flat_escape_value_str (AVBPrint *dst, const char *src)
 
static void flat_print_section_header (WriterContext *wctx)
 
static void flat_print_int (WriterContext *wctx, const char *key, long long int value)
 
static void flat_print_str (WriterContext *wctx, const char *key, const char *value)
 
 DEFINE_WRITER_CLASS (ini)
 
static char * ini_escape_str (AVBPrint *dst, const char *src)
 
static void ini_print_section_header (WriterContext *wctx)
 
static void ini_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void ini_print_int (WriterContext *wctx, const char *key, long long int value)
 
 DEFINE_WRITER_CLASS (json)
 
static av_cold int json_init (WriterContext *wctx)
 
static const char * json_escape_str (AVBPrint *dst, const char *src, void *log_ctx)
 
static void json_print_section_header (WriterContext *wctx)
 
static void json_print_section_footer (WriterContext *wctx)
 
static void json_print_item_str (WriterContext *wctx, const char *key, const char *value)
 
static void json_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void json_print_int (WriterContext *wctx, const char *key, long long int value)
 
 DEFINE_WRITER_CLASS (xml)
 
static av_cold int xml_init (WriterContext *wctx)
 
static const char * xml_escape_str (AVBPrint *dst, const char *src, void *log_ctx)
 
static void xml_print_section_header (WriterContext *wctx)
 
static void xml_print_section_footer (WriterContext *wctx)
 
static void xml_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void xml_print_int (WriterContext *wctx, const char *key, long long int value)
 
static void writer_register_all (void)
 
static void show_tags (WriterContext *wctx, AVDictionary *tags, int section_id)
 
static void show_packet (WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pkt, int packet_idx)
 
static void show_frame (WriterContext *w, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx)
 
static av_always_inline int process_frame (WriterContext *w, AVFormatContext *fmt_ctx, AVFrame *frame, AVPacket *pkt)
 
static void read_packets (WriterContext *w, AVFormatContext *fmt_ctx)
 
static void show_stream (WriterContext *w, AVFormatContext *fmt_ctx, int stream_idx)
 
static void show_streams (WriterContext *w, AVFormatContext *fmt_ctx)
 
static void show_format (WriterContext *w, AVFormatContext *fmt_ctx)
 
static void show_error (WriterContext *w, int err)
 
static int open_input_file (AVFormatContext **fmt_ctx_ptr, const char *filename)
 
static void close_input_file (AVFormatContext **ctx_ptr)
 
static int probe_file (WriterContext *wctx, const char *filename)
 
static void show_usage (void)
 
static void ffprobe_show_program_version (WriterContext *w)
 
static void ffprobe_show_library_versions (WriterContext *w)
 
static int opt_format (void *optctx, const char *opt, const char *arg)
 
static void mark_section_show_entries (SectionID section_id, int show_all_entries, AVDictionary *entries)
 
static int match_section (const char *section_name, int show_all_entries, AVDictionary *entries)
 
static int opt_show_entries (void *optctx, const char *opt, const char *arg)
 
static int opt_show_format_entry (void *optctx, const char *opt, const char *arg)
 
static void opt_input_file (void *optctx, const char *arg)
 
static int opt_input_file_i (void *optctx, const char *opt, const char *arg)
 
void show_help_default (const char *opt, const char *arg)
 Per-fftool specific help handler. More...
 
static int opt_pretty (void *optctx, const char *opt, const char *arg)
 
static void print_section (SectionID id, int level)
 
static int opt_sections (void *optctx, const char *opt, const char *arg)
 
static int opt_show_versions (const char *opt, const char *arg)
 
 DEFINE_OPT_SHOW_SECTION (error, ERROR)
 
 DEFINE_OPT_SHOW_SECTION (format, FORMAT)
 
 DEFINE_OPT_SHOW_SECTION (frames, FRAMES)
 
 DEFINE_OPT_SHOW_SECTION (library_versions, LIBRARY_VERSIONS)
 
 DEFINE_OPT_SHOW_SECTION (packets, PACKETS)
 
 DEFINE_OPT_SHOW_SECTION (program_version, PROGRAM_VERSION)
 
 DEFINE_OPT_SHOW_SECTION (streams, STREAMS)
 
static int check_section_show_entries (int section_id)
 
int main (int argc, char **argv)
 

Variables

const char program_name [] = "ffprobe"
 program name, defined by the program for show_version(). More...
 
const int program_birth_year = 2007
 program birth year, defined by the program for show_banner() More...
 
static int do_bitexact = 0
 
static int do_count_frames = 0
 
static int do_count_packets = 0
 
static int do_read_frames = 0
 
static int do_read_packets = 0
 
static int do_show_error = 0
 
static int do_show_format = 0
 
static int do_show_frames = 0
 
static int do_show_packets = 0
 
static int do_show_streams = 0
 
static int do_show_stream_disposition = 0
 
static int do_show_data = 0
 
static int do_show_program_version = 0
 
static int do_show_library_versions = 0
 
static int show_value_unit = 0
 
static int use_value_prefix = 0
 
static int use_byte_value_binary_prefix = 0
 
static int use_value_sexagesimal_format = 0
 
static int show_private_data = 1
 
static char * print_format
 
static char * stream_specifier
 
static struct section sections []
 
static const OptionDefoptions
 
static const char * input_filename
 
static AVInputFormatiformat = NULL
 
static const char *const binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" }
 
static const char *const decimal_unit_prefixes [] = { "", "K" , "M" , "G" , "T" , "P" }
 
static const char unit_second_str [] = "s"
 
static const char unit_hertz_str [] = "Hz"
 
static const char unit_byte_str [] = "byte"
 
static const char unit_bit_per_second_str [] = "bit/s"
 
static uint64_t * nb_streams_packets
 
static uint64_t * nb_streams_frames
 
static int * selected_streams
 
static const AVClass writer_class
 
static const Writerregistered_writers [MAX_REGISTERED_WRITERS_NB+1]
 
static const AVOption default_options []
 
static const Writer default_writer
 
static const AVOption compact_options []
 
static const Writer compact_writer
 
static const AVOption csv_options []
 
static const Writer csv_writer
 
static const AVOption flat_options []
 
static const Writer flat_writer
 
static const AVOption ini_options []
 
static const Writer ini_writer
 
static const AVOption json_options []
 
static const Writer json_writer
 
static const AVOption xml_options []
 
static Writer xml_writer
 
static const OptionDef real_options []
 

Detailed Description

simple media prober based on the FFmpeg libraries

Definition in file ffprobe.c.

Macro Definition Documentation

#define CHECK_COMPLIANCE (   opt,
  opt_name 
)
Value:
if (opt) { \
"XSD-compliant output selected but option '%s' was selected, XML output may be non-compliant.\n" \
"You need to disable such option with '-no%s'\n", opt_name, opt_name); \
return AVERROR(EINVAL); \
}
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:148
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer 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.Buffer references ownership and permissions
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 This method is called when a frame is wanted on an output For an 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 it should return

Referenced by xml_init().

#define DEFINE_OPT_SHOW_SECTION (   section,
  target_section_id 
)
Value:
static int opt_show_##section(const char *opt, const char *arg) \
{ \
mark_section_show_entries(SECTION_ID_##target_section_id, 1, NULL); \
return 0; \
}
static void mark_section_show_entries(SectionID section_id, int show_all_entries, AVDictionary *entries)
Definition: ffprobe.c:1990
const char * arg
NULL
Definition: eval.c:55
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 This method is called when a frame is wanted on an output For an 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 it should return

Definition at line 2161 of file ffprobe.c.

#define DEFINE_WRITER_CLASS (   name)
Value:
static const char *name##_get_name(void *ctx) \
{ \
} \
static const AVClass name##_class = { \
#name, \
name##_get_name, \
name##_options \
}
const char * name
Definition: avisynth_c.h:675
Describe the class of an AVClass context structure.
Definition: log.h:50
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 This method is called when a frame is wanted on an output For an 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 it should return

Definition at line 502 of file ffprobe.c.

#define JSON_INDENT ( )    printf("%*c", json->indent_level * 4, ' ')
#define MAX_REGISTERED_WRITERS_NB   64

Definition at line 473 of file ffprobe.c.

Referenced by writer_register().

#define OFFSET (   x)    offsetof(DefaultContext, x)

Definition at line 1208 of file ffprobe.c.

#define OFFSET (   x)    offsetof(CompactContext, x)

Definition at line 1208 of file ffprobe.c.

#define OFFSET (   x)    offsetof(CompactContext, x)

Definition at line 1208 of file ffprobe.c.

#define OFFSET (   x)    offsetof(FlatContext, x)

Definition at line 1208 of file ffprobe.c.

#define OFFSET (   x)    offsetof(INIContext, x)

Definition at line 1208 of file ffprobe.c.

#define OFFSET (   x)    offsetof(JSONContext, x)

Definition at line 1208 of file ffprobe.c.

#define OFFSET (   x)    offsetof(XMLContext, x)

Definition at line 1208 of file ffprobe.c.

#define PRINT_DISPOSITION (   flagname,
  name 
)
Value:
do { \
print_int(name, !!(stream->disposition & AV_DISPOSITION_##flagname)); \
} while (0)
const char * name
Definition: avisynth_c.h:675
#define print_int(k, v)
Definition: ffprobe.c:1392

Referenced by show_stream().

#define print_duration_time (   k,
  v,
  tb 
)    writer_print_time(w, k, v, tb, 1)

Definition at line 1398 of file ffprobe.c.

Referenced by show_frame(), and show_packet().

#define print_duration_ts (   k,
  v 
)    writer_print_ts(w, k, v, 1)

Definition at line 1399 of file ffprobe.c.

Referenced by show_frame(), and show_packet().

#define print_fmt (   k,
  f,
  ... 
)
Value:
do { \
av_bprintf(&pbuf, f, __VA_ARGS__); \
writer_print_string(w, k, pbuf.str, 0); \
} while (0)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition: bprint.c:93
Sinusoidal phase f
output residual component w
static void writer_print_string(WriterContext *wctx, const char *key, const char *val, int opt)
Definition: ffprobe.c:396
for k
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
Definition: bprint.c:185

Definition at line 1386 of file ffprobe.c.

Referenced by ffprobe_show_program_version(), show_frame(), show_packet(), and show_stream().

#define print_int (   k,
  v 
)    writer_print_integer(w, k, v)

Definition at line 1392 of file ffprobe.c.

Referenced by show_error(), show_format(), show_frame(), show_packet(), and show_stream().

#define print_q (   k,
  v,
  s 
)    writer_print_rational(w, k, v, s)

Definition at line 1393 of file ffprobe.c.

Referenced by show_frame(), and show_stream().

#define print_section_footer (   s)    writer_print_section_footer(w, s)

Definition at line 1408 of file ffprobe.c.

#define print_section_header (   s)    writer_print_section_header(w, s)

Definition at line 1407 of file ffprobe.c.

#define print_str (   k,
  v 
)    writer_print_string(w, k, v, 0)
#define print_str_opt (   k,
  v 
)    writer_print_string(w, k, v, 1)

Definition at line 1395 of file ffprobe.c.

Referenced by show_format(), show_frame(), show_packet(), and show_stream().

#define print_time (   k,
  v,
  tb 
)    writer_print_time(w, k, v, tb, 0)

Definition at line 1396 of file ffprobe.c.

Referenced by show_format(), show_frame(), show_packet(), and show_stream().

#define print_ts (   k,
  v 
)    writer_print_ts(w, k, v, 0)

Definition at line 1397 of file ffprobe.c.

Referenced by show_frame(), show_packet(), and show_stream().

#define print_val (   k,
  v,
  u 
)
Value:
do { \
struct unit_value uv; \
uv.val.i = v; \
uv.unit = u; \
writer_print_string(w, k, value_string(val_str, sizeof(val_str), uv), 0); \
} while (0)
static char * value_string(char *buf, int buf_size, struct unit_value uv)
Definition: ffprobe.c:167
float v
output residual component w
static void writer_print_string(WriterContext *wctx, const char *key, const char *val, int opt)
Definition: ffprobe.c:396
float u
for k
union unit_value::@26 val
long long int i
Definition: ffprobe.c:163

Definition at line 1400 of file ffprobe.c.

Referenced by show_format(), show_packet(), and show_stream().

#define SECTION_FLAG_HAS_VARIABLE_FIELDS   4

the section may contain a variable number of fields with variable keys.

Definition at line 84 of file ffprobe.c.

Referenced by print_section(), xml_print_section_footer(), xml_print_section_header(), and xml_print_str().

#define SECTION_FLAG_IS_WRAPPER   1
#define SECTION_MAX_NB_CHILDREN   10

Definition at line 76 of file ffprobe.c.

#define SECTION_MAX_NB_LEVELS   10

Definition at line 242 of file ffprobe.c.

Referenced by writer_close(), writer_open(), and writer_print_section_header().

#define SET_DO_SHOW (   id,
  varname 
)
Value:
do { \
if (check_section_show_entries(SECTION_ID_##id)) \
do_show_##varname = 1; \
} while (0)
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
static int check_section_show_entries(int section_id)
Definition: ffprobe.c:2215

Definition at line 2227 of file ffprobe.c.

Referenced by main().

#define SHOW_LIB_VERSION (   libname,
  LIBNAME 
)
Value:
do { \
if (CONFIG_##LIBNAME) { \
unsigned int version = libname##_version(); \
print_str("name", "lib" #libname); \
print_int("major", LIB##LIBNAME##_VERSION_MAJOR); \
print_int("minor", LIB##LIBNAME##_VERSION_MINOR); \
print_int("micro", LIB##LIBNAME##_VERSION_MICRO); \
print_int("version", version); \
print_str("ident", LIB##LIBNAME##_IDENT); \
} \
} while (0)
int version
Definition: avisynth_c.h:666
output residual component w
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
static void writer_print_section_header(WriterContext *wctx, int section_id)
Definition: ffprobe.c:344
#define print_int(k, v)
Definition: ffprobe.c:1392
#define print_str(k, v)
Definition: ffprobe.c:1394
static void writer_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:368

Definition at line 1951 of file ffprobe.c.

Referenced by ffprobe_show_library_versions().

#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS   1

Definition at line 223 of file ffprobe.c.

Referenced by writer_print_string().

#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER   2

Definition at line 224 of file ffprobe.c.

Referenced by probe_file().

#define XML_INDENT ( )    printf("%*c", xml->indent_level * 4, ' ')

Definition at line 1266 of file ffprobe.c.

Referenced by xml_print_section_footer(), xml_print_section_header(), and xml_print_str().

Typedef Documentation

typedef struct FlatContext FlatContext
typedef struct Writer Writer
typedef struct WriterContext WriterContext

Definition at line 221 of file ffprobe.c.

Enumeration Type Documentation

enum SectionID
Enumerator
SECTION_ID_NONE 
SECTION_ID_ERROR 
SECTION_ID_FORMAT 
SECTION_ID_FORMAT_TAGS 
SECTION_ID_FRAME 
SECTION_ID_FRAMES 
SECTION_ID_FRAME_TAGS 
SECTION_ID_LIBRARY_VERSION 
SECTION_ID_LIBRARY_VERSIONS 
SECTION_ID_PACKET 
SECTION_ID_PACKETS 
SECTION_ID_PACKETS_AND_FRAMES 
SECTION_ID_PROGRAM_VERSION 
SECTION_ID_ROOT 
SECTION_ID_STREAM 
SECTION_ID_STREAM_DISPOSITION 
SECTION_ID_STREAMS 
SECTION_ID_STREAM_TAGS 

Definition at line 94 of file ffprobe.c.

Function Documentation

static const char* c_escape_str ( AVBPrint dst,
const char *  src,
const char  sep,
void log_ctx 
)
static

Apply C-language-like string escaping.

Definition at line 616 of file ffprobe.c.

Referenced by compact_init().

static int check_section_show_entries ( int  section_id)
inlinestatic

Definition at line 2215 of file ffprobe.c.

static void close_input_file ( AVFormatContext **  ctx_ptr)
static

Definition at line 1856 of file ffprobe.c.

Referenced by probe_file().

static av_cold int compact_init ( WriterContext wctx)
static

Definition at line 690 of file ffprobe.c.

static void compact_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 754 of file ffprobe.c.

static void compact_print_section_footer ( WriterContext wctx)
static

Definition at line 732 of file ffprobe.c.

static void compact_print_section_header ( WriterContext wctx)
static

Definition at line 712 of file ffprobe.c.

static void compact_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 741 of file ffprobe.c.

static const char* csv_escape_str ( AVBPrint dst,
const char *  src,
const char  sep,
void log_ctx 
)
static

Quote fields containing special characters, check RFC4180.

Definition at line 639 of file ffprobe.c.

Referenced by compact_init().

static void default_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 591 of file ffprobe.c.

static void default_print_section_footer ( WriterContext wctx)
static

Definition at line 569 of file ffprobe.c.

static void default_print_section_header ( WriterContext wctx)
static

Definition at line 544 of file ffprobe.c.

static void default_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 582 of file ffprobe.c.

DEFINE_OPT_SHOW_SECTION ( error  ,
ERROR   
)
DEFINE_OPT_SHOW_SECTION ( format  ,
FORMAT   
)
DEFINE_OPT_SHOW_SECTION ( frames  ,
FRAMES   
)
DEFINE_OPT_SHOW_SECTION ( library_versions  ,
LIBRARY_VERSIONS   
)
DEFINE_OPT_SHOW_SECTION ( packets  ,
PACKETS   
)
DEFINE_OPT_SHOW_SECTION ( program_version  ,
PROGRAM_VERSION   
)
DEFINE_OPT_SHOW_SECTION ( streams  ,
STREAMS   
)
DEFINE_WRITER_CLASS ( default  )
DEFINE_WRITER_CLASS ( compact  )
DEFINE_WRITER_CLASS ( csv  )
DEFINE_WRITER_CLASS ( flat  )
DEFINE_WRITER_CLASS ( ini  )
DEFINE_WRITER_CLASS ( json  )
DEFINE_WRITER_CLASS ( xml  )
static void exit_program ( void  )
static

Definition at line 155 of file ffprobe.c.

Referenced by main().

static void ffprobe_show_library_versions ( WriterContext w)
static

Definition at line 1966 of file ffprobe.c.

Referenced by main().

static void ffprobe_show_program_version ( WriterContext w)
static

Definition at line 1933 of file ffprobe.c.

Referenced by main().

static const char* flat_escape_key_str ( AVBPrint dst,
const char *  src,
const char  sep 
)
static

Definition at line 843 of file ffprobe.c.

Referenced by flat_print_str().

static const char* flat_escape_value_str ( AVBPrint dst,
const char *  src 
)
static

Definition at line 858 of file ffprobe.c.

Referenced by flat_print_str().

static av_cold int flat_init ( WriterContext wctx)
static

Definition at line 829 of file ffprobe.c.

static void flat_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 902 of file ffprobe.c.

static void flat_print_section_header ( WriterContext wctx)
static

Definition at line 876 of file ffprobe.c.

static void flat_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 907 of file ffprobe.c.

static char* ini_escape_str ( AVBPrint dst,
const char *  src 
)
static

Definition at line 949 of file ffprobe.c.

Referenced by ini_print_str().

static void ini_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1020 of file ffprobe.c.

static void ini_print_section_header ( WriterContext wctx)
static

Definition at line 976 of file ffprobe.c.

static void ini_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1009 of file ffprobe.c.

static const char* json_escape_str ( AVBPrint dst,
const char *  src,
void log_ctx 
)
static

Definition at line 1065 of file ffprobe.c.

Referenced by json_print_int(), json_print_item_str(), and json_print_section_header().

static av_cold int json_init ( WriterContext wctx)
static

Definition at line 1055 of file ffprobe.c.

static void json_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1170 of file ffprobe.c.

static void json_print_item_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
inlinestatic

Definition at line 1147 of file ffprobe.c.

Referenced by json_print_str().

static void json_print_section_footer ( WriterContext wctx)
static

Definition at line 1125 of file ffprobe.c.

static void json_print_section_header ( WriterContext wctx)
static

Definition at line 1087 of file ffprobe.c.

static void json_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1159 of file ffprobe.c.

int main ( int  argc,
char **  argv 
)

Definition at line 2232 of file ffprobe.c.

static void mark_section_show_entries ( SectionID  section_id,
int  show_all_entries,
AVDictionary entries 
)
inlinestatic

Definition at line 1990 of file ffprobe.c.

Referenced by match_section(), and opt_show_versions().

static int match_section ( const char *  section_name,
int  show_all_entries,
AVDictionary entries 
)
static

Definition at line 2005 of file ffprobe.c.

Referenced by opt_show_entries().

static const char* none_escape_str ( AVBPrint dst,
const char *  src,
const char  sep,
void log_ctx 
)
static

Definition at line 657 of file ffprobe.c.

Referenced by compact_init().

static int open_input_file ( AVFormatContext **  fmt_ctx_ptr,
const char *  filename 
)
static

Definition at line 1793 of file ffprobe.c.

Referenced by probe_file().

static int opt_format ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 1980 of file ffprobe.c.

static void opt_input_file ( void optctx,
const char *  arg 
)
static

Definition at line 2087 of file ffprobe.c.

Referenced by main(), and opt_input_file_i().

static int opt_input_file_i ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2100 of file ffprobe.c.

static int opt_pretty ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2116 of file ffprobe.c.

static int opt_sections ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2142 of file ffprobe.c.

static int opt_show_entries ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2024 of file ffprobe.c.

Referenced by opt_show_format_entry().

static int opt_show_format_entry ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 2074 of file ffprobe.c.

static int opt_show_versions ( const char *  opt,
const char *  arg 
)
static

Definition at line 2154 of file ffprobe.c.

static void print_section ( SectionID  id,
int  level 
)
static

Definition at line 2125 of file ffprobe.c.

Referenced by opt_sections().

static int probe_file ( WriterContext wctx,
const char *  filename 
)
static

Definition at line 1869 of file ffprobe.c.

Referenced by main().

static av_always_inline int process_frame ( WriterContext w,
AVFormatContext fmt_ctx,
AVFrame frame,
AVPacket pkt 
)
static

Definition at line 1528 of file ffprobe.c.

Referenced by read_packets().

static void read_packets ( WriterContext w,
AVFormatContext fmt_ctx 
)
static

Definition at line 1561 of file ffprobe.c.

Referenced by probe_file().

static void show_error ( WriterContext w,
int  err 
)
static

Definition at line 1779 of file ffprobe.c.

Referenced by main().

static void show_format ( WriterContext w,
AVFormatContext fmt_ctx 
)
static

Definition at line 1754 of file ffprobe.c.

Referenced by probe_file().

static void show_frame ( WriterContext w,
AVFrame frame,
AVStream stream,
AVFormatContext fmt_ctx 
)
static

Definition at line 1457 of file ffprobe.c.

Referenced by process_frame().

void show_help_default ( const char *  opt,
const char *  arg 
)

Per-fftool specific help handler.

Implemented in each fftool, called by show_help().

Definition at line 2106 of file ffprobe.c.

static void show_packet ( WriterContext w,
AVFormatContext fmt_ctx,
AVPacket pkt,
int  packet_idx 
)
static

Definition at line 1422 of file ffprobe.c.

Referenced by read_packets().

static void show_stream ( WriterContext w,
AVFormatContext fmt_ctx,
int  stream_idx 
)
static

Definition at line 1594 of file ffprobe.c.

Referenced by show_streams().

static void show_streams ( WriterContext w,
AVFormatContext fmt_ctx 
)
static

Definition at line 1744 of file ffprobe.c.

Referenced by probe_file().

static void show_tags ( WriterContext wctx,
AVDictionary tags,
int  section_id 
)
inlinestatic

Definition at line 1410 of file ffprobe.c.

Referenced by show_format(), show_frame(), and show_stream().

static void show_usage ( void  )
static

Definition at line 1926 of file ffprobe.c.

Referenced by main(), and show_help_default().

static char* upcase_string ( char *  dst,
size_t  dst_size,
const char *  src 
)
inlinestatic

Definition at line 535 of file ffprobe.c.

Referenced by default_print_section_footer(), and default_print_section_header().

static char* value_string ( char *  buf,
int  buf_size,
struct unit_value  uv 
)
static

Definition at line 167 of file ffprobe.c.

Referenced by writer_print_time().

static void writer_close ( WriterContext **  wctx)
static

Definition at line 281 of file ffprobe.c.

Referenced by main(), and writer_open().

static const Writer* writer_get_by_name ( const char *  name)
static

Definition at line 488 of file ffprobe.c.

Referenced by main().

static const char* writer_get_name ( void p)
static

Definition at line 268 of file ffprobe.c.

static int writer_open ( WriterContext **  wctx,
const Writer writer,
const char *  args,
const struct section sections,
int  nb_sections 
)
static

Definition at line 298 of file ffprobe.c.

Referenced by main().

static void writer_print_data ( WriterContext wctx,
const char *  name,
uint8_t data,
int  size 
)
static

Definition at line 445 of file ffprobe.c.

Referenced by show_packet(), and show_stream().

static void writer_print_integer ( WriterContext wctx,
const char *  key,
long long int  val 
)
inlinestatic

Definition at line 385 of file ffprobe.c.

Referenced by writer_print_ts().

static void writer_print_rational ( WriterContext wctx,
const char *  key,
AVRational  q,
char  sep 
)
inlinestatic

Definition at line 410 of file ffprobe.c.

static void writer_print_section_footer ( WriterContext wctx)
inlinestatic
static void writer_print_section_header ( WriterContext wctx,
int  section_id 
)
inlinestatic
static void writer_print_string ( WriterContext wctx,
const char *  key,
const char *  val,
int  opt 
)
inlinestatic
static void writer_print_time ( WriterContext wctx,
const char *  key,
int64_t  ts,
const AVRational time_base,
int  is_duration 
)
static

Definition at line 419 of file ffprobe.c.

static void writer_print_ts ( WriterContext wctx,
const char *  key,
int64_t  ts,
int  is_duration 
)
static

Definition at line 436 of file ffprobe.c.

static int writer_register ( const Writer writer)
static

Definition at line 477 of file ffprobe.c.

Referenced by writer_register_all().

static void writer_register_all ( void  )
static

Definition at line 1369 of file ffprobe.c.

Referenced by main().

static const char* xml_escape_str ( AVBPrint dst,
const char *  src,
void log_ctx 
)
static

Definition at line 1248 of file ffprobe.c.

Referenced by xml_print_str().

static av_cold int xml_init ( WriterContext wctx)
static

Definition at line 1220 of file ffprobe.c.

static void xml_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1350 of file ffprobe.c.

static void xml_print_section_footer ( WriterContext wctx)
static

Definition at line 1308 of file ffprobe.c.

static void xml_print_section_header ( WriterContext wctx)
static

Definition at line 1268 of file ffprobe.c.

static void xml_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1327 of file ffprobe.c.

Variable Documentation

const char* const binary_unit_prefixes[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" }
static

Definition at line 143 of file ffprobe.c.

Referenced by value_string().

const AVOption compact_options[]
static
Initial value:
= {
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{NULL},
}
#define OFFSET(x)
Definition: ffprobe.c:1208
static void print_section(SectionID id, int level)
Definition: ffprobe.c:2125
NULL
Definition: eval.c:55

Definition at line 676 of file ffprobe.c.

const Writer compact_writer
static
Initial value:
= {
.name = "compact",
.priv_size = sizeof(CompactContext),
.print_integer = compact_print_int,
.print_string = compact_print_str,
.priv_class = &compact_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void compact_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:732
static av_cold int compact_init(WriterContext *wctx)
Definition: ffprobe.c:690
static void compact_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:712
#define print_section_footer(s)
Definition: ffprobe.c:1408
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:223
static void compact_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:741
static void compact_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:754
static int flags
Definition: cpu.c:23
struct CompactContext CompactContext
#define print_section_header(s)
Definition: ffprobe.c:1407

Definition at line 764 of file ffprobe.c.

const AVOption csv_options[]
static
Initial value:
= {
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{NULL},
}
#define OFFSET(x)
Definition: ffprobe.c:1208
static void print_section(SectionID id, int level)
Definition: ffprobe.c:2125
NULL
Definition: eval.c:55

Definition at line 781 of file ffprobe.c.

const Writer csv_writer
static
Initial value:
= {
.name = "csv",
.priv_size = sizeof(CompactContext),
.print_integer = compact_print_int,
.print_string = compact_print_str,
.priv_class = &csv_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void compact_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:732
static av_cold int compact_init(WriterContext *wctx)
Definition: ffprobe.c:690
static void compact_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:712
#define print_section_footer(s)
Definition: ffprobe.c:1408
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:223
static void compact_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:741
static void compact_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:754
static int flags
Definition: cpu.c:23
struct CompactContext CompactContext
#define print_section_header(s)
Definition: ffprobe.c:1407

Definition at line 795 of file ffprobe.c.

const char* const decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P" }
static

Definition at line 144 of file ffprobe.c.

Referenced by value_string().

const AVOption default_options[]
static
Initial value:
= {
{ "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{ "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{ "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{ "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{NULL},
}
#define OFFSET(x)
Definition: ffprobe.c:1208
NULL
Definition: eval.c:55

Definition at line 524 of file ffprobe.c.

const Writer default_writer
static
Initial value:
= {
.name = "default",
.priv_size = sizeof(DefaultContext),
.print_integer = default_print_int,
.print_string = default_print_str,
.priv_class = &default_class,
}
static void default_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:544
struct DefaultContext DefaultContext
static void default_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:591
#define print_section_footer(s)
Definition: ffprobe.c:1408
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:223
static int flags
Definition: cpu.c:23
static void default_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:582
static void default_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:569
#define print_section_header(s)
Definition: ffprobe.c:1407

Definition at line 600 of file ffprobe.c.

int do_bitexact = 0
static

Definition at line 50 of file ffprobe.c.

Referenced by main(), show_format(), and show_stream().

int do_count_frames = 0
static

Definition at line 51 of file ffprobe.c.

Referenced by probe_file().

int do_count_packets = 0
static

Definition at line 52 of file ffprobe.c.

Referenced by probe_file().

int do_read_frames = 0
static

Definition at line 53 of file ffprobe.c.

Referenced by probe_file(), and read_packets().

int do_read_packets = 0
static

Definition at line 54 of file ffprobe.c.

Referenced by probe_file(), and read_packets().

int do_show_data = 0
static

Definition at line 61 of file ffprobe.c.

Referenced by show_packet(), and show_stream().

int do_show_error = 0
static

Definition at line 55 of file ffprobe.c.

Referenced by main().

int do_show_format = 0
static

Definition at line 56 of file ffprobe.c.

Referenced by main(), and probe_file().

int do_show_frames = 0
static

Definition at line 57 of file ffprobe.c.

Referenced by probe_file(), process_frame(), and xml_init().

int do_show_library_versions = 0
static

Definition at line 63 of file ffprobe.c.

Referenced by main().

int do_show_packets = 0
static

Definition at line 58 of file ffprobe.c.

Referenced by main(), probe_file(), read_packets(), and xml_init().

int do_show_program_version = 0
static

Definition at line 62 of file ffprobe.c.

Referenced by main().

int do_show_stream_disposition = 0
static

Definition at line 60 of file ffprobe.c.

Referenced by show_stream().

int do_show_streams = 0
static

Definition at line 59 of file ffprobe.c.

Referenced by main(), and probe_file().

const AVOption flat_options[]
static
Initial value:
= {
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{NULL},
}
#define OFFSET(x)
Definition: ffprobe.c:1208
NULL
Definition: eval.c:55

Definition at line 819 of file ffprobe.c.

const Writer flat_writer
static
Initial value:
= {
.name = "flat",
.priv_size = sizeof(FlatContext),
.print_integer = flat_print_int,
.print_string = flat_print_str,
.priv_class = &flat_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void flat_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:907
struct FlatContext FlatContext
static void flat_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:902
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:223
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:224
static int flags
Definition: cpu.c:23
static void flat_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:876
static av_cold int flat_init(WriterContext *wctx)
Definition: ffprobe.c:829
#define print_section_header(s)
Definition: ffprobe.c:1407

Definition at line 920 of file ffprobe.c.

AVInputFormat* iformat = NULL
static

Definition at line 141 of file ffprobe.c.

Referenced by ff_load_image(), movie_common_init(), show_format_opts(), and stream_open().

const AVOption ini_options[]
static
Initial value:
= {
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_INT, {.i64=1}, 0, 1 },
{NULL},
}
#define OFFSET(x)
Definition: ffprobe.c:1208
NULL
Definition: eval.c:55

Definition at line 941 of file ffprobe.c.

const Writer ini_writer
static
Initial value:
= {
.name = "ini",
.priv_size = sizeof(INIContext),
.print_integer = ini_print_int,
.print_string = ini_print_str,
.priv_class = &ini_class,
}
static void ini_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:976
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:223
static void ini_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1009
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:224
static int flags
Definition: cpu.c:23
static void ini_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1020
#define print_section_header(s)
Definition: ffprobe.c:1407

Definition at line 1025 of file ffprobe.c.

const char* input_filename
static

Definition at line 140 of file ffprobe.c.

Referenced by main(), and opt_input_file().

const AVOption json_options[]
static
Initial value:
= {
{ "compact", "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{ "c", "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{ NULL }
}
#define OFFSET(x)
Definition: ffprobe.c:1208
NULL
Definition: eval.c:55

Definition at line 1047 of file ffprobe.c.

const Writer json_writer
static
Initial value:
= {
.name = "json",
.priv_size = sizeof(JSONContext),
.print_integer = json_print_int,
.print_string = json_print_str,
.priv_class = &json_class,
}
static void json_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1170
static void json_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:1125
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void json_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1087
static av_cold int json_init(WriterContext *wctx)
Definition: ffprobe.c:1055
#define print_section_footer(s)
Definition: ffprobe.c:1408
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:224
static int flags
Definition: cpu.c:23
static void json_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1159
#define print_section_header(s)
Definition: ffprobe.c:1407

Definition at line 1185 of file ffprobe.c.

uint64_t* nb_streams_frames
static

Definition at line 152 of file ffprobe.c.

Referenced by probe_file(), process_frame(), and show_stream().

uint64_t* nb_streams_packets
static

Definition at line 151 of file ffprobe.c.

Referenced by probe_file(), read_packets(), and show_stream().

const OptionDef* options
static

Definition at line 137 of file ffprobe.c.

char* print_format
static

Definition at line 71 of file ffprobe.c.

Referenced by main().

const int program_birth_year = 2007

program birth year, defined by the program for show_banner()

Definition at line 48 of file ffprobe.c.

Referenced by ffprobe_show_program_version().

const char program_name[] = "ffprobe"

program name, defined by the program for show_version().

Definition at line 47 of file ffprobe.c.

Referenced by main(), and show_usage().

const OptionDef real_options[]
static

Definition at line 2176 of file ffprobe.c.

Referenced by main().

const Writer* registered_writers[MAX_REGISTERED_WRITERS_NB+1]
static

Definition at line 475 of file ffprobe.c.

struct section sections[]
static
Initial value:
= {
[SECTION_ID_ERROR] = { SECTION_ID_ERROR, "error", 0, { -1 } },
[SECTION_ID_FORMAT_TAGS] = { SECTION_ID_FORMAT_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "format_tags" },
[SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "frame_tags" },
[SECTION_ID_LIBRARY_VERSION] = { SECTION_ID_LIBRARY_VERSION, "library_version", 0, { -1 } },
[SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0, { -1 } },
[SECTION_ID_PROGRAM_VERSION] = { SECTION_ID_PROGRAM_VERSION, "program_version", 0, { -1 } },
[SECTION_ID_STREAM_DISPOSITION] = { SECTION_ID_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_disposition" },
[SECTION_ID_STREAM_TAGS] = { SECTION_ID_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "stream_tags" },
}
#define SECTION_FLAG_HAS_VARIABLE_FIELDS
the section may contain a variable number of fields with variable keys.
Definition: ffprobe.c:84
#define SECTION_FLAG_IS_WRAPPER
the section only contains other sections, but has no data at its own level
Definition: ffprobe.c:82
#define SECTION_FLAG_IS_ARRAY
the section contains an array of elements of the same type
Definition: ffprobe.c:83

Definition at line 115 of file ffprobe.c.

Referenced by writer_open().

int* selected_streams
static

Definition at line 153 of file ffprobe.c.

Referenced by probe_file(), read_packets(), and show_streams().

int show_private_data = 1
static

Definition at line 69 of file ffprobe.c.

Referenced by show_stream(), and xml_init().

int show_value_unit = 0
static

Definition at line 65 of file ffprobe.c.

Referenced by opt_pretty(), value_string(), and xml_init().

char* stream_specifier
static

Definition at line 72 of file ffprobe.c.

Referenced by probe_file().

const char unit_bit_per_second_str[] = "bit/s"
static

Definition at line 149 of file ffprobe.c.

Referenced by show_format(), and show_stream().

const char unit_byte_str[] = "byte"
static

Definition at line 148 of file ffprobe.c.

Referenced by show_format(), show_packet(), and value_string().

const char unit_hertz_str[] = "Hz"
static

Definition at line 147 of file ffprobe.c.

Referenced by show_stream().

const char unit_second_str[] = "s"
static

Definition at line 146 of file ffprobe.c.

Referenced by value_string(), and writer_print_time().

int use_byte_value_binary_prefix = 0
static

Definition at line 67 of file ffprobe.c.

Referenced by opt_pretty(), and value_string().

int use_value_prefix = 0
static

Definition at line 66 of file ffprobe.c.

Referenced by opt_pretty(), value_string(), and xml_init().

int use_value_sexagesimal_format = 0
static

Definition at line 68 of file ffprobe.c.

Referenced by opt_pretty(), and value_string().

const AVClass writer_class
static
Initial value:
= {
"Writer",
}
static const char * writer_get_name(void *p)
Definition: ffprobe.c:268
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
NULL
Definition: eval.c:55

Definition at line 274 of file ffprobe.c.

Referenced by writer_open().

const AVOption xml_options[]
static
Initial value:
= {
{"fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{"q", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{"xsd_strict", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{"x", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_INT, {.i64=0}, 0, 1 },
{NULL},
}
#define OFFSET(x)
Definition: ffprobe.c:1208
NULL
Definition: eval.c:55

Definition at line 1210 of file ffprobe.c.

Writer xml_writer
static
Initial value:
= {
.name = "xml",
.priv_size = sizeof(XMLContext),
.print_integer = xml_print_int,
.print_string = xml_print_str,
.priv_class = &xml_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void xml_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:1308
static void xml_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1327
#define print_section_footer(s)
Definition: ffprobe.c:1408
static av_cold int xml_init(WriterContext *wctx)
Definition: ffprobe.c:1220
static void xml_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1350
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:224
static int flags
Definition: cpu.c:23
static void xml_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1268
#define print_section_header(s)
Definition: ffprobe.c:1407

Definition at line 1357 of file ffprobe.c.