[FFmpeg-devel] [WIP] lavfi: add showaudio filter

Stefano Sabatini stefasab at gmail.com
Tue Dec 27 19:20:04 CET 2011


On date Tuesday 2011-12-27 14:58:03 +0100, Stefano Sabatini encoded:
> On date Monday 2011-12-26 00:14:39 +0100, Stefano Sabatini encoded:
> > Subject: [PATCH] lavfi: add showaudio filter
> > 
> > ---
> >  libavfilter/Makefile        |    3 +-
> >  libavfilter/allfilters.c    |    3 +
> >  libavfilter/avf_showaudio.c |  174 +++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 179 insertions(+), 1 deletions(-)
> >  create mode 100644 libavfilter/avf_showaudio.
> 
> Main problem is now to understand how to visualize N samples in a
> packet using only w columns.
> 
> One possibility: w defines the number of samples to visualize, this
> means that we have to visualize samplerate/w frames, i.e.:
> rate = samplerate/w
> 
> For example with w=640, samplerate=22100:
> rate = 22100/640 ~= 35
> 
> Alternatively I could fix the rate, and scale the image accordingly by
> imposing:
> samples_to_show = samplerate / rate
> 
> For example with rate = 10, samplerate = 22100
> samples_to_show = 22100 / 10 = 2210
> 
> and I could use lsws to scale such an image to make it suit w.

Updated implementing the first option.
Still missing:
* multiple channels support, every channel may be displayed on a
  separate area a-la ffplay or on the same area, possibly letting the
  user choose the color for each channel wave.

> RDFT should be easier to add (same for some power/volume
> visualization).

Due to different caching logic this could be a separate filter
(e.g. showaudio -> showwaves, showrdft?).

> For more complex audio visualizations we may consider to write a
> MilkDrop/ProjectM wrapper.

Started to look at this, it's quite complex due to the use of C++ and
to the opaque API (I can't still guess how to just get the video data
out of the SDL/GL mess). Hints are welcome if you have experience with
it (IIRC at least VLC has/planned to have a projectm wrapper, don't
know how it ended).
-- 
FFmpeg = Faithless & Faithful Most Plastic Egregious Gargoyle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lavfi-add-showaudio-filter.patch
Type: text/x-diff
Size: 8514 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111227/5055dbc9/attachment.bin>


More information about the ffmpeg-devel mailing list