Commit 42261964 authored by Paul B Mahol's avatar Paul B Mahol

add silenceremove filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 1e4e760f
......@@ -13,6 +13,7 @@ version <next>:
- added codecview filter to visualize information exported by some codecs
- Matroska 3D support thorugh side data
- HTML generation using texi2html is deprecated in favor of makeinfo/texi2any
- silenceremove filter
version 2.3:
......
......@@ -343,6 +343,7 @@ Filters:
af_compand.c Paul B Mahol
af_ladspa.c Paul B Mahol
af_pan.c Nicolas George
af_silenceremove.c Paul B Mahol
avf_avectorscope.c Paul B Mahol
avf_showcqt.c Muhammad Faiz
vf_blend.c Paul B Mahol
......
......@@ -42,6 +42,7 @@
• ported lenscorrection filter from frei0r filter
• large optimizations in dctdnoiz to make it usable
• added codecview filter to visualize information exported by some codecs
• added silenceremove filter
┌────────────────────────────┐
│ libavutil │
......
......@@ -1875,6 +1875,75 @@ ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
@end example
@end itemize
@section silenceremove
Remove silence from the beginning, middle or end of the audio.
The filter accepts the following options:
@table @option
@item start_periods
This value is used to indicate if audio should be trimmed at beginning of
the audio. A value of zero indicates no silence should be trimmed from the
beginning. When specifying a non-zero value, it trims audio up until it
finds non-silence. Normally, when trimming silence from beginning of audio
the @var{start_periods} will be @code{1} but it can be increased to higher
values to trim all audio up to specific count of non-silence periods.
Default value is @code{0}.
@item start_duration
Specify the amount of time that non-silence must be detected before it stops
trimming audio. By increasing the duration, bursts of noises can be treated
as silence and trimmed off. Default value is @code{0}.
@item start_threshold
This indicates what sample value should be treated as silence. For digital
audio, a value of @code{0} may be fine but for audio recorded from analog,
you may wish to increase the value to account for background noise.
Can be specified in dB (in case "dB" is appended to the specified value)
or amplitude ratio. Default value is @code{0}.
@item stop_periods
Set the count for trimming silence from the end of audio.
To remove silence from the middle of a file, specify a @var{stop_periods}
that is negative. This value is then threated as a positive value and is
used to indicate the effect should restart processing as specified by
@var{start_periods}, making it suitable for removing periods of silence
in the middle of the audio.
Default value is @code{0}.
@item stop_duration
Specify a duration of silence that must exist before audio is not copied any
more. By specifying a higher duration, silence that is wanted can be left in
the audio.
Default value is @code{0}.
@item stop_threshold
This is the same as @option{start_threshold} but for trimming silence from
the end of audio.
Can be specified in dB (in case "dB" is appended to the specified value)
or amplitude ratio. Default value is @code{0}.
@item leave_silence
This indicate that @var{stop_duration} length of audio should be left intact
at the beginning of each period of silence.
For example, if you want to remove long pauses between words but do not want
to remove the pauses completely. Default value is @code{0}.
@end table
@subsection Examples
@itemize
@item
The following example shows how this filter can be used to start a recording
that does not contain the delay at the start which usually occurs between
pressing the record button and the start of the performance:
@example
silenceremove=1:5:0.02
@end example
@end itemize
@section treble
Boost or cut treble (upper) frequencies of the audio using a two-pole
......
......@@ -78,6 +78,7 @@ OBJS-$(CONFIG_PAN_FILTER) += af_pan.o
OBJS-$(CONFIG_REPLAYGAIN_FILTER) += af_replaygain.o
OBJS-$(CONFIG_RESAMPLE_FILTER) += af_resample.o
OBJS-$(CONFIG_SILENCEDETECT_FILTER) += af_silencedetect.o
OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o
OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o
OBJS-$(CONFIG_VOLUME_FILTER) += af_volume.o
OBJS-$(CONFIG_VOLUMEDETECT_FILTER) += af_volumedetect.o
......
This diff is collapsed.
......@@ -96,6 +96,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(REPLAYGAIN, replaygain, af);
REGISTER_FILTER(RESAMPLE, resample, af);
REGISTER_FILTER(SILENCEDETECT, silencedetect, af);
REGISTER_FILTER(SILENCEREMOVE, silenceremove, af);
REGISTER_FILTER(TREBLE, treble, af);
REGISTER_FILTER(VOLUME, volume, af);
REGISTER_FILTER(VOLUMEDETECT, volumedetect, af);
......
......@@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 5
#define LIBAVFILTER_VERSION_MINOR 0
#define LIBAVFILTER_VERSION_MICRO 103
#define LIBAVFILTER_VERSION_MINOR 1
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment