This repository contains two tools for converting video files into MP3 clips with embedded album art:
- A command-line script for developers and power users.
- A web-based application for a more user-friendly experience.
Both tools use FFmpeg for video and audio processing.
- Extracts audio clips from video files and converts them to MP3 format.
- Automatically generates screenshots from the video to use as album art.
- Embeds metadata (album name, track number) into MP3 files.
- Ideal for automation and integration into other workflows.
- Allows customization of clip duration and metadata directly in the script.
- Simple and intuitive interface accessible via a web browser.
- Real-time progress tracking with WebSockets (broken ): )
- Outputs a ZIP archive of processed MP3 files.
- Python: Version 3.7 or higher.
- FFmpeg: Installed and added to your system's PATH.
- Test installation:
ffmpeg -version
- Test installation:
- (Web only)
Flask
flask_socketio
werkzeug
zipfile
Install the necessary dependencies using pip
:
pip install -r requirements.txt
- Clone this repository:
git clone https://github.com/yourusername/video-to-mp3-album-art cd video-to-mp3-album-art
- Ensure FFmpeg is installed.
- The script is ready to run without additional setup.
- Install the required Python libraries:
pip install flask flask_socketio werkzeug zipfile
- Place the script and video file in the same directory.
- Run the script:
python script_name.py
- Enter the album name when prompted.
- MP3 files with album art will be saved in the output directory.
- Input:
in.mp4
- Processing:
- Extracts MP3 clips of 3 seconds each.
- Takes screenshots from the video for album art.
- Output:
clip_1_with_art.mp3
clip_2_with_art.mp3
- Start the Flask server:
python app.py
- Open your browser and navigate to:
http://localhost:5000
- Upload a video file and enter the album name.
- Download the processed ZIP file containing MP3 clips.
- Individual MP3 files with embedded album art.
- Each clip is named as:
clip_1_with_art.mp3
clip_2_with_art.mp3
- ZIP archive containing all MP3 clips:
clip_1_with_art.mp3
clip_2_with_art.mp3
- Modify the
seconds_per_file
parameter in both tools to change the duration of each MP3 clip.
- Customize fields like
album
andtrack
in the script or web app for personalized output.
- Start the server locally:
python app.py
- Use Gunicorn for deployment:
gunicorn -w 4 -b 0.0.0.0:5000 app:app
- Set up a reverse proxy with NGINX for scalability and security.
- Both tools delete temporary files (e.g., screenshots, intermediate MP3s) after processing to save space.
- Command-Line Script:
- Python video to MP3 script
- Embed album art in MP3 Python
- Extract audio from video FFmpeg
- Web Application:
- Web-based video to MP3 converter
- Flask MP3 conversion app
- MP3 generator with screenshots
This repository provides versatile solutions for converting videos to MP3 clips with embedded album art, catering to developers and general users alike.