/*
- * ffprobe : Simple Media Prober based on the FFmpeg libraries
* Copyright (c) 2007-2010 Stefano Sabatini
*
* This file is part of FFmpeg.
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+/**
+ * @file
+ * simple media prober based on the FFmpeg libraries
+ */
+
#include "config.h"
#include "libavformat/avformat.h"
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;
#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) writer_print_string(w, k, \
- value_string(val_str, sizeof(val_str), (struct unit_value){.val.i = v, .unit=u}), 1)
+ value_string(val_str, sizeof(val_str), (struct unit_value){.val.i = v, .unit=u}), 0)
#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)
if (s) print_str ("pix_fmt", s);
else print_str_opt("pix_fmt", "unknown");
print_int("level", dec_ctx->level);
+ if (dec_ctx->timecode_frame_start >= 0) {
+ uint32_t tc = dec_ctx->timecode_frame_start;
+ print_fmt("timecode", "%02d:%02d:%02d%c%02d",
+ tc>>19 & 0x1f, // hours
+ tc>>13 & 0x3f, // minutes
+ tc>>6 & 0x3f, // seconds
+ tc & 1<<24 ? ';' : ':', // drop
+ tc & 0x3f); // frames
+ } else {
+ print_str_opt("timecode", "N/A");
+ }
break;
case AVMEDIA_TYPE_AUDIO:
} else {
print_str_opt("codec_type", "unknown");
}
- if (dec_ctx->codec && dec_ctx->codec->priv_class) {
+ if (dec_ctx->codec && dec_ctx->codec->priv_class && show_private_data) {
const AVOption *opt = NULL;
while (opt = av_opt_next(dec_ctx->priv_data,opt)) {
uint8_t *str;
PRINT_CHAPTER(format);
writer_print_footer(wctx);
- av_close_input_file(fmt_ctx);
+ avformat_close_input(&fmt_ctx);
writer_close(&wctx);
end:
{ "show_format", OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },
{ "show_packets", OPT_BOOL, {(void*)&do_show_packets}, "show packets info" },
{ "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },
+ { "show_private_data", OPT_BOOL, {(void*)&show_private_data}, "show private data" },
+ { "private", OPT_BOOL, {(void*)&show_private_data}, "same as show_private_data" },
{ "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
{ "i", HAS_ARG, {(void *)opt_input_file}, "read specified file", "input_file"},
{ NULL, },
avdevice_register_all();
#endif
- show_banner();
+ show_banner(argc, argv, options);
parse_options(NULL, argc, argv, options, opt_input_file);
if (!input_filename) {