Skip to content

actionoise/python-audio-reactive-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎡 Python Audio Reactive Visualizer

An audio-reactive visual generator built with Python, OpenCV and MoviePy.

This tool transforms a static image (or the first frame of a video) into a dynamic, music-driven visual experience.
Designed for ambient, artistic and cinematic content.


✨ Features

  • 🎡 Audio spectrum analysis (low / mid / high bands)
  • πŸ” Reactive zoom based on audio energy (RMS)
  • 🌊 Liquid warp effect driven by low frequencies
  • πŸ’‘ Glow effect driven by high frequencies
  • πŸŽ₯ Cinematic pan movement
  • πŸŒ‘ Subtle vignette for depth
  • 🎬 H.264 video export (MP4)

🎬 Example

python Respira.py --image artwork.png --audio music.mp3 --out output.mp4

------------------------------------------------------------------------------------------

| Parameter      | Description                         |
| -------------- | ----------------------------------- |
| `--image`      | Input image (jpg/png)               |
| `--video`      | Input video (first frame extracted) |
| `--audio`      | Audio file (mp3/wav/m4a)            |
| `--out`        | Output file name                    |
| `--w`          | Output width (default: 1920)        |
| `--h`          | Output height (default: 1080)       |
| `--fps`        | Frames per second (default: 30)     |
| `--base_zoom`  | Base zoom level                     |
| `--zoom_range` | Zoom reaction strength              |
| `--pan`        | Camera pan intensity                |
| `--warp`       | Liquid distortion intensity         |
| `--glow`       | Glow intensity                      |

-------------------------------------------------------------------------------------------------------------------

🧠 How It Works

The script performs:

Audio loading and spectral analysis using librosa

Frequency band separation:

Low frequencies β†’ warp

Mid frequencies β†’ pan movement

High frequencies β†’ glow

RMS energy β†’ zoom

Frame-by-frame image processing using OpenCV

Final encoding with MoviePy (H.264 + AAC)

The motion is smoothed for an ambient and cinematic feel.

πŸ“¦ Installation

Install dependencies:

pip install numpy opencv-python librosa moviepy

Or using requirements:

pip install -r requirements.txt


πŸš€ Performance Notes

Rendering time depends on:

Duration of the audio

Resolution

FPS

CPU performance

For faster previews:

--w 1280 --h 720 --fps 24
🎨 Use Cases

Ambient YouTube visuals

Digital art presentations

Music visual backgrounds

Experimental video art

Creative coding exploration

πŸ“œ License

This project is open-source.
Feel free to modify and expand.

πŸ‘€ Author

Actionoise

Creative developer exploring the intersection between art and technology.

About

Audio reactive visual generator using Python, OpenCV and MoviePy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages