Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9ae3e455
Commit
9ae3e455
authored
Apr 07, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffprobe: add -show_data option.
parent
2243f0d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
Changelog
Changelog
+1
-0
ffprobe.texi
doc/ffprobe.texi
+7
-0
ffprobe.c
ffprobe.c
+35
-0
No files found.
Changelog
View file @
9ae3e455
...
...
@@ -8,6 +8,7 @@ version next:
- channelsplit audio filter
- setnsamples audio filter
- atempo filter
- ffprobe -show_data option
version 0.11:
...
...
doc/ffprobe.texi
View file @
9ae3e455
...
...
@@ -94,6 +94,13 @@ For example for printing the output in JSON format, specify:
For more details on the available output printing formats, see the
Writers section below.
@item -show
_
data
Show payload data, as an hexadecimal and ASCII dump. Coupled with
@option
{
-show
_
packets
}
, it will dump the packets' data. Coupled with
@option
{
-show
_
streams
}
, it will dump the codec extradata.
The dump is printed as the "data" field. It may contain newlines.
@item -show
_
error
Show information about the error found when trying to probe the input.
...
...
ffprobe.c
View file @
9ae3e455
...
...
@@ -53,6 +53,7 @@ static int do_show_frames = 0;
static
AVDictionary
*
fmt_entries_to_show
=
NULL
;
static
int
do_show_packets
=
0
;
static
int
do_show_streams
=
0
;
static
int
do_show_data
=
0
;
static
int
do_show_program_version
=
0
;
static
int
do_show_library_versions
=
0
;
...
...
@@ -361,6 +362,34 @@ static inline void writer_show_tags(WriterContext *wctx, AVDictionary *dict)
wctx
->
writer
->
show_tags
(
wctx
,
dict
);
}
static
void
writer_print_data
(
WriterContext
*
wctx
,
const
char
*
name
,
uint8_t
*
data
,
int
size
)
{
AVBPrint
bp
;
int
offset
=
0
,
l
,
i
;
av_bprint_init
(
&
bp
,
0
,
AV_BPRINT_SIZE_UNLIMITED
);
av_bprintf
(
&
bp
,
"
\n
"
);
while
(
size
)
{
av_bprintf
(
&
bp
,
"%08x: "
,
offset
);
l
=
FFMIN
(
size
,
16
);
for
(
i
=
0
;
i
<
l
;
i
++
)
{
av_bprintf
(
&
bp
,
"%02x"
,
data
[
i
]);
if
(
i
&
1
)
av_bprintf
(
&
bp
,
" "
);
}
av_bprint_chars
(
&
bp
,
' '
,
41
-
2
*
i
-
i
/
2
);
for
(
i
=
0
;
i
<
l
;
i
++
)
av_bprint_chars
(
&
bp
,
data
[
i
]
-
32U
<
95
?
data
[
i
]
:
'.'
,
1
);
av_bprintf
(
&
bp
,
"
\n
"
);
offset
+=
l
;
data
+=
l
;
size
-=
l
;
}
writer_print_string
(
wctx
,
name
,
bp
.
str
,
0
);
av_bprint_finalize
(
&
bp
,
NULL
);
}
#define MAX_REGISTERED_WRITERS_NB 64
static
const
Writer
*
registered_writers
[
MAX_REGISTERED_WRITERS_NB
+
1
];
...
...
@@ -1556,6 +1585,8 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk
if
(
pkt
->
pos
!=
-
1
)
print_fmt
(
"pos"
,
"%"
PRId64
,
pkt
->
pos
);
else
print_str_opt
(
"pos"
,
"N/A"
);
print_fmt
(
"flags"
,
"%c"
,
pkt
->
flags
&
AV_PKT_FLAG_KEY
?
'K'
:
'_'
);
if
(
do_show_data
)
writer_print_data
(
w
,
"data"
,
pkt
->
data
,
pkt
->
size
);
print_section_footer
(
"packet"
);
av_bprint_finalize
(
&
pbuf
,
NULL
);
...
...
@@ -1796,6 +1827,9 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
if
(
nb_streams_packets
[
stream_idx
])
print_fmt
(
"nb_read_packets"
,
"%"
PRIu64
,
nb_streams_packets
[
stream_idx
]);
else
print_str_opt
(
"nb_read_packets"
,
"N/A"
);
show_tags
(
stream
->
metadata
);
if
(
do_show_data
)
writer_print_data
(
w
,
"extradata"
,
dec_ctx
->
extradata
,
dec_ctx
->
extradata_size
);
print_section_footer
(
"stream"
);
av_bprint_finalize
(
&
pbuf
,
NULL
);
...
...
@@ -2079,6 +2113,7 @@ static const OptionDef options[] = {
{
"print_format"
,
OPT_STRING
|
HAS_ARG
,
{(
void
*
)
&
print_format
},
"set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)"
,
"format"
},
{
"of"
,
OPT_STRING
|
HAS_ARG
,
{(
void
*
)
&
print_format
},
"alias for -print_format"
,
"format"
},
{
"show_data"
,
OPT_BOOL
,
{(
void
*
)
&
do_show_data
},
"show packets data"
},
{
"show_error"
,
OPT_BOOL
,
{(
void
*
)
&
do_show_error
}
,
"show probing error"
},
{
"show_format"
,
OPT_BOOL
,
{(
void
*
)
&
do_show_format
}
,
"show format/container info"
},
{
"show_frames"
,
OPT_BOOL
,
{(
void
*
)
&
do_show_frames
}
,
"show frames info"
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment