Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcdallas/whispersub
format whisper transcripts to .srt
https://github.com/mcdallas/whispersub
openai srt subtitles transcription whisper whisper-cpp
Last synced: 3 months ago
JSON representation
format whisper transcripts to .srt
- Host: GitHub
- URL: https://github.com/mcdallas/whispersub
- Owner: mcdallas
- Created: 2023-07-15T02:17:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-15T02:26:37.000Z (over 1 year ago)
- Last Synced: 2024-10-15T03:06:31.519Z (3 months ago)
- Topics: openai, srt, subtitles, transcription, whisper, whisper-cpp
- Language: Rust
- Homepage:
- Size: 3.91 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## whispersub
A dead simple utility to format the output of OpenAI's whisper model (or whisper.cpp) into an .srt file.
### Usage
``` bash
whispersub input.txt -o output.srt
```you can also pipe the output of whisper.cpp into whispersub
```bash
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
```bash
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
```