Skip to main content

Automated lyrics video generator

Project description

PyPI - Version PyPI - License

Lyriks

Lyriks is an automated lyrics video generator. It transcribes the audio and automatically creates a video using MoviePy.


Features


Requirements

  • Linux
  • An NVIDIA GPU (recommended for best performance; CPU is supported but slower)
  • 10GB of free disk space
  • Python 3.11
  • ffmpeg

Installing FFmpeg

On Ubuntu/Debian:

sudo apt update
sudo apt install ffmpeg

On Arch Linux:

sudo pacman -S ffmpeg

On macOS (with Homebrew):

brew install ffmpeg

For other platforms and more details, see the FFmpeg download page.


Installation

It is highly recommended to use a virtual environment for isolation:

python3 -m venv .venv
source .venv/bin/activate

Then install Lyriks with pip:

pip install lyriks-video

Usage

python -m lyriks generate AUDIO_FILE LYRICS_FILE [OPTIONS]

Parameters

  • AUDIO_FILE
    Path to the input audio file (e.g., song.mp3).
    This should be a supported audio format (such as MP3 or WAV).

  • LYRICS_FILE
    Path to the lyrics file (plain text).
    The lyrics should be in a text file, one line per lyric segment.

Options

You will be interactively prompted in the CLI for any options you leave unspecified.

  • --output, -o
    Output video file name (without extension).
    Example: -o my_lyrics_video

  • --model_size, -m
    Sets the Whisper model size for transcription.
    Options: tiny, base, small, medium, large, turbo

  • --device, -d
    Which device to use for Whisper model inference.
    Options: cpu, cuda

  • --generator, -g
    Which backend to use for video generation.
    Options:

    • ps2: pysubs2 + ffmpeg (fast, good quality, experimental, ~180 fps)
    • mp: MoviePy (slow, low quality, legacy, ~10 fps)
    • ts: Only save transcript (for debugging)
  • --no-gemini
    Disable Gemini improvements for Whisper output.


Example

python -m lyriks generate path/to/song.mp3 path/to/lyrics.txt -m small -d cuda -o output_video

Note: This process can take up to 5 minutes on lower end hardware.


TODO

  • Fancier video styles and effects
  • Add more robust error handling
  • Ask which background to use
  • Libary of procedually generated backgrounds
  • Batch processing
  • Loading bars
  • Karaoke function
  • Automatic upload to YouTube

How Lyriks Works

Flowchart


Credits

This project uses:


Citations

If you use this in your research, please cite the following:

Demucs

@inproceedings{rouard2022hybrid,
  title={Hybrid Transformers for Music Source Separation},
  author={Rouard, Simon and Massa, Francisco and D{'e}fossez, Alexandre},
  booktitle={ICASSP 23},
  year={2023}
}

@inproceedings{defossez2021hybrid,
  title={Hybrid Spectrogram and Waveform Source Separation},
  author={D{'e}fossez, Alexandre},
  booktitle={Proceedings of the ISMIR 2021 Workshop on Music Source Separation},
  year={2021}
}

whisper-timestamped

@misc{lintoai2023whispertimestamped,
  title={whisper-timestamped},
  author={Louradour, J{\'e}r{\^o}me},
  journal={GitHub repository},
  year={2023},
  publisher={GitHub},
  howpublished = {\url{https://github.com/linto-ai/whisper-timestamped}}
}

OpenAI Whisper

@article{radford2022robust,
  title={Robust speech recognition via large-scale weak supervision},
  author={Radford, Alec and Kim, Jong Wook and Xu, Tao and Brockman, Greg and McLeavey, Christine and Sutskever, Ilya},
  journal={arXiv preprint arXiv:2212.04356},
  year={2022}
}

Dynamic-Time-Warping

@article{JSSv031i07,
  title={Computing and Visualizing Dynamic Time Warping Alignments in R: The dtw Package},
  author={Giorgino, Toni},
  journal={Journal of Statistical Software},
  year={2009},
  volume={31},
  number={7},
  doi={10.18637/jss.v031.i07}
}

License

This project is licensed under the GPL-3.0 License.


Contributing

Contributions are welcome!
If you have suggestions, bug reports, or want to add features, please open an issue or submit a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a pull request

Contact

For questions, bug reports, or feedback, please open an issue on GitHub
or contact the maintainer: simon0302010 (GitHub username).


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lyriks_video-0.4.2.tar.gz (45.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lyriks_video-0.4.2-py3-none-any.whl (45.0 MB view details)

Uploaded Python 3

File details

Details for the file lyriks_video-0.4.2.tar.gz.

File metadata

  • Download URL: lyriks_video-0.4.2.tar.gz
  • Upload date:
  • Size: 45.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for lyriks_video-0.4.2.tar.gz
Algorithm Hash digest
SHA256 f53fb2bbba75cf2269d53b73051297c3c101476c0935da1dbd3666d43d63b704
MD5 e3364c31485db44ebfa95861081c6b45
BLAKE2b-256 c86b5b41d7a2a77c3476b1a1d6c0f40113e881e3335c05a80e37434597cdd9da

See more details on using hashes here.

File details

Details for the file lyriks_video-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: lyriks_video-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 45.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for lyriks_video-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eaccc264838ab7fc8989c68296095244ad7de984fbf4aba8b4f10b76e25b0789
MD5 2aa4f09dca41f4d9efbb6bb2a9ec7333
BLAKE2b-256 a9f189fffc2e34d4e2566d974e35c70649a4114b921f6e8ad240fc0db9b293b0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page