Skip to content

A simple one-command subtitle transcriber for input audio and video using whisper models.

Notifications You must be signed in to change notification settings

tollefj/whisper-subtitler

Repository files navigation

Super-simple subtitles with WhisperX

tom-scott

Usage

python transcription.py [-h] [--model MODEL] [--diarize] [--save_to_path SAVE_TO_PATH] media_path language

Alternatively, ./run.sh is mapped to python transcription.py.

Arguments

positional arguments:
  media_path            Path to the media file
  language              Language for translation

options:
  -h, --help            show this help message and exit
  --model MODEL         Model for transcription
  --diarize             Whether to diarize the audio
  --save                Whether to render a video + subtitles

Example

  • English (with diarization and re-rendering with subtitles):
    • ./run.sh https://www.youtube.com/watch\?v\=Zl_5LT2fzak en --model=base --diarize --save
  • Norwegian (no diarization or re-rendering):
    • ./run.sh https://tv.nrk.no/serie/munter-mat/2023/KOID33006222/avspiller no --model=NbAiLabBeta/nb-whisper-small

Setup and installation

Diarization

To support speaker diarization, you need to save your huggingface token in secrets.yml in the root dir:

  1. Create a huggingface account

  2. Accept the terms at https://huggingface.co/pyannote/speaker-diarization-3.1

  3. Create a token from https://huggingface.co/settings/tokens

  4. Create secrets.yml in the root dir with the following content:

    HF: <your-token>

About

A simple one-command subtitle transcriber for input audio and video using whisper models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published