This project is a simple lyric video generator written in Rust. It takes an audio file and a set of lyrics, and generates a video with the lyrics displayed in sync with the audio.
- Generate lyric videos from audio files and text
- Customizable video resolution and frame rate
- Simple black background with white text
- Uses ffmpeg for final video compilation
Before you begin, ensure you have met the following requirements:
- Rust and Cargo installed (https://www.rust-lang.org/tools/install)
- ffmpeg installed and available in your system PATH
- A TrueType font file (.ttf) for rendering text
-
Clone this repository:
git clone https://github.com/AR10Dev/Lyrics-to-Video.git cd Lyrics-to-Video
-
Build the project:
cargo build --release
- Place your audio file (MP3 format) in the project root and name it
audio.mp3
. - Place your font file (TTF format) in the project root and name it
font.ttf
. - Edit the
lyrics
vector insrc/main.rs
to include your lyrics and their timings. - Run the program:
cargo run --release
The program will generate a series of PNG frames in the output_frames
directory and then use ffmpeg to combine these frames with the audio into a final MP4 video named output_video.mp4
.
You can modify the following settings in src/main.rs
:
- Video resolution: Adjust
width
andheight
variables - Frame rate: Modify the
fps
variable - Font size: Change the
font_height
variable
This project uses the following Rust crates:
ab_glyph
for font handlingimage
for image creation and manipulationimageproc
for drawing text on imagesrodio
for audio file parsing
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
This project is GPL-3.0 licensed.