A tool to automatically create music videos where the cuts are synchronized to the music's beat. Upload an audio file and a collection of video clips, and the application will generate a dynamic, rhythmic video.
- Automatic Beat Detection: Analyzes the audio file to identify a regular, bass-focused beat, which serves as the foundation for the video cuts.
- Video Clip Synchronization: Randomly selects and clips segments from your provided videos, stitching them together in perfect sync with the detected beat grid.
- Simple Web Interface: Built with Gradio, the tool is easy to use directly from your web browser with no command-line knowledge required.
- Rich Customization Options:
- Cut Intensity: Control how often a cut occurs (e.g., on every 2nd, 4th, or 8th beat).
- Playback Speed: Play video clips at normal, half, or double speed to achieve different visual effects.
- Playback Direction: Choose between forward, backward, or a random mix of playback directions for the clips.
- Select Audio Section: Process only a specific portion of the audio file by setting a start and end time.
- Automated File Management: Finished videos are automatically saved to an
outputfolder with a unique timestamp in the filename, preventing files from being overwritten.
Follow these steps to run the project locally.
Prerequisites:
- Python 3.8 or higher
- FFmpeg: Make sure FFmpeg is installed on your system and accessible in your system's PATH. MoviePy requires it to read and write video files.
Installation Steps:
-
Clone the repository:
git clone https://github.com/YOUR_USERNAME/YOUR_PROJECT_NAME.git cd YOUR_PROJECT_NAME -
Create a virtual environment: Using a virtual environment is highly recommended to avoid dependency conflicts.
# Create the environment python -m venv env # Activate it # On Windows: .\env\Scripts\activate # On macOS / Linux: source env/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Make sure your virtual environment is activated.
-
Start the Gradio web application using the following command:
python app.py
-
Open your web browser and navigate to the local URL provided in the terminal (usually
http://127.0.0.1:7860). -
Follow the steps in the web interface:
- Upload an MP3 file.
- Upload one or more MP4 video clips.
- Adjust the processing options (Cut Intensity, Speed, etc.) to your liking.
- Click the "Create Music Video" button and wait for the processing to complete.
-
The finished video will appear in the output panel and will also be saved to the
outputfolder in your project directory.
