Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

audio-spectrum-generator

A CLI tool that generates MP4 videos with a rounded audio spectrum at the bottom of the frame (16:9 recommended). Input is an MP3 file; the output includes the original audio.

Requirements

  • Rust (for building)
  • ffmpeg (required at runtime; must be on your PATH)

Build

cargo build --release

Usage

# Minimal (default 1920x1080)
cargo run --release -- input.mp3 -o output.mp4

# Specify resolution
cargo run --release -- input.mp3 -o output.mp4 --width 1920 --height 1080
cargo run --release -- input.mp3 -o output.mp4 --resolution 1280x720

# Other options
cargo run --release -- input.mp3 -o output.mp4 --fps 30 --bars 128 --spectrum-height 200

# Custom colors (orange bars on dark background)
cargo run --release -- input.mp3 -o output.mp4 --bar-color ff6600 --bg-color 1a1a2e

# Background image with spectrum overlay (e.g. illustration)
cargo run --release -- input.mp3 -o output.mp4 --bg-image background.png

# Adjust spectrum position (distance from bottom) and bar height
cargo run --release -- input.mp3 -o output.mp4 --bg-image background.png --spectrum-y-from-bottom 80 --spectrum-height 120

# Limit spectrum width (centered; independent of resolution)
cargo run --release -- input.mp3 -o output.mp4 --bg-image background.png --spectrum-width 1152

Options

Option Description Default
-o, --output Output MP4 path (required)
--resolution Resolution (e.g. 1280x720) -
--width Video width (pixels) 1920
--height Video height (pixels) 1080
--fps Frame rate 30
--bars Number of spectrum bars 128
--spectrum-height Spectrum area height (pixels) 200
--spectrum-y-from-bottom Distance from bottom to the spectrum band (pixels) 0
--spectrum-width Horizontal width of the spectrum band (pixels). Centered. Omit to use full frame width -
--bar-color Bar color as hex RGB (e.g. ff6600 or #ff6600) 000000 (black)
--bg-color Background color as hex RGB (e.g. 1a1a2e or #ffffff) ffffff (white)
--bg-image Background image path (PNG/JPEG etc.); resized to video size. Overrides --bg-color when set -

16:9 aspect ratio is recommended (e.g. 1920x1080, 1280x720).

License

See the license of each dependency. symphonia is MPL-2.0; rustfft, image, hound, and clap are MIT or Apache-2.0. ffmpeg is LGPL etc.; check license notices when distributing.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages