| Crates.io | whispersub |
| lib.rs | whispersub |
| version | 0.1.0 |
| created_at | 2023-07-15 02:28:24.22114+00 |
| updated_at | 2023-07-15 02:28:24.22114+00 |
| description | format whisper transcripts to .srt |
| homepage | https://github.com/mcdallas/whispersub |
| repository | https://github.com/mcdallas/whispersub |
| max_upload_size | |
| id | 916936 |
| size | 9,827 |
A dead simple utility to format the output of OpenAI's whisper model (or whisper.cpp) into an .srt file.
whispersub input.txt -o output.srt
you can also pipe the output of whisper.cpp into whispersub
whisper-cpp --file audio.wav --language en --model ggml-medium.en.bin | whispersub
or use a little hellper function to extract the audio from a video, pipe it to whisper.cpp and then to whispersub
makesub () {
filename=$(basename -- "$1")
filename="${filename%.*}"
model=${HOME}/.local/share/whisper/ggml-medium.en.bin
ffmpeg -i "$1" -vn -acodec pcm_s16le -ar 16000 -ac 2 -f wav - |
nice -n 20 whisper-cpp --threads "$(nproc)" --file - --language en --model "$model" |
whispersub -o "${filename}.en.srt"
}
makesub video.mp4