Stefano Sabatini
fa6cb2fdff
ffprobe: add multiple_sections field to WriterContext
...
Move the field "multiple_entries" from the JSON writer private context to
WriterContext, and rename it "multiple_sections".
This allows to factorize the code with the pending INI format patch.
13 years ago
Stefano Sabatini
c365cdf202
ffprobe: add support to '\b' and '\f' escaping in c_escape_str()
13 years ago
Stefano Sabatini
6994b552a6
ffprobe: make c_escape_str() documentation terser
...
Avoid to specify implementation details, better to check the code for
that.
13 years ago
Clément Bœsch
19c1bf1525
ffprobe: reduce the number of AVBPrint resets.
13 years ago
Christian Schmidt
f7d5272456
ffprobe: display the codec profile in show_stream()
...
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
13 years ago
Stefano Sabatini
6374ee72df
ffprobe: remove ad-hoc behavior when nb_fmt_entries_to_show is 1
...
The special-case behavior may complicate parsing when the
-show_format_entry option is used programmatically in a script.
The option default=nk=1 achieves the same purpose, if the objective is to
skip printing the single field key.
13 years ago
Stefano Sabatini
e109e392ba
ffprobe: remove unused variable i in probe_file()
...
Fix warning:
ffprobe.c: In function ‘probe_file’:
ffprobe.c:1576:14: warning: unused variable ‘i’ [-Wunused-variable]
13 years ago
Michael Niedermayer
c457a29ece
ffprobe: add default_writer priv_size.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Clément Bœsch
b545b947dd
ffprobe: replace fast_asprintf() with bprint utils.
...
Also remove the unused print_fmt_opt() in the process.
13 years ago
Stefano Sabatini
3946187d60
ffprobe: add "nokey" option to default writer
...
Help simplifying parsing in certain cases.
13 years ago
Stefano Sabatini
f48f03a400
ffprobe: add "noprint_wrappers" option to default writer
...
The option is useful for simplifying parsing.
Also use the new option in fate, in order to fix the regression
introduced by the previous commit.
13 years ago
Stefano Sabatini
6cd06bd22c
ffprobe: simplify/fix logic for the -show_format_entry option
...
Do not skip chapter header/footer printing, which breaks the parsing for
most writers.
13 years ago
Stefano Sabatini
a0fd322195
ffprobe: remove unused print_format_entry() function
...
The function was introduced in 653d117c
, but is not required.
13 years ago
Nicolas George
b27383e453
ffprobe: do not try to decode empty packets.
...
Fixes sporadic decode failures and trac ticket #997 .
13 years ago
Stefano Sabatini
f0bb1a599c
ffprobe: use avbprint API
...
Simplify, increase robustness.
13 years ago
Matthieu Bouron
278d6ab900
ffprobe: report bit rate in stream description
...
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
13 years ago
Clément Bœsch
8688e6acba
ffprobe: fix crash if the file can't be opened.
13 years ago
Matthieu Bouron
29b9aee49f
ffprobe: add count_frames and count_packets options
...
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
13 years ago
Stefano Sabatini
1ca0812d90
ffprobe: fix typo in ESCAPE_CHECK_SIZE
13 years ago
Clément Bœsch
dc386a5e3c
ffprobe: use av_mpegtc_to_timecode_string().
13 years ago
Stefano Sabatini
23934e5f41
ffprobe: increase precision for the shown float values
13 years ago
Stefano Sabatini
4601ad769d
ffprobe: fix value_string() prefix printing for values with negative logarithm
...
The index for the binary_unit_prefixes array is expected to be positive,
so avoid to use negative indexes for accessing it.
13 years ago
Stefano Sabatini
eef4b70450
ffprobe: reindent after previous commit
13 years ago
Stefano Sabatini
58b10b4c7e
ffprobe: factorize common code in value_string()
13 years ago
Stefano Sabatini
140a9afcf2
ffprobe: add more safe casts in value_string()
...
Second attempt at fixing ticket #921 .
13 years ago
Stefano Sabatini
2c8d37c2fb
ffprobe: use safer type for index variable in value_string()
...
There is no guarantee that the casted double which is assigned to the
variable will be contained in an int (also if it is almost sure for most
non-alien architectures).
13 years ago
Stefano Sabatini
54661219c1
ffprobe: fix printing of unit values which cannot be contained in an int
...
Use long long int to contain such values instead of an int, which is
required to contain at least 64 bits, so it is guaranteed to contain also
int64_t values, which are used by some fields.
In particular, should fix trac ticket #921 .
13 years ago
Stefano Sabatini
bb4c18881a
ffprobe: reindent after previous commit
13 years ago
Stefano Sabatini
b25c239c7a
ffprobe: add support to audio frame information printing
13 years ago
Stefano Sabatini
58e1de724d
ffprobe: set AV_LOG_SKIP_REPEATED log flag
...
Consistent with ffmpeg and ffplay.
13 years ago
Stefano Sabatini
4fd1e2e432
ffprobe: fix leak in show_packets()
...
Call av_free_packets() at each demuxing loop iteration, not only when
decoding.
X-ColaCount: +10l
13 years ago
Stefano Sabatini
7328c2fc21
ffprobe: replace av_destruct_packet() with av_free_packet()
...
av_destruct_packet() always frees the packet data even when the demuxer
is going to re-use it, thus causing crashes when decoding audio
frames (as implemented in a pending patch).
av_free_packet() is used instead, as it allows each demuxer to set the
right packet data releasing mechanism through the pkt->destruct callback.
13 years ago
Stefano Sabatini
0cc8864687
ffprobe: use av_toupper() in upcase_string()
13 years ago
Stefano Sabatini
93d49cba7f
ffprobe: add compact option to JSON writer
13 years ago
Stefano Sabatini
5226be0dd5
ffprobe: add -show_program_version and -show_library_versions options
13 years ago
Stefano Sabatini
d3e435164b
ffprobe: make upcase_string() ignore non-ASCII characters
...
This is required as some section names may contain non-ASCII characters
(e.g. '_').
13 years ago
Stefano Sabatini
3b1355bb93
ffprobe: change formatting logic in the JSON writer
...
Print a "\n" at the end of each section, also print the section name in
the section print function, print the chapter name only in case the
chapter contains multiple entries.
Increase textual output readability - different sections can be
distinguished more easily.
13 years ago
Stefano Sabatini
48f37b1d21
ffprobe: implement generic reindent logic in the JSON writer
...
Clarify/generalize indent logic.
13 years ago
Stefano Sabatini
5ccdb907c1
ffprobe: use more meaningful names for writer chapter/section header/footer function
...
The passed argument is supposed to be the chapter/section name, rather
than the header/footer. Less confusing.
13 years ago
Stefano Sabatini
ec624d7c5c
ffprobe: use "%*" printf syntax in XML_INDENT() in place of a loop
...
Possibly faster/cleaner.
Suggested-By: Clément Bœsch <ubitux@gmail.com>
13 years ago
Stefano Sabatini
9997d41672
ffprobe: add support to video frame information printing
...
Add -show_frames option to ffprobe.
Partially based on the work of Thomas Kuehnel <kuehnelth@googlemail.com>
for SOCIS 2011.
The wicked idea of creating a special "packets_and_frames" container for
structured formats (JSON and XML) comes from Clément.
13 years ago
Stefano Sabatini
9ecccd6e5a
ffprobe: move header and trailer print from probe_file() to main()
...
Simplify printing from the main() context, in case probe_file() is not
called, as required by the pending -show_version option.
13 years ago
Stefano Sabatini
fa7d1c39fd
ffprobe: move writer context registration and initialization in main()
...
Simplify pending changes, as the writer context will be used in the
main() routine.
13 years ago
Stefano Sabatini
ceef1ee767
cmdutils: make show_usage() use av_log()
...
Avoid printing on stdout when show_usage is used in an error message.
13 years ago
Stefano Sabatini
c5f4abf698
ffprobe: exit in case generic options are incompatible with strict XML output
13 years ago
Stefano Sabatini
49c207b820
ffprobe: fix NULL pointer dereference in writer_close()
...
Fix crash.
13 years ago
Stefano Sabatini
d6da16dca5
ffprobe: add support to option -show_error
13 years ago
Stefano Sabatini
55ed19bf3b
ffprobe: remove unused variable in show_format()
13 years ago
Stefano Sabatini
4c5c0609c1
ffprobe: reindent after the last commit
13 years ago
Stefano Sabatini
90347dabc8
ffprobe: change order of operations in probe_file()
...
This is required by a pending patch, also fixes a memleak due to the
writer context not being closed in case of open_input_file() failure.
13 years ago