Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Prepare for karaoke video creation, by downloading audio and lyrics for a specified song or playlist from youtube and separating audio stems. After syncing, finalise the video with a title screen!
Prepare for karaoke video creation, by downloading audio from YouTube and lyrics from Genius for a given song.
This was created to make it easier for me to prepare the source audio, lyrics and instrumental audio so I can then do the actual karaoke creation in focus mode without internet.
UVR_MDXNET_KARA_2
and UVR-MDX-NET-Inst_HQ_3
) to give you options for the backing track.karaoke-finalise
to remux and add your title screen!You'll need Python version 3.9, 3.10 or 3.11 (newer versions aren't supported by PyTorch or ONNX Runtime yet).
You can install Karaoke Prep using pip:
pip install karaoke-prep
You'll then also need to install a version of audio-separator
for your hardware:
pip install audio-separator[silicon]
pip install audio-separator[gpu]
pip install audio-separator[cpu]
If you're trying to use CUDA for GPU acceleration, you'll also need to ensure the version of PyTorch you have installed is compatible with the CUDA version you have installed.
While PyTorch should get installed as a dependency of karaoke-prep
anyway, you may need to install PyTorch for your CUDA version by running the installation command provided by the official install wizard: https://pytorch.org/get-started/locally/
If you encounter this error: UnicodeEncodeError: 'charmap' codec can't encode character
Try setting the Python I/O encoding in your environment: export PYTHONIOENCODING=utf-8
If you aren't sure what pip
is or how to use the command line, here are some YouTube tutorials which will probably help:
GENIUS_API_TOKEN
karaoke-prep <Artist> <Title>
to fetch and prep the files above(YouTube xxxxxxxxxxx).wav
(Lyrics Processed).txt
Artist - Title (Karaoke).mov
in the same folderkaraoke-finalise
to remux the instrumental audio and join the title clip to the startArtist - Title (Final Karaoke).mp4
video to YouTube!Here's my tutorial video with verbal explanation of the whole process, and here's a normal speed demo of me doing it (8 minutes total for a single track).
You can use Karaoke Prep via the command line:
usage: karaoke-prep [-h] [-v] [--log_level LOG_LEVEL] [--model_name MODEL_NAME] [--model_file_dir MODEL_FILE_DIR] [--output_dir OUTPUT_DIR] [--use_cuda] [--use_coreml]
[--denoise DENOISE] [--normalize NORMALIZE] [--create_track_subfolders]
[artist] [title] [url]
Fetch audio and lyrics for a specified song, to prepare karaoke video creation.
positional arguments:
args [YouTube video or playlist URL] [Artist] [Title] of song to prep. If URL is provided, Artist and Title are optional but increase chance of fetching the correct lyrics. If Artist and Title are provided with no URL, the top YouTube search result will be fetched.
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
--log_level LOG_LEVEL Optional: logging level, e.g. info, debug, warning (default: info). Example: --log_level=debug
--model_name MODEL_NAME Optional: model name to be used for separation (default: UVR_MDXNET_KARA_2). Example: --model_name=UVR-MDX-NET-Inst_HQ_3
--model_file_dir MODEL_FILE_DIR Optional: model files directory (default: /tmp/audio-separator-models/). Example: --model_file_dir=/app/models
--output_dir OUTPUT_DIR Optional: directory to write output files (default: <current dir>). Example: --output_dir=/app/karaoke
--use_cuda Optional: use Nvidia GPU with CUDA for separation (default: False). Example: --use_cuda=true
--use_coreml Optional: use Apple Silicon GPU with CoreML for separation (default: False). Example: --use_coreml=true
--denoise DENOISE Optional: enable or disable denoising during separation (default: True). Example: --denoise=False
--normalize NORMALIZE Optional: enable or disable normalization during separation (default: True). Example: --normalize=False
--no_track_subfolders Optional: do NOT create a named subfolder for each track. Example: --no_track_subfolders
--intro_background_color INTRO_BACKGROUND_COLOR Optional: Background color for intro video (default: black). Example: --intro_background_color=#123456
--intro_background_image INTRO_BACKGROUND_IMAGE Optional: Path to background image for intro video. Overrides background color if provided. Example: --intro_background_image=path/to/image.jpg
--intro_font INTRO_FONT Optional: Font file for intro video (default: Avenir-Next-Bold). Example: --intro_font=AvenirNext-Bold.ttf
--intro_artist_color INTRO_ARTIST_COLOR Optional: Font color for intro video artist text (default: #ff7acc). Example: --intro_artist_color=#123456
--intro_title_color INTRO_TITLE_COLOR Optional: Font color for intro video title text (default: #ffdf6b). Example: --intro_title_color=#123456
For the most consistent results, provide a specific YouTube URL along with the artist and title like so:
karaoke-prep "https://www.youtube.com/watch?v=YOUR_VIDEO_ID" "The Fray" "Never Say Never"
If you don't have a specific YouTube URL, just provide the artist and title. Karaoke Prep will search for and download the top YouTube result.
karaoke-prep "The Fray" "Never Say Never"
This will process the video at the given URL, guessing the artist and title from the YouTube title. ⚠️ Be aware the downloaded lyrics may be incorrect if the video title doesn't match the standard "Artist - Title" format.
karaoke-prep "https://www.youtube.com/watch?v=YOUR_VIDEO_ID"
To process a playlist, just provide the playlist URL. The script will process every video in the playlist. ⚠️ Be aware the downloaded lyrics for each track may be incorrect if the video titles don't match the standard "Artist - Title" format.
karaoke-prep "https://www.youtube.com/playlist?list=YOUR_PLAYLIST_ID"
After running karaoke-prep
you should have the following 11 files, grouped into folder(s) for each track:
Artist - Title (YouTube xxxxxxxxxxx).webm
Artist - Title (YouTube xxxxxxxxxxx).png
Artist - Title (YouTube xxxxxxxxxxx).wav
Artist - Title (Lyrics).txt
Artist - Title (Lyrics Processed).txt
Artist - Title (Vocals UVR-MDX-NET-Inst_HQ_3).mp3
Artist - Title (Vocals UVR_MDXNET_KARA_2).mp3
Artist - Title (Instrumental UVR-MDX-NET-Inst_HQ_3).mp3
Artist - Title (Instrumental UVR_MDXNET_KARA_2).mp3
Artist - Title (Title).png
Artist - Title (Title).mov
After completing your manual sync process and rendering your Artist - Title (Karaoke).mov
file (still using the original audio!) into the same folder, you can now run karaoke-finalise
.
This will output some additional files:
Artist - Title (Karaoke).mov
Artist - Title (With Vocals).mov
Artist - Title (Final Karaoke).mp4
Python >= 3.9
Libraries: onnx, onnxruntime, numpy, soundfile, librosa, torch, wget, six
This project uses Poetry for dependency management and packaging. Follow these steps to setup a local development environment:
Clone the repository to your local machine:
git clone https://github.com/YOUR_USERNAME/karaoke-prep.git
cd karaoke-prep
Replace YOUR_USERNAME with your GitHub username if you've forked the repository, or use the main repository URL if you have the permissions.
Run the following command to install the project dependencies:
poetry install
To activate the virtual environment, use the following command:
poetry shell
You can run the CLI command directly within the virtual environment. For example:
karaoke-prep 1
Once you are done with your development work, you can exit the virtual environment by simply typing:
exit
To build the package for distribution, use the following command:
poetry build
This will generate the distribution packages in the dist directory - but for now only @beveradb will be able to publish to PyPI.
Contributions are very much welcome! Please fork the repository and submit a pull request with your changes, and I'll try to review, merge and publish promptly!
This project is licensed under the MIT License.
For questions or feedback, please raise an issue or reach out to @beveradb (Andrew Beveridge) directly.
FAQs
Prepare for karaoke video creation, by downloading audio and lyrics for a specified song or playlist from youtube and separating audio stems. After syncing, finalise the video with a title screen!
We found that karaoke-prep demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.