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.
- π΅ 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)
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.