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

Stefano Sabatini stefasab at gmail.com
Tue Dec 27 14:58:03 CET 2011


On date Monday 2011-12-26 00:14:39 +0100, Stefano Sabatini encoded:
> Hi,
> 
> in attachment an incomplete (but basically working) trasmedia A->V
> filter.
> 
> Merry XMas.
> -- 
> FFmpeg = Faithless & Frenzy Merry Perennial Extroverse Gangster

> From 6eaf17db1b6ad105e0f273434bdbd3dc59026e81 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Sun, 25 Dec 2011 17:37:53 +0100
> 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.c

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.

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

For more complex audio visualizations we may consider to write a
MilkDrop/ProjectM wrapper.
-- 
FFmpeg = Formidable & Fierce Mastodontic Pitiful Enlightened Gem


More information about the ffmpeg-devel mailing list