~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/ffprobe.c

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * ffprobe : Simple Media Prober based on the Libav libraries
3
 
 * Copyright (c) 2007-2010 Stefano Sabatini
4
 
 *
5
 
 * This file is part of Libav.
6
 
 *
7
 
 * Libav is free software; you can redistribute it and/or
8
 
 * modify it under the terms of the GNU Lesser General Public
9
 
 * License as published by the Free Software Foundation; either
10
 
 * version 2.1 of the License, or (at your option) any later version.
11
 
 *
12
 
 * Libav is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
 * Lesser General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU Lesser General Public
18
 
 * License along with Libav; if not, write to the Free Software
19
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 
 */
21
 
 
22
 
#include "config.h"
23
 
 
24
 
#include "libavformat/avformat.h"
25
 
#include "libavcodec/avcodec.h"
26
 
#include "libavutil/opt.h"
27
 
#include "libavutil/pixdesc.h"
28
 
#include "libavutil/dict.h"
29
 
#include "libavdevice/avdevice.h"
30
 
#include "cmdutils.h"
31
 
 
32
 
const char program_name[] = "ffprobe";
33
 
const int program_birth_year = 2007;
34
 
 
35
 
static int do_show_format  = 0;
36
 
static int do_show_packets = 0;
37
 
static int do_show_streams = 0;
38
 
 
39
 
static int show_value_unit              = 0;
40
 
static int use_value_prefix             = 0;
41
 
static int use_byte_value_binary_prefix = 0;
42
 
static int use_value_sexagesimal_format = 0;
43
 
 
44
 
/* globals */
45
 
static const OptionDef options[];
46
 
 
47
 
/* FFprobe context */
48
 
static const char *input_filename;
49
 
static AVInputFormat *iformat = NULL;
50
 
 
51
 
static const char *binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
52
 
static const char *decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P"  };
53
 
 
54
 
static const char *unit_second_str          = "s"    ;
55
 
static const char *unit_hertz_str           = "Hz"   ;
56
 
static const char *unit_byte_str            = "byte" ;
57
 
static const char *unit_bit_per_second_str  = "bit/s";
58
 
 
59
 
static char *value_string(char *buf, int buf_size, double val, const char *unit)
60
 
{
61
 
    if (unit == unit_second_str && use_value_sexagesimal_format) {
62
 
        double secs;
63
 
        int hours, mins;
64
 
        secs  = val;
65
 
        mins  = (int)secs / 60;
66
 
        secs  = secs - mins * 60;
67
 
        hours = mins / 60;
68
 
        mins %= 60;
69
 
        snprintf(buf, buf_size, "%d:%02d:%09.6f", hours, mins, secs);
70
 
    } else if (use_value_prefix) {
71
 
        const char *prefix_string;
72
 
        int index;
73
 
 
74
 
        if (unit == unit_byte_str && use_byte_value_binary_prefix) {
75
 
            index = (int) (log(val)/log(2)) / 10;
76
 
            index = av_clip(index, 0, FF_ARRAY_ELEMS(binary_unit_prefixes) -1);
77
 
            val /= pow(2, index*10);
78
 
            prefix_string = binary_unit_prefixes[index];
79
 
        } else {
80
 
            index = (int) (log10(val)) / 3;
81
 
            index = av_clip(index, 0, FF_ARRAY_ELEMS(decimal_unit_prefixes) -1);
82
 
            val /= pow(10, index*3);
83
 
            prefix_string = decimal_unit_prefixes[index];
84
 
        }
85
 
 
86
 
        snprintf(buf, buf_size, "%.3f %s%s", val, prefix_string, show_value_unit ? unit : "");
87
 
    } else {
88
 
        snprintf(buf, buf_size, "%f %s", val, show_value_unit ? unit : "");
89
 
    }
90
 
 
91
 
    return buf;
92
 
}
93
 
 
94
 
static char *time_value_string(char *buf, int buf_size, int64_t val, const AVRational *time_base)
95
 
{
96
 
    if (val == AV_NOPTS_VALUE) {
97
 
        snprintf(buf, buf_size, "N/A");
98
 
    } else {
99
 
        value_string(buf, buf_size, val * av_q2d(*time_base), unit_second_str);
100
 
    }
101
 
 
102
 
    return buf;
103
 
}
104
 
 
105
 
static char *ts_value_string (char *buf, int buf_size, int64_t ts)
106
 
{
107
 
    if (ts == AV_NOPTS_VALUE) {
108
 
        snprintf(buf, buf_size, "N/A");
109
 
    } else {
110
 
        snprintf(buf, buf_size, "%"PRId64, ts);
111
 
    }
112
 
 
113
 
    return buf;
114
 
}
115
 
 
116
 
static const char *media_type_string(enum AVMediaType media_type)
117
 
{
118
 
    switch (media_type) {
119
 
    case AVMEDIA_TYPE_VIDEO:      return "video";
120
 
    case AVMEDIA_TYPE_AUDIO:      return "audio";
121
 
    case AVMEDIA_TYPE_DATA:       return "data";
122
 
    case AVMEDIA_TYPE_SUBTITLE:   return "subtitle";
123
 
    case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
124
 
    default:                      return "unknown";
125
 
    }
126
 
}
127
 
 
128
 
static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)
129
 
{
130
 
    char val_str[128];
131
 
    AVStream *st = fmt_ctx->streams[pkt->stream_index];
132
 
 
133
 
    printf("[PACKET]\n");
134
 
    printf("codec_type=%s\n"   , media_type_string(st->codec->codec_type));
135
 
    printf("stream_index=%d\n" , pkt->stream_index);
136
 
    printf("pts=%s\n"          , ts_value_string  (val_str, sizeof(val_str), pkt->pts));
137
 
    printf("pts_time=%s\n"     , time_value_string(val_str, sizeof(val_str), pkt->pts, &st->time_base));
138
 
    printf("dts=%s\n"          , ts_value_string  (val_str, sizeof(val_str), pkt->dts));
139
 
    printf("dts_time=%s\n"     , time_value_string(val_str, sizeof(val_str), pkt->dts, &st->time_base));
140
 
    printf("duration=%s\n"     , ts_value_string  (val_str, sizeof(val_str), pkt->duration));
141
 
    printf("duration_time=%s\n", time_value_string(val_str, sizeof(val_str), pkt->duration, &st->time_base));
142
 
    printf("size=%s\n"         , value_string     (val_str, sizeof(val_str), pkt->size, unit_byte_str));
143
 
    printf("pos=%"PRId64"\n"   , pkt->pos);
144
 
    printf("flags=%c\n"        , pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_');
145
 
    printf("[/PACKET]\n");
146
 
}
147
 
 
148
 
static void show_packets(AVFormatContext *fmt_ctx)
149
 
{
150
 
    AVPacket pkt;
151
 
 
152
 
    av_init_packet(&pkt);
153
 
 
154
 
    while (!av_read_frame(fmt_ctx, &pkt))
155
 
        show_packet(fmt_ctx, &pkt);
156
 
}
157
 
 
158
 
static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
159
 
{
160
 
    AVStream *stream = fmt_ctx->streams[stream_idx];
161
 
    AVCodecContext *dec_ctx;
162
 
    AVCodec *dec;
163
 
    char val_str[128];
164
 
    AVDictionaryEntry *tag = NULL;
165
 
    AVRational display_aspect_ratio;
166
 
 
167
 
    printf("[STREAM]\n");
168
 
 
169
 
    printf("index=%d\n",        stream->index);
170
 
 
171
 
    if ((dec_ctx = stream->codec)) {
172
 
        if ((dec = dec_ctx->codec)) {
173
 
            printf("codec_name=%s\n",         dec->name);
174
 
            printf("codec_long_name=%s\n",    dec->long_name);
175
 
        } else {
176
 
            printf("codec_name=unknown\n");
177
 
        }
178
 
 
179
 
        printf("codec_type=%s\n",         media_type_string(dec_ctx->codec_type));
180
 
        printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den);
181
 
 
182
 
        /* print AVI/FourCC tag */
183
 
        av_get_codec_tag_string(val_str, sizeof(val_str), dec_ctx->codec_tag);
184
 
        printf("codec_tag_string=%s\n", val_str);
185
 
        printf("codec_tag=0x%04x\n", dec_ctx->codec_tag);
186
 
 
187
 
        switch (dec_ctx->codec_type) {
188
 
        case AVMEDIA_TYPE_VIDEO:
189
 
            printf("width=%d\n",                   dec_ctx->width);
190
 
            printf("height=%d\n",                  dec_ctx->height);
191
 
            printf("has_b_frames=%d\n",            dec_ctx->has_b_frames);
192
 
            if (dec_ctx->sample_aspect_ratio.num) {
193
 
                printf("sample_aspect_ratio=%d:%d\n", dec_ctx->sample_aspect_ratio.num,
194
 
                                                      dec_ctx->sample_aspect_ratio.den);
195
 
                av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den,
196
 
                          dec_ctx->width  * dec_ctx->sample_aspect_ratio.num,
197
 
                          dec_ctx->height * dec_ctx->sample_aspect_ratio.den,
198
 
                          1024*1024);
199
 
                printf("display_aspect_ratio=%d:%d\n", display_aspect_ratio.num,
200
 
                                                       display_aspect_ratio.den);
201
 
            }
202
 
            printf("pix_fmt=%s\n",                 dec_ctx->pix_fmt != PIX_FMT_NONE ?
203
 
                   av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
204
 
            break;
205
 
 
206
 
        case AVMEDIA_TYPE_AUDIO:
207
 
            printf("sample_rate=%s\n",             value_string(val_str, sizeof(val_str),
208
 
                                                                dec_ctx->sample_rate,
209
 
                                                                unit_hertz_str));
210
 
            printf("channels=%d\n",                dec_ctx->channels);
211
 
            printf("bits_per_sample=%d\n",         av_get_bits_per_sample(dec_ctx->codec_id));
212
 
            break;
213
 
        }
214
 
    } else {
215
 
        printf("codec_type=unknown\n");
216
 
    }
217
 
 
218
 
    if (fmt_ctx->iformat->flags & AVFMT_SHOW_IDS)
219
 
        printf("id=0x%x\n", stream->id);
220
 
    printf("r_frame_rate=%d/%d\n",         stream->r_frame_rate.num,   stream->r_frame_rate.den);
221
 
    printf("avg_frame_rate=%d/%d\n",       stream->avg_frame_rate.num, stream->avg_frame_rate.den);
222
 
    printf("time_base=%d/%d\n",            stream->time_base.num,      stream->time_base.den);
223
 
    printf("start_time=%s\n",   time_value_string(val_str, sizeof(val_str), stream->start_time,
224
 
                                                  &stream->time_base));
225
 
    printf("duration=%s\n",     time_value_string(val_str, sizeof(val_str), stream->duration,
226
 
                                                  &stream->time_base));
227
 
    if (stream->nb_frames)
228
 
        printf("nb_frames=%"PRId64"\n",    stream->nb_frames);
229
 
 
230
 
    while ((tag = av_dict_get(stream->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
231
 
        printf("TAG:%s=%s\n", tag->key, tag->value);
232
 
 
233
 
    printf("[/STREAM]\n");
234
 
}
235
 
 
236
 
static void show_format(AVFormatContext *fmt_ctx)
237
 
{
238
 
    AVDictionaryEntry *tag = NULL;
239
 
    char val_str[128];
240
 
 
241
 
    printf("[FORMAT]\n");
242
 
 
243
 
    printf("filename=%s\n",         fmt_ctx->filename);
244
 
    printf("nb_streams=%d\n",       fmt_ctx->nb_streams);
245
 
    printf("format_name=%s\n",      fmt_ctx->iformat->name);
246
 
    printf("format_long_name=%s\n", fmt_ctx->iformat->long_name);
247
 
    printf("start_time=%s\n",       time_value_string(val_str, sizeof(val_str), fmt_ctx->start_time,
248
 
                                                      &AV_TIME_BASE_Q));
249
 
    printf("duration=%s\n",         time_value_string(val_str, sizeof(val_str), fmt_ctx->duration,
250
 
                                                      &AV_TIME_BASE_Q));
251
 
    printf("size=%s\n",             value_string(val_str, sizeof(val_str), fmt_ctx->file_size,
252
 
                                                 unit_byte_str));
253
 
    printf("bit_rate=%s\n",         value_string(val_str, sizeof(val_str), fmt_ctx->bit_rate,
254
 
                                                 unit_bit_per_second_str));
255
 
 
256
 
    while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX)))
257
 
        printf("TAG:%s=%s\n", tag->key, tag->value);
258
 
 
259
 
    printf("[/FORMAT]\n");
260
 
}
261
 
 
262
 
