Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
e30a0b1b
Commit
e30a0b1b
authored
Aug 18, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add ashowinfo filter
Useful for debugging.
parent
9d84a17b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
153 additions
and
1 deletion
+153
-1
Changelog
Changelog
+1
-0
filters.texi
doc/filters.texi
+50
-0
Makefile
libavfilter/Makefile
+1
-0
af_ashowinfo.c
libavfilter/af_ashowinfo.c
+99
-0
allfilters.c
libavfilter/allfilters.c
+1
-0
avfilter.h
libavfilter/avfilter.h
+1
-1
No files found.
Changelog
View file @
e30a0b1b
...
@@ -44,6 +44,7 @@ easier to use. The changes are:
...
@@ -44,6 +44,7 @@ easier to use. The changes are:
* -intra option was removed, it's equivalent to -g 0.
* -intra option was removed, it's equivalent to -g 0.
- XMV demuxer
- XMV demuxer
- LOAS demuxer
- LOAS demuxer
- ashowinfo filter added
version 0.8:
version 0.8:
...
...
doc/filters.texi
View file @
e30a0b1b
...
@@ -137,6 +137,56 @@ For example, to resample the input audio to 44100Hz:
...
@@ -137,6 +137,56 @@ For example, to resample the input audio to 44100Hz:
aresample=44100
aresample=44100
@end example
@end example
@section ashowinfo
Show a line containing various information for each input audio frame.
The input audio is not modified.
The shown line contains a sequence of key/value pairs of the form
@var{key}:@var{value}.
A description of each shown parameter follows:
@table @option
@item n
sequential number of the input frame, starting from 0
@item pts
presentation TimeStamp of the input frame, expressed as a number of
time base units. The time base unit depends on the filter input pad, and
is usually 1/@var{sample_rate}.
@item pts_time
presentation TimeStamp of the input frame, expressed as a number of
seconds
@item pos
position of the frame in the input stream, -1 if this information in
unavailable and/or meanigless (for example in case of synthetic audio)
@item fmt
sample format name
@item chlayout
channel layout description
@item nb_samples
number of samples (per each channel) contained in the filtered frame
@item rate
sample rate for the audio frame
@item planar
if the packing format is planar, 0 if packed
@item checksum
Adler-32 checksum of all the planes of the input frame
@item plane_checksum
Adler-32 checksum for each input frame plane, expressed in the form
"[@var{c0} @var{c1} @var{c2} @var{c3} @var{c4} @var{c5} @var{c6} @var{c7}]"
@end table
@c man end AUDIO FILTERS
@c man end AUDIO FILTERS
@chapter Audio Sources
@chapter Audio Sources
...
...
libavfilter/Makefile
View file @
e30a0b1b
...
@@ -22,6 +22,7 @@ OBJS-$(CONFIG_AVCODEC) += avcodec.o
...
@@ -22,6 +22,7 @@ OBJS-$(CONFIG_AVCODEC) += avcodec.o
OBJS-$(CONFIG_AFORMAT_FILTER)
+=
af_aformat.o
OBJS-$(CONFIG_AFORMAT_FILTER)
+=
af_aformat.o
OBJS-$(CONFIG_ANULL_FILTER)
+=
af_anull.o
OBJS-$(CONFIG_ANULL_FILTER)
+=
af_anull.o
OBJS-$(CONFIG_ARESAMPLE_FILTER)
+=
af_aresample.o
OBJS-$(CONFIG_ARESAMPLE_FILTER)
+=
af_aresample.o
OBJS-$(CONFIG_ASHOWINFO_FILTER)
+=
af_ashowinfo.o
OBJS-$(CONFIG_ANULLSRC_FILTER)
+=
asrc_anullsrc.o
OBJS-$(CONFIG_ANULLSRC_FILTER)
+=
asrc_anullsrc.o
...
...
libavfilter/af_ashowinfo.c
0 → 100644
View file @
e30a0b1b
/*
* Copyright (c) 2011 Stefano Sabatini
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* filter fow showing textual audio frame information
*/
#include "libavutil/adler32.h"
#include "libavutil/audioconvert.h"
#include "avfilter.h"
typedef
struct
{
unsigned
int
frame
;
}
ShowInfoContext
;
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
,
void
*
opaque
)
{
ShowInfoContext
*
showinfo
=
ctx
->
priv
;
showinfo
->
frame
=
0
;
return
0
;
}
static
void
filter_samples
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
samplesref
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
ShowInfoContext
*
showinfo
=
ctx
->
priv
;
uint32_t
plane_checksum
[
8
]
=
{
0
},
checksum
=
0
;
char
chlayout_str
[
128
];
int
plane
;
for
(
plane
=
0
;
samplesref
->
data
[
plane
]
&&
plane
<
8
;
plane
++
)
{
uint8_t
*
data
=
samplesref
->
data
[
plane
];
int
linesize
=
samplesref
->
linesize
[
plane
];
plane_checksum
[
plane
]
=
av_adler32_update
(
plane_checksum
[
plane
],
data
,
linesize
);
checksum
=
av_adler32_update
(
checksum
,
data
,
linesize
);
}
av_get_channel_layout_string
(
chlayout_str
,
sizeof
(
chlayout_str
),
-
1
,
samplesref
->
audio
->
channel_layout
);
av_log
(
ctx
,
AV_LOG_INFO
,
"n:%d pts:%"
PRId64
" pts_time:%f pos:%"
PRId64
" "
"fmt:%s chlayout:%s nb_samples:%d rate:%d planar:%d "
"checksum:%u plane_checksum[%u %u %u %u %u %u %u %u]
\n
"
,
showinfo
->
frame
,
samplesref
->
pts
,
samplesref
->
pts
*
av_q2d
(
inlink
->
time_base
),
samplesref
->
pos
,
av_get_sample_fmt_name
(
samplesref
->
format
),
chlayout_str
,
samplesref
->
audio
->
nb_samples
,
samplesref
->
audio
->
sample_rate
,
samplesref
->
audio
->
planar
,
checksum
,
plane_checksum
[
0
],
plane_checksum
[
1
],
plane_checksum
[
2
],
plane_checksum
[
3
],
plane_checksum
[
4
],
plane_checksum
[
5
],
plane_checksum
[
6
],
plane_checksum
[
7
]);
showinfo
->
frame
++
;
avfilter_filter_samples
(
inlink
->
dst
->
outputs
[
0
],
samplesref
);
}
AVFilter
avfilter_af_ashowinfo
=
{
.
name
=
"ashowinfo"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Show textual information for each audio frame."
),
.
priv_size
=
sizeof
(
ShowInfoContext
),
.
init
=
init
,
.
inputs
=
(
AVFilterPad
[])
{{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
get_audio_buffer
=
avfilter_null_get_audio_buffer
,
.
filter_samples
=
filter_samples
,
.
min_perms
=
AV_PERM_READ
,
},
{
.
name
=
NULL
}},
.
outputs
=
(
AVFilterPad
[])
{{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
},
{
.
name
=
NULL
}},
};
libavfilter/allfilters.c
View file @
e30a0b1b
...
@@ -37,6 +37,7 @@ void avfilter_register_all(void)
...
@@ -37,6 +37,7 @@ void avfilter_register_all(void)
REGISTER_FILTER
(
AFORMAT
,
aformat
,
af
);
REGISTER_FILTER
(
AFORMAT
,
aformat
,
af
);
REGISTER_FILTER
(
ANULL
,
anull
,
af
);
REGISTER_FILTER
(
ANULL
,
anull
,
af
);
REGISTER_FILTER
(
ARESAMPLE
,
aresample
,
af
);
REGISTER_FILTER
(
ARESAMPLE
,
aresample
,
af
);
REGISTER_FILTER
(
ASHOWINFO
,
ashowinfo
,
af
);
REGISTER_FILTER
(
ANULLSRC
,
anullsrc
,
asrc
);
REGISTER_FILTER
(
ANULLSRC
,
anullsrc
,
asrc
);
...
...
libavfilter/avfilter.h
View file @
e30a0b1b
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#include "libavutil/rational.h"
#include "libavutil/rational.h"
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 3
2
#define LIBAVFILTER_VERSION_MINOR 3
3
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...
...
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