Commit 4a2836ea authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add acrossfade filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 0b6f092e
...@@ -26,6 +26,7 @@ version <next>: ...@@ -26,6 +26,7 @@ version <next>:
- AAC fixed-point decoding - AAC fixed-point decoding
- sidechaincompress audio filter - sidechaincompress audio filter
- bitstream filter for converting HEVC from MP4 to Annex B - bitstream filter for converting HEVC from MP4 to Annex B
- acrossfade audio filter
version 2.7: version 2.7:
......
...@@ -318,6 +318,54 @@ build. ...@@ -318,6 +318,54 @@ build.
Below is a description of the currently available audio filters. Below is a description of the currently available audio filters.
@section acrossfade
Apply cross fade from one input audio stream to another input audio stream.
The cross fade is applied for specified duration near the end of first stream.
The filter accepts the following options:
@table @option
@item nb_samples, ns
Specify the number of samples for which the cross fade effect has to last.
At the end of the cross fade effect the first input audio will be completely
silent. Default is 44100.
@item duration, d
Specify the duration of the cross fade effect. See
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
for the accepted syntax.
By default the duration is determined by @var{nb_samples}.
If set this option is used instead of @var{nb_samples}.
@item overlap, o
Should first stream end overlap with second stream start. Default is enabled.
@item curve1
Set curve for cross fade transition for first stream.
@item curve2
Set curve for cross fade transition for second stream.
For description of available curve types see @ref{afade} filter description.
@end table
@subsection Examples
@itemize
@item
Cross fade from one input to another:
@example
ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
@end example
@item
Cross fade from one input to another but without overlapping:
@example
ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
@end example
@end itemize
@section adelay @section adelay
Delay one or more audio channels. Delay one or more audio channels.
...@@ -469,6 +517,7 @@ aeval=val(0)|-val(1) ...@@ -469,6 +517,7 @@ aeval=val(0)|-val(1)
@end example @end example
@end itemize @end itemize
@anchor{afade}
@section afade @section afade
Apply fade-in/out effect to input audio. Apply fade-in/out effect to input audio.
......
...@@ -29,6 +29,7 @@ OBJS = allfilters.o \ ...@@ -29,6 +29,7 @@ OBJS = allfilters.o \
OBJS-$(CONFIG_AVCODEC) += avcodec.o OBJS-$(CONFIG_AVCODEC) += avcodec.o
OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o
OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o
OBJS-$(CONFIG_AEVAL_FILTER) += aeval.o OBJS-$(CONFIG_AEVAL_FILTER) += aeval.o
......
This diff is collapsed.
...@@ -45,6 +45,7 @@ void avfilter_register_all(void) ...@@ -45,6 +45,7 @@ void avfilter_register_all(void)
return; return;
initialized = 1; initialized = 1;
REGISTER_FILTER(ACROSSFADE, acrossfade, af);
REGISTER_FILTER(ADELAY, adelay, af); REGISTER_FILTER(ADELAY, adelay, af);
REGISTER_FILTER(AECHO, aecho, af); REGISTER_FILTER(AECHO, aecho, af);
REGISTER_FILTER(AEVAL, aeval, af); REGISTER_FILTER(AEVAL, aeval, af);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 5 #define LIBAVFILTER_VERSION_MAJOR 5
#define LIBAVFILTER_VERSION_MINOR 29 #define LIBAVFILTER_VERSION_MINOR 30
#define LIBAVFILTER_VERSION_MICRO 100 #define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
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