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
653f9d84
Commit
653f9d84
authored
Jan 10, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter: add spectrumsynth filter
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
cc538e9d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
603 additions
and
1 deletion
+603
-1
Changelog
Changelog
+1
-0
configure
configure
+3
-0
filters.texi
doc/filters.texi
+63
-0
Makefile
libavfilter/Makefile
+1
-0
allfilters.c
libavfilter/allfilters.c
+1
-0
vaf_spectrumsynth.c
libavfilter/vaf_spectrumsynth.c
+533
-0
version.h
libavfilter/version.h
+1
-1
No files found.
Changelog
View file @
653f9d84
...
@@ -52,6 +52,7 @@ version <next>:
...
@@ -52,6 +52,7 @@ version <next>:
- automatic bitstream filtering
- automatic bitstream filtering
- showspectrumpic filter
- showspectrumpic filter
- libstagefright support removed
- libstagefright support removed
- spectrumsynth filter
version 2.8:
version 2.8:
...
...
configure
View file @
653f9d84
...
@@ -2903,6 +2903,8 @@ showspectrumpic_filter_deps="avcodec"
...
@@ -2903,6 +2903,8 @@ showspectrumpic_filter_deps="avcodec"
showspectrumpic_filter_select
=
"fft"
showspectrumpic_filter_select
=
"fft"
sofalizer_filter_deps
=
"netcdf avcodec"
sofalizer_filter_deps
=
"netcdf avcodec"
sofalizer_filter_select
=
"fft"
sofalizer_filter_select
=
"fft"
spectrumsynth_filter_deps
=
"avcodec"
spectrumsynth_filter_select
=
"fft"
spp_filter_deps
=
"gpl avcodec"
spp_filter_deps
=
"gpl avcodec"
spp_filter_select
=
"fft idctdsp fdctdsp me_cmp pixblockdsp"
spp_filter_select
=
"fft idctdsp fdctdsp me_cmp pixblockdsp"
stereo3d_filter_deps
=
"gpl"
stereo3d_filter_deps
=
"gpl"
...
@@ -6081,6 +6083,7 @@ enabled sofalizer_filter && prepend avfilter_deps "avcodec"
...
@@ -6081,6 +6083,7 @@ enabled sofalizer_filter && prepend avfilter_deps "avcodec"
enabled showfreqs_filter
&&
prepend avfilter_deps
"avcodec"
enabled showfreqs_filter
&&
prepend avfilter_deps
"avcodec"
enabled showspectrum_filter
&&
prepend avfilter_deps
"avcodec"
enabled showspectrum_filter
&&
prepend avfilter_deps
"avcodec"
enabled smartblur_filter
&&
prepend avfilter_deps
"swscale"
enabled smartblur_filter
&&
prepend avfilter_deps
"swscale"
enabled spectrumsynth_filter
&&
prepend avfilter_deps
"avcodec"
enabled subtitles_filter
&&
prepend avfilter_deps
"avformat avcodec"
enabled subtitles_filter
&&
prepend avfilter_deps
"avformat avcodec"
enabled uspp_filter
&&
prepend avfilter_deps
"avcodec"
enabled uspp_filter
&&
prepend avfilter_deps
"avcodec"
...
...
doc/filters.texi
View file @
653f9d84
...
@@ -14578,6 +14578,7 @@ Default is @code{combined}.
...
@@ -14578,6 +14578,7 @@ Default is @code{combined}.
@end table
@end table
@anchor{showspectrum}
@section showspectrum
@section showspectrum
Convert input audio to a video output, representing the audio frequency
Convert input audio to a video output, representing the audio frequency
...
@@ -15003,6 +15004,68 @@ ffmpeg -i audio.mp3 -filter_complex "showwavespic,colorchannelmixer=rr=66/255:gg
...
@@ -15003,6 +15004,68 @@ ffmpeg -i audio.mp3 -filter_complex "showwavespic,colorchannelmixer=rr=66/255:gg
@end example
@end example
@end itemize
@end itemize
@section spectrumsynth
Sythesize audio from 2 input video spectrums, first input stream represents
magnitude across time and second represents phase across time.
The filter will transform from frequency domain as displayed in videos back
to time domain as presented in audio output.
This filter is primarly created for reversing processed @ref{showspectrum}
filter outputs, but can synthesize sound from other spectrograms too.
But in such case results are going to be poor if the phase data is not
available, because in such cases phase data need to be recreated, usually
its just recreated from random noise.
For best results use gray only output (@code{channel} color mode in
@ref{showspectrum} filter) and @code{log} scale for magnitude video and
@code{lin} scale for phase video. To produce phase, for 2nd video, use
@code{data} option. Inputs videos should generally use @code{fullframe}
slide mode as that saves resources needed for decoding video.
The filter accepts the following options:
@table @option
@item sample_rate
Specify sample rate of output audio, the sample rate of audio from which
spectrum was generated may differ.
@item channels
Set number of channels represented in input video spectrums.
@item scale
Set scale which was used when generating magnitude input spectrum.
Can be @code{lin} or @code{log}. Default is @code{log}.
@item slide
Set slide which was used when generating inputs spectrums.
Can be @code{replace}, @code{scroll}, @code{fullframe} or @code{rscroll}.
Default is @code{fullframe}.
@item win_func
Set window function used for resynthesis.
@item overlap
Set window overlap. In range @code{[0, 1]}. Default is @code{1},
which means optimal overlap for selected window function will be picked.
@item orientation
Set orientation of input videos. Can be @code{vertical} or @code{horizontal}.
Default is @code{vertical}.
@end table
@subsection Examples
@itemize
@item
First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
then resynthesize videos back to audio with spectrumsynth:
@example
ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase -an -c:v rawvideo phase.nut
ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_fun=hann:overlap=0.875:slide=fullframe output.flac
@end example
@end itemize
@section split, asplit
@section split, asplit
Split input into several identical outputs.
Split input into several identical outputs.
...
...
libavfilter/Makefile
View file @
653f9d84
...
@@ -290,6 +290,7 @@ OBJS-$(CONFIG_SHOWSPECTRUMPIC_FILTER) += avf_showspectrum.o window_func.o
...
@@ -290,6 +290,7 @@ OBJS-$(CONFIG_SHOWSPECTRUMPIC_FILTER) += avf_showspectrum.o window_func.o
OBJS-$(CONFIG_SHOWVOLUME_FILTER)
+=
avf_showvolume.o
OBJS-$(CONFIG_SHOWVOLUME_FILTER)
+=
avf_showvolume.o
OBJS-$(CONFIG_SHOWWAVES_FILTER)
+=
avf_showwaves.o
OBJS-$(CONFIG_SHOWWAVES_FILTER)
+=
avf_showwaves.o
OBJS-$(CONFIG_SHOWWAVESPIC_FILTER)
+=
avf_showwaves.o
OBJS-$(CONFIG_SHOWWAVESPIC_FILTER)
+=
avf_showwaves.o
OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER)
+=
vaf_spectrumsynth.o
window_func.o
# multimedia sources
# multimedia sources
OBJS-$(CONFIG_AMOVIE_FILTER)
+=
src_movie.o
OBJS-$(CONFIG_AMOVIE_FILTER)
+=
src_movie.o
...
...
libavfilter/allfilters.c
View file @
653f9d84
...
@@ -310,6 +310,7 @@ void avfilter_register_all(void)
...
@@ -310,6 +310,7 @@ void avfilter_register_all(void)
REGISTER_FILTER
(
SHOWVOLUME
,
showvolume
,
avf
);
REGISTER_FILTER
(
SHOWVOLUME
,
showvolume
,
avf
);
REGISTER_FILTER
(
SHOWWAVES
,
showwaves
,
avf
);
REGISTER_FILTER
(
SHOWWAVES
,
showwaves
,
avf
);
REGISTER_FILTER
(
SHOWWAVESPIC
,
showwavespic
,
avf
);
REGISTER_FILTER
(
SHOWWAVESPIC
,
showwavespic
,
avf
);
REGISTER_FILTER
(
SPECTRUMSYNTH
,
spectrumsynth
,
vaf
);
/* multimedia sources */
/* multimedia sources */
REGISTER_FILTER
(
AMOVIE
,
amovie
,
avsrc
);
REGISTER_FILTER
(
AMOVIE
,
amovie
,
avsrc
);
...
...
libavfilter/vaf_spectrumsynth.c
0 → 100644
View file @
653f9d84
This diff is collapsed.
Click to expand it.
libavfilter/version.h
View file @
653f9d84
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 2
3
#define LIBAVFILTER_VERSION_MINOR 2
4
#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, \
...
...
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