ffprobe.c File Reference

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

#include "config.h"
#include "version.h"
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/dict.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"

Go to the source code of this file.

Data Structures

struct  unit_value
struct  Writer
struct  WriterContext
struct  DefaultContext
struct  CompactContext
struct  JSONContext
struct  XMLContext

Defines

#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS   1
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER   2
#define MAX_REGISTERED_WRITERS_NB   64
#define OFFSET(x)   offsetof(DefaultContext, x)
#define OFFSET(x)   offsetof(CompactContext, 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_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)
#define print_ts(k, v)   writer_print_ts(w, k, v)
#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 show_tags(metadata)   writer_show_tags(w, metadata)
#define PRINT_CHAPTER(name)
#define SHOW_LIB_VERSION(libname, LIBNAME)

Typedefs

typedef struct WriterContext WriterContext

Functions

void av_noreturn exit_program (int ret)
 Do all the necessary cleanup and abort.
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, void *opaque)
static void writer_print_header (WriterContext *wctx)
static void writer_print_footer (WriterContext *wctx)
static void writer_print_chapter_header (WriterContext *wctx, const char *chapter)
static void writer_print_chapter_footer (WriterContext *wctx, const char *chapter)
static void writer_print_section_header (WriterContext *wctx, const char *section)
static void writer_print_section_footer (WriterContext *wctx, const char *section)
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_time (WriterContext *wctx, const char *key, int64_t ts, const AVRational *time_base)
static void writer_print_ts (WriterContext *wctx, const char *key, int64_t ts)
static void writer_show_tags (WriterContext *wctx, AVDictionary *dict)
static int writer_register (const Writer *writer)
static const Writerwriter_get_by_name (const char *name)
static const char * default_get_name (void *ctx)
static av_cold int default_init (WriterContext *wctx, const char *args, void *opaque)
static void default_print_footer (WriterContext *wctx)
static void default_print_chapter_header (WriterContext *wctx, const char *chapter)
static char * upcase_string (char *dst, size_t dst_size, const char *src)
static void default_print_section_header (WriterContext *wctx, const char *section)
static void default_print_section_footer (WriterContext *wctx, const char *section)
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 void default_show_tags (WriterContext *wctx, AVDictionary *dict)
static const char * c_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 Escape
, , \ and sep characters contained in s, and print the resulting string.
static const char * csv_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 Quote fields containing special characters, check RFC4180.
static const char * none_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
static const char * compact_get_name (void *ctx)
static av_cold int compact_init (WriterContext *wctx, const char *args, void *opaque)
static av_cold void compact_uninit (WriterContext *wctx)
static void compact_print_section_header (WriterContext *wctx, const char *section)
static void compact_print_section_footer (WriterContext *wctx, const char *section)
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)
static void compact_show_tags (WriterContext *wctx, AVDictionary *dict)
static av_cold int csv_init (WriterContext *wctx, const char *args, void *opaque)
static const char * json_get_name (void *ctx)
static av_cold int json_init (WriterContext *wctx, const char *args, void *opaque)
static const char * json_escape_str (AVBPrint *dst, const char *src, void *log_ctx)
static void json_print_header (WriterContext *wctx)
static void json_print_footer (WriterContext *wctx)
static void json_print_chapter_header (WriterContext *wctx, const char *chapter)
static void json_print_chapter_footer (WriterContext *wctx, const char *chapter)
static void json_print_section_header (WriterContext *wctx, const char *section)
static void json_print_section_footer (WriterContext *wctx, const char *section)
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)
static void json_show_tags (WriterContext *wctx, AVDictionary *dict)
static const char * xml_get_name (void *ctx)
static av_cold int xml_init (WriterContext *wctx, const char *args, void *opaque)
static const char * xml_escape_str (AVBPrint *dst, const char *src, void *log_ctx)
static void xml_print_header (WriterContext *wctx)
static void xml_print_footer (WriterContext *wctx)
static void xml_print_chapter_header (WriterContext *wctx, const char *chapter)
static void xml_print_chapter_footer (WriterContext *wctx, const char *chapter)
static void xml_print_section_header (WriterContext *wctx, const char *section)
static void xml_print_section_footer (WriterContext *wctx, const char *section)
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 xml_show_tags (WriterContext *wctx, AVDictionary *dict)
static void writer_register_all (void)
static void show_packet (WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pkt, int packet_idx)
static void show_frame (WriterContext *w, AVFrame *frame, AVStream *stream)
static av_always_inline int get_decoded_frame (AVFormatContext *fmt_ctx, AVFrame *frame, int *got_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 (const char *opt, const char *arg)
static int opt_show_format_entry (const char *opt, const char *arg)
static void opt_input_file (void *optctx, const char *arg)
static int opt_help (const char *opt, const char *arg)
static int opt_pretty (const char *opt, const char *arg)
static int opt_show_versions (const char *opt, const char *arg)
int main (int argc, char **argv)

Variables

const char program_name [] = "ffprobe"
 program name, defined by the program for show_version().
const int program_birth_year = 2007
 program birth year, defined by the program for show_banner()
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 AVDictionaryfmt_entries_to_show = NULL
static int do_show_packets = 0
static int do_show_streams = 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 const OptionDef options []
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 const AVClass writer_class
static const Writerregistered_writers [MAX_REGISTERED_WRITERS_NB+1]
static const AVOption default_options []
static const AVClass default_class
static const Writer default_writer
static const AVOption compact_options []
static const AVClass compact_class
static const Writer compact_writer
static const Writer csv_writer
static const AVOption json_options []
static const AVClass json_class
static const Writer json_writer
static const AVOption xml_options []
static const AVClass xml_class
static Writer xml_writer


Detailed Description

simple media prober based on the FFmpeg libraries

Definition in file ffprobe.c.


Define Documentation

#define CHECK_COMPLIANCE ( opt,
opt_name   ) 

Value:

if (opt) {                                                      \
            av_log(wctx, AV_LOG_ERROR,                                  \
                   "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);                                     \
        }

Referenced by xml_init().

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

#define MAX_REGISTERED_WRITERS_NB   64

Definition at line 335 of file ffprobe.c.

Referenced by writer_register().

#define OFFSET (  )     offsetof(XMLContext, x)

Definition at line 955 of file ffprobe.c.

#define OFFSET (  )     offsetof(JSONContext, x)

Definition at line 955 of file ffprobe.c.

#define OFFSET (  )     offsetof(CompactContext, x)

Definition at line 955 of file ffprobe.c.

#define OFFSET (  )     offsetof(DefaultContext, x)

Definition at line 955 of file ffprobe.c.

#define PRINT_CHAPTER ( name   ) 

Value:

do {                                        \
    if (do_show_ ## name) {                                             \
        writer_print_chapter_header(wctx, #name);                       \
        show_ ## name (wctx, fmt_ctx);                                  \
        writer_print_chapter_footer(wctx, #name);                       \
    }                                                                   \
} while (0)

Definition at line 1565 of file ffprobe.c.

Referenced by probe_file().

#define print_fmt ( k,
f,
...   ) 

Value:

do {              \
    av_bprint_clear(&pbuf);                    \
    av_bprintf(&pbuf, f, __VA_ARGS__);         \
    writer_print_string(w, k, pbuf.str, 0);    \
} while (0)

Definition at line 1179 of file ffprobe.c.

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

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

Definition at line 1185 of file ffprobe.c.

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

#define print_section_footer (  )     writer_print_section_footer(w, s)

#define print_section_header (  )     writer_print_section_header(w, s)

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

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

Definition at line 1187 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)

Definition at line 1188 of file ffprobe.c.

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

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

Definition at line 1189 of file ffprobe.c.

Referenced by show_frame(), and show_packet().

#define print_val ( k,
v,
 ) 

Value:

writer_print_string(w, k, \
    value_string(val_str, sizeof(val_str), (struct unit_value){.val.i = v, .unit=u}), 0)

Definition at line 1190 of file ffprobe.c.

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

#define SHOW_LIB_VERSION ( libname,
LIBNAME   ) 

Value:

do {                                                                \
        if (CONFIG_##LIBNAME) {                                         \
            unsigned int version = libname##_version();                 \
            print_section_header("library_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_section_footer("library_version");                    \
        }                                                               \
    } while (0)

Definition at line 1637 of file ffprobe.c.

Referenced by ffprobe_show_library_versions().

#define show_tags ( metadata   )     writer_show_tags(w, metadata)

Definition at line 1194 of file ffprobe.c.

Referenced by show_format(), and show_stream().

#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS   1

Definition at line 150 of file ffprobe.c.

Referenced by writer_print_string().

#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER   2

Definition at line 151 of file ffprobe.c.

Referenced by probe_file().

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


Typedef Documentation

typedef struct WriterContext WriterContext

Definition at line 148 of file ffprobe.c.


Function Documentation

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

Escape
, , \ and sep characters contained in s, and print the resulting string.

Definition at line 503 of file ffprobe.c.

Referenced by compact_init().

static void close_input_file ( AVFormatContext **  ctx_ptr  )  [static]

Definition at line 1552 of file ffprobe.c.

Referenced by probe_file().

static const char* compact_get_name ( void *  ctx  )  [static]

Definition at line 574 of file ffprobe.c.

static av_cold int compact_init ( WriterContext wctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 585 of file ffprobe.c.

Referenced by csv_init().

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

Definition at line 649 of file ffprobe.c.

static void compact_print_section_footer ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 631 of file ffprobe.c.

static void compact_print_section_header ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 624 of file ffprobe.c.

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

Definition at line 636 of file ffprobe.c.

static void compact_show_tags ( WriterContext wctx,
AVDictionary dict 
) [static]

Definition at line 659 of file ffprobe.c.

static av_cold void compact_uninit ( WriterContext wctx  )  [static]

Definition at line 616 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 524 of file ffprobe.c.

Referenced by compact_init().

static av_cold int csv_init ( WriterContext wctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 695 of file ffprobe.c.

static const char* default_get_name ( void *  ctx  )  [static]

Definition at line 382 of file ffprobe.c.

static av_cold int default_init ( WriterContext wctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 393 of file ffprobe.c.

static void default_print_chapter_header ( WriterContext wctx,
const char *  chapter 
) [static]

Definition at line 418 of file ffprobe.c.

static void default_print_footer ( WriterContext wctx  )  [static]

Definition at line 410 of file ffprobe.c.

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

Definition at line 464 of file ffprobe.c.

static void default_print_section_footer ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 447 of file ffprobe.c.

static void default_print_section_header ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 436 of file ffprobe.c.

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

Definition at line 456 of file ffprobe.c.

static void default_show_tags ( WriterContext wctx,
AVDictionary dict 
) [static]

Definition at line 473 of file ffprobe.c.

void av_noreturn exit_program ( int  ret  ) 

Do all the necessary cleanup and abort.

This function is implemented in the avtools, not cmdutils.

Definition at line 83 of file ffprobe.c.

static void ffprobe_show_library_versions ( WriterContext w  )  [static]

Definition at line 1651 of file ffprobe.c.

Referenced by main().

static void ffprobe_show_program_version ( WriterContext w  )  [static]

Definition at line 1616 of file ffprobe.c.

Referenced by main().

static av_always_inline int get_decoded_frame ( AVFormatContext fmt_ctx,
AVFrame frame,
int *  got_frame,
AVPacket pkt 
) [static]

Definition at line 1283 of file ffprobe.c.

Referenced by read_packets().

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

Definition at line 764 of file ffprobe.c.

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

static const char* json_get_name ( void *  ctx  )  [static]

Definition at line 733 of file ffprobe.c.

static av_cold int json_init ( WriterContext wctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 744 of file ffprobe.c.

static void json_print_chapter_footer ( WriterContext wctx,
const char *  chapter 
) [static]

Definition at line 821 of file ffprobe.c.

static void json_print_chapter_header ( WriterContext wctx,
const char *  chapter 
) [static]

Definition at line 800 of file ffprobe.c.

static void json_print_footer ( WriterContext wctx  )  [static]

Definition at line 791 of file ffprobe.c.

static void json_print_header ( WriterContext wctx  )  [static]

Definition at line 784 of file ffprobe.c.

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

Definition at line 887 of file ffprobe.c.

static void json_print_item_str ( WriterContext wctx,
const char *  key,
const char *  value 
) [inline, static]

Definition at line 863 of file ffprobe.c.

Referenced by json_print_str(), and json_show_tags().

static void json_print_section_footer ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 852 of file ffprobe.c.

static void json_print_section_header ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 833 of file ffprobe.c.

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

Definition at line 877 of file ffprobe.c.

static void json_show_tags ( WriterContext wctx,
AVDictionary dict 
) [static]

Definition at line 901 of file ffprobe.c.

int main ( int  argc,
char **  argv 
)

Definition at line 1755 of file ffprobe.c.

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

Definition at line 547 of file ffprobe.c.

Referenced by compact_init().

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

Definition at line 1508 of file ffprobe.c.

static int opt_format ( const char *  opt,
const char *  arg 
) [static]

Definition at line 1665 of file ffprobe.c.

static int opt_help ( const char *  opt,
const char *  arg 
) [static]

Definition at line 1695 of file ffprobe.c.

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

Definition at line 1682 of file ffprobe.c.

static int opt_pretty ( const char *  opt,
const char *  arg 
) [static]

Definition at line 1707 of file ffprobe.c.

static int opt_show_format_entry ( const char *  opt,
const char *  arg 
) [static]

Definition at line 1675 of file ffprobe.c.

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

Definition at line 1716 of file ffprobe.c.

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

Definition at line 1573 of file ffprobe.c.

Referenced by main().

static void read_packets ( WriterContext w,
AVFormatContext fmt_ctx 
) [static]

Definition at line 1304 of file ffprobe.c.

Referenced by probe_file().

static void show_error ( WriterContext w,
int  err 
) [static]

Definition at line 1492 of file ffprobe.c.

Referenced by main().

static void show_format ( WriterContext w,
AVFormatContext fmt_ctx 
) [static]

Definition at line 1471 of file ffprobe.c.

static void show_frame ( WriterContext w,
AVFrame frame,
AVStream stream 
) [static]

Definition at line 1226 of file ffprobe.c.

Referenced by read_packets().

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

Definition at line 1196 of file ffprobe.c.

Referenced by read_packets().

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

Definition at line 1350 of file ffprobe.c.

Referenced by show_streams().

static void show_streams ( WriterContext w,
AVFormatContext fmt_ctx 
) [static]

Definition at line 1464 of file ffprobe.c.

static void show_usage ( void   )  [static]

Definition at line 1609 of file ffprobe.c.

static char* upcase_string ( char *  dst,
size_t  dst_size,
const char *  src 
) [inline, static]

Definition at line 427 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 94 of file ffprobe.c.

Referenced by writer_print_time().

static void writer_close ( WriterContext **  wctx  )  [static]

Definition at line 198 of file ffprobe.c.

Referenced by main(), and writer_open().

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

Definition at line 350 of file ffprobe.c.

Referenced by main().

static const char* writer_get_name ( void *  p  )  [static]

Definition at line 185 of file ffprobe.c.

static int writer_open ( WriterContext **  wctx,
const Writer writer,
const char *  args,
void *  opaque 
) [static]

Definition at line 209 of file ffprobe.c.

Referenced by main().

static void writer_print_chapter_footer ( WriterContext wctx,
const char *  chapter 
) [inline, static]

static void writer_print_chapter_header ( WriterContext wctx,
const char *  chapter 
) [inline, static]

static void writer_print_footer ( WriterContext wctx  )  [inline, static]

Definition at line 245 of file ffprobe.c.

Referenced by main().

static void writer_print_header ( WriterContext wctx  )  [inline, static]

Definition at line 238 of file ffprobe.c.

Referenced by main().

static void writer_print_integer ( WriterContext wctx,
const char *  key,
long long int  val 
) [inline, static]

Definition at line 285 of file ffprobe.c.

Referenced by writer_print_ts().

static void writer_print_section_footer ( WriterContext wctx,
const char *  section 
) [inline, static]

Definition at line 277 of file ffprobe.c.

static void writer_print_section_header ( WriterContext wctx,
const char *  section 
) [inline, static]

Definition at line 269 of file ffprobe.c.

static void writer_print_string ( WriterContext wctx,
const char *  key,
const char *  val,
int  opt 
) [inline, static]

Definition at line 294 of file ffprobe.c.

Referenced by default_show_tags(), writer_print_time(), and writer_print_ts().

static void writer_print_time ( WriterContext wctx,
const char *  key,
int64_t  ts,
const AVRational time_base 
) [static]

Definition at line 305 of file ffprobe.c.

static void writer_print_ts ( WriterContext wctx,
const char *  key,
int64_t  ts 
) [static]

Definition at line 321 of file ffprobe.c.

static int writer_register ( const Writer writer  )  [static]

Definition at line 339 of file ffprobe.c.

Referenced by writer_register_all().

static void writer_register_all ( void   )  [static]

Definition at line 1164 of file ffprobe.c.

Referenced by main().

static void writer_show_tags ( WriterContext wctx,
AVDictionary dict 
) [inline, static]

Definition at line 330 of file ffprobe.c.

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

Definition at line 1014 of file ffprobe.c.

Referenced by xml_print_str(), and xml_show_tags().

static const char* xml_get_name ( void *  ctx  )  [static]

Definition at line 965 of file ffprobe.c.

static av_cold int xml_init ( WriterContext wctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 976 of file ffprobe.c.

static void xml_print_chapter_footer ( WriterContext wctx,
const char *  chapter 
) [static]

Definition at line 1073 of file ffprobe.c.

static void xml_print_chapter_header ( WriterContext wctx,
const char *  chapter 
) [static]

Definition at line 1057 of file ffprobe.c.

static void xml_print_footer ( WriterContext wctx  )  [static]

Definition at line 1047 of file ffprobe.c.

static void xml_print_header ( WriterContext wctx  )  [static]

Definition at line 1032 of file ffprobe.c.

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

Definition at line 1113 of file ffprobe.c.

static void xml_print_section_footer ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 1091 of file ffprobe.c.

static void xml_print_section_header ( WriterContext wctx,
const char *  section 
) [static]

Definition at line 1083 of file ffprobe.c.

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

Definition at line 1102 of file ffprobe.c.

static void xml_show_tags ( WriterContext wctx,
AVDictionary dict 
) [static]

Definition at line 1120 of file ffprobe.c.


Variable Documentation

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

Definition at line 73 of file ffprobe.c.

Referenced by value_string().

const AVClass compact_class [static]

Initial value:

 {
    "CompactContext",
    compact_get_name,
    compact_options
}

Definition at line 579 of file ffprobe.c.

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,    {.dbl=0},    0,        1        },
    {"nk",       "force no key printing", OFFSET(nokey),           AV_OPT_TYPE_INT,    {.dbl=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 },
    {NULL},
}

Definition at line 564 of file ffprobe.c.

const Writer compact_writer [static]

const Writer csv_writer [static]

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

Definition at line 74 of file ffprobe.c.

Referenced by value_string().

const AVClass default_class [static]

Initial value:

 {
    "DefaultContext",
    default_get_name,
    default_options
}

Definition at line 387 of file ffprobe.c.

const AVOption default_options[] [static]

Initial value:

 {
    { "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
    { "nw",               "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
    { "nokey",          "force no key printing",     OFFSET(nokey),          AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
    { "nk",             "force no key printing",     OFFSET(nokey),          AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
    {NULL},
}

Definition at line 374 of file ffprobe.c.

const Writer default_writer [static]

Initial value:

Definition at line 483 of file ffprobe.c.

int do_count_frames = 0 [static]

Definition at line 46 of file ffprobe.c.

Referenced by probe_file().

int do_count_packets = 0 [static]

Definition at line 47 of file ffprobe.c.

Referenced by probe_file().

int do_read_frames = 0 [static]

Definition at line 48 of file ffprobe.c.

Referenced by probe_file(), and read_packets().

int do_read_packets = 0 [static]

Definition at line 49 of file ffprobe.c.

Referenced by probe_file(), and read_packets().

int do_show_error = 0 [static]

Definition at line 50 of file ffprobe.c.

Referenced by main().

int do_show_format = 0 [static]

Definition at line 51 of file ffprobe.c.

Referenced by main(), and opt_show_format_entry().

int do_show_frames = 0 [static]

Definition at line 52 of file ffprobe.c.

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

int do_show_library_versions = 0 [static]

Definition at line 57 of file ffprobe.c.

Referenced by main(), and opt_show_versions().

int do_show_packets = 0 [static]

Definition at line 54 of file ffprobe.c.

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

int do_show_program_version = 0 [static]

Definition at line 56 of file ffprobe.c.

Referenced by main(), and opt_show_versions().

int do_show_streams = 0 [static]

Definition at line 55 of file ffprobe.c.

Referenced by main().

Definition at line 53 of file ffprobe.c.

AVInputFormat* iformat = NULL [static]

Definition at line 71 of file ffprobe.c.

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

const char* input_filename [static]

Definition at line 70 of file ffprobe.c.

const AVClass json_class [static]

Initial value:

 {
    "JSONContext",
    json_get_name,
    json_options
}

Definition at line 738 of file ffprobe.c.

const AVOption json_options[] [static]

Initial value:

 {
    { "compact", "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
    { "c",       "enable compact output", OFFSET(compact), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
    { NULL }
}

Definition at line 727 of file ffprobe.c.

const Writer json_writer [static]

Initial value:

Definition at line 927 of file ffprobe.c.

uint64_t* nb_streams_frames [static]

Definition at line 81 of file ffprobe.c.

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

uint64_t* nb_streams_packets [static]

Definition at line 80 of file ffprobe.c.

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

static const OptionDef options [static]

Definition at line 67 of file ffprobe.c.

char* print_format [static]

Definition at line 65 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 44 of file ffprobe.c.

const char program_name[] = "ffprobe"

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

Definition at line 43 of file ffprobe.c.

const Writer* registered_writers[MAX_REGISTERED_WRITERS_NB+1] [static]

Definition at line 337 of file ffprobe.c.

int show_private_data = 1 [static]

Definition at line 63 of file ffprobe.c.

Referenced by show_stream(), and xml_init().

int show_value_unit = 0 [static]

Definition at line 59 of file ffprobe.c.

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

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

Definition at line 79 of file ffprobe.c.

Referenced by show_format(), and show_stream().

const char unit_byte_str[] = "byte" [static]

Definition at line 78 of file ffprobe.c.

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

const char unit_hertz_str[] = "Hz" [static]

Definition at line 77 of file ffprobe.c.

Referenced by show_stream().

const char unit_second_str[] = "s" [static]

Definition at line 76 of file ffprobe.c.

Referenced by value_string(), and writer_print_time().

int use_byte_value_binary_prefix = 0 [static]

Definition at line 61 of file ffprobe.c.

Referenced by opt_pretty(), and value_string().

int use_value_prefix = 0 [static]

Definition at line 60 of file ffprobe.c.

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

int use_value_sexagesimal_format = 0 [static]

Definition at line 62 of file ffprobe.c.

Referenced by opt_pretty(), and value_string().

const AVClass writer_class [static]

Initial value:

Definition at line 191 of file ffprobe.c.

const AVClass xml_class [static]

Initial value:

 {
    "XMLContext",
    xml_get_name,
    xml_options
}

Definition at line 970 of file ffprobe.c.

const AVOption xml_options[] [static]

Initial value:

 {
    {"fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.dbl=0},  0, 1 },
    {"q",               "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_INT, {.dbl=0},  0, 1 },
    {"xsd_strict",      "ensure that the output is XSD compliant",         OFFSET(xsd_strict),      AV_OPT_TYPE_INT, {.dbl=0},  0, 1 },
    {"x",               "ensure that the output is XSD compliant",         OFFSET(xsd_strict),      AV_OPT_TYPE_INT, {.dbl=0},  0, 1 },
    {NULL},
}

Definition at line 957 of file ffprobe.c.

Writer xml_writer [static]

Initial value:

 {
    .name                 = "xml",
    .priv_size            = sizeof(XMLContext),
    .init                 = xml_init,
    .print_header         = xml_print_header,
    .print_footer         = xml_print_footer,
    .print_chapter_header = xml_print_chapter_header,
    .print_chapter_footer = xml_print_chapter_footer,
    .print_section_header = xml_print_section_header,
    .print_section_footer = xml_print_section_footer,
    .print_integer        = xml_print_int,
    .print_string         = xml_print_str,
    .show_tags            = xml_show_tags,
    .flags = WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER,
}

Definition at line 1148 of file ffprobe.c.


Generated on Fri Oct 26 02:47:54 2012 for FFmpeg by  doxygen 1.5.8