Spectrogram

From Avisynth wiki
Revision as of 02:54, 2 July 2015 by Reel.Deal (Talk | contribs)

Jump to: navigation, search
Abstract
Author innocenat
Version r4
Download Spectrogram.7z
Category Audio filters
License  ?
Discussion


Contents

Description

Linear spectrogram for AviSynth 2.6.

Requirements

  • AviSynth 2.6.0 or greater
  • Supported color formats: all colorspaces are supported but output clip will always be Y8.


*** 32-bit libfftw3f-3.dll needs to be in the search path (C:\Windows\SysWOW64 64-bit OS or C:\windows\system32 32-bit OS)
*** Spectrogram will not run or load without it.


Syntax and Parameters

Spectrogram (clip, int, int)


clip   =
Input clip; audio must be float so use ConvertAudioToFloat() if needed. If the input clip contains both audio and video, video will be discarded.


int   =
Width of the spectrogram.


int   =
Height of the spectrogram. For best performance it's recommended that the height is a value of 2^n.


  • Note: all parameters are unnamed and do not have a default so they must be specified.


Examples

The following script creates a video from just an audio file. The video length is automatically adjusted based on the duration of the audio and the desired frame rate. The output clip will be Y8, 512x256, and 59.94 FPS, of course this is all adjustable.

WavSource("sample.wav") # for other types of files you can use FFAudioSource or LWLibavAudioSource or any other suitable audio source filter
audio = last
fps = 60000 den = 1001 length = Round((AudioDuration(audio)*fps)/den) BlankClip(length, width=512, height=256, fps=fps, fps_denominator=den, pixel_type="Y8") AudioDub(last, audio) ConvertAudioToFloat() # if needed
Spectrogram(512,256)
Spectrogram.png


Changelog

Version      Date            Changes
r4 2015/03/11 - fix a bug; the cache was actually completely broken r3 2015/03/10 - fix a bug that caused a crash - it's now ~40-50% faster; more profiling and fixing a hot spot r2 2015/03/09 - implement cache; increase speed by profiling r1 2015/03/08 - initial release




Back to External Filters

Personal tools