Skip to content

This Dockerized project provides a seamless solution for transcribing audio files into subtitle files (.srt) using OpenAI Whisper.

Notifications You must be signed in to change notification settings

thomaskanzig/whisper-transcriber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Whisper Transcriber Docker

This project provides a Dockerized environment for transcribing audio files into subtitle (.srt format) using OpenAI Whisper. The container includes all necessary dependencies, ensuring a seamless transcription experience.

Features

  • Transcribe audio files (.mp3, .wav, etc.) into .srt subtitle files.
  • Leverages OpenAI's Whisper with the base model for transcription.
  • Automatically saves subtitle in a dedicated subtitle folder.

Prerequisites

Before using this project, ensure the following are installed on your system:

Setup

  1. Clone the Repository (if applicable):

    git clone [email protected]:thomaskanzig/whisper-transcriber.git
    cd whisper-transcriber-docker
  2. Build the Docker Image:

docker build -t whisper-transcriber .

Usage

To transcribe an audio file and generate an .srt subtitle file:

  1. Place your audio file in the audio directory within the project folder.
  2. Run the following command:
docker run -v $(pwd):/app whisper-transcriber audio/<PATH-AUDIO-FILE>

Command Breakdown

  • docker run: Runs the Docker container.
  • -v $(pwd):/app: Mounts the current directory into the container’s /app directory.
  • whisper-transcriber: Name of the Docker image.
  • Path to the audio file you want to transcribe.

Example

If you have an audio file named example.mp3 in your audio/ directory:

docker run -v $(pwd):/app whisper-transcriber audio/example.mp3

The transcription will save the subtitle file as:

subtitle/example.srt

Output

The generated .srt file will be saved in the subtitle folder within your current working directory.

Example structure after running the command:

.
├── audio
│   └── example.mp3
├── subtitle
│   └── example.srt
├── Dockerfile
├── entrypoint.sh
└── README.md

Customization

Change the Whisper Model

You can edit the entrypoint.sh file to use a different Whisper model, such as tiny, medium, or large. Modify the line:

whisper "$1" --model base --output_format srt --output_dir /app/subtitle

to:

whisper "$1" --model medium --output_format srt --output_dir /app/subtitle

Troubleshooting

Common Errors

  • Permission Denied for entrypoint.sh: Ensure the script has executable permissions:

    chmod +x entrypoint.sh
  • No Output in subtitle: Verify the audio file path and format. Supported formats include .mp3, .wav, .m4a, etc.

About

This Dockerized project provides a seamless solution for transcribing audio files into subtitle files (.srt) using OpenAI Whisper.

Resources

Stars

Watchers

Forks

Packages

No packages published