Skip to content

Latest commit

 

History

History
115 lines (69 loc) · 2.66 KB

File metadata and controls

115 lines (69 loc) · 2.66 KB

🎵 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.