static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
263
 
{
264
 
    int err, i;
265
 
    AVFormatContext *fmt_ctx = NULL;
266
 
    AVDictionaryEntry *t;
267
 
 
268
 
    if ((err = avformat_open_input(&fmt_ctx, filename, iformat, &format_opts)) < 0) {
269
 
        print_error(filename, err);
270
 
        return err;
271
 
    }
272
 
    if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
273
 
        av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
274
 
        return AVERROR_OPTION_NOT_FOUND;
275
 
    }
276
 
 
277
 
 
278
 
    /* fill the streams in the format context */
279
 
    if ((err = av_find_stream_info(fmt_ctx)) < 0) {
280
 
        print_error(filename, err);
281
 
        return err;
282
 
    }
283
 
 
284
 
    av_dump_format(fmt_ctx, 0, filename, 0);
285
 
 
286
 
    /* bind a decoder to each input stream */
287
 
    for (i = 0; i < fmt_ctx->nb_streams; i++) {
288
 
        AVStream *stream = fmt_ctx->streams[i];
289
 
        AVCodec *codec;
290
 
 
291
 
        if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
292
 
            fprintf(stderr, "Unsupported codec with id %d for input stream %d\n",
293
 
                    stream->codec->codec_id, stream->index);
294
 
        } else if (avcodec_open(stream->codec, codec) < 0) {
295
 
            fprintf(stderr, "Error while opening codec for input stream %d\n",
296
 
                    stream->index);
297
 
        }
298
 
    }
299
 
 
300
 
    *fmt_ctx_ptr = fmt_ctx;
301
 
    return 0;
302
 
}
303
 
 
304
 
static int probe_file(const char *filename)
305
 
{
306
 
    AVFormatContext *fmt_ctx;
307
 
    int ret, i;
308
 
 
309
 
    if ((ret = open_input_file(&fmt_ctx, filename)))
310
 
        return ret;
311
 
 
312
 
    if (do_show_packets)
313
 
        show_packets(fmt_ctx);
314
 
 
315
 
    if (do_show_streams)
316
 
        for (i = 0; i < fmt_ctx->nb_streams; i++)
317
 
            show_stream(fmt_ctx, i);
318
 
 
319
 
    if (do_show_format)
320
 
        show_format(fmt_ctx);
321
 
 
322
 
    av_close_input_file(fmt_ctx);
323
 
    return 0;
324
 
}
325
 
 
326
 
static void show_usage(void)
327
 
{
328
 
    printf("Simple multimedia streams analyzer\n");
329
 
    printf("usage: ffprobe [OPTIONS] [INPUT_FILE]\n");
330
 
    printf("\n");
331
 
}
332
 
 
333
 
static int opt_format(const char *opt, const char *arg)
334
 
{
335
 
    iformat = av_find_input_format(arg);
336
 
    if (!iformat) {
337
 
        fprintf(stderr, "Unknown input format: %s\n", arg);
338
 
        return AVERROR(EINVAL);
339
 
    }
340
 
    return 0;
341
 
}
342
 
 
343
 
static void opt_input_file(const char *arg)
344
 
{
345
 
    if (input_filename) {
346
 
        fprintf(stderr, "Argument '%s' provided as input filename, but '%s' was already specified.\n",
347
 
                arg, input_filename);
348
 
        exit(1);
349
 
    }
350
 
    if (!strcmp(arg, "-"))
351
 
        arg = "pipe:";
352
 
    input_filename = arg;
353
 
}
354
 
 
355
 
static void show_help(void)
356
 
{
357
 
    av_log_set_callback(log_callback_help);
358
 
    show_usage();
359
 
    show_help_options(options, "Main options:\n", 0, 0);
360
 
    printf("\n");
361
 
    av_opt_show2(avformat_opts, NULL,
362
 
                 AV_OPT_FLAG_DECODING_PARAM, 0);
363
 
}
364
 
 
365
 
static void opt_pretty(void)
366
 
{
367
 
    show_value_unit              = 1;
368
 
    use_value_prefix             = 1;
369
 
    use_byte_value_binary_prefix = 1;
370
 
    use_value_sexagesimal_format = 1;
371
 
}
372
 
 
373
 
static const OptionDef options[] = {
374
 
#include "cmdutils_common_opts.h"
375
 
    { "f", HAS_ARG, {(void*)opt_format}, "force format", "format" },
376
 
    { "unit", OPT_BOOL, {(void*)&show_value_unit}, "show unit of the displayed values" },
377
 
    { "prefix", OPT_BOOL, {(void*)&use_value_prefix}, "use SI prefixes for the displayed values" },
378
 
    { "byte_binary_prefix", OPT_BOOL, {(void*)&use_byte_value_binary_prefix},
379
 
      "use binary prefixes for byte units" },
380
 
    { "sexagesimal", OPT_BOOL,  {(void*)&use_value_sexagesimal_format},
381
 
      "use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
382
 
    { "pretty", 0, {(void*)&opt_pretty},
383
 
      "prettify the format of displayed values, make it more human readable" },
384
 
    { "show_format",  OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },
385
 
    { "show_packets", OPT_BOOL, {(void*)&do_show_packets}, "show packets info" },
386
 
    { "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },
387
 
    { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
388
 
    { NULL, },
389
 
};
390
 
 
391
 
int main(int argc, char **argv)
392
 
{
393
 
    int ret;
394
 
 
395
 
    av_register_all();
396
 
#if CONFIG_AVDEVICE
397
 
    avdevice_register_all();
398
 
#endif
399
 
 
400
 
    avformat_opts = avformat_alloc_context();
401
 
 
402
 
    show_banner();
403
 
    parse_options(argc, argv, options, opt_input_file);
404
 
 
405
 
    if (!input_filename) {
406
 
        show_usage();
407
 
        fprintf(stderr, "You have to specify one input file.\n");
408
 
        fprintf(stderr, "Use -h to get full help or, even better, run 'man ffprobe'.\n");
409
 
        exit(1);
410
 
    }
411
 
 
412
 
    ret = probe_file(input_filename);
413
 
 
414
 
    av_free(avformat_opts);
415
 
 
416
 
    return ret;
417
 
}