Transcription Service

Transcription Service

Follow this guide after completing the optional transcription setup steps in the main README.

1. Prepare a virtual environment

cd apps/transcription
python -m venv env

Activate the environment:

  • Windows
    env\Scripts\activate
  • macOS/Linux
    source env/bin/activate

Using VS Code? Run Python: Select Interpreter and point it at env/bin/python (or env\Scripts\python.exe on Windows).

Install dependencies:

pip install -r requirements.txt

2. Configure Modal

  1. Create a Modal account if you do not have one.

  2. Authenticate the CLI:

    python -m modal setup
  3. Run a local test (optional):

    modal run transcription.py
  4. Deploy the transcription function:

    modal deploy transcription.py

3. Provide Cloudflare R2 secrets

The deployed function downloads audio from Cloudflare R2, transcribes it with Whisper, and deletes the object afterwards. Set these environment variables as a Modal secret:

CLOUDFLARE_ACCOUNT_ID=your-account-id
R2_ACCESS_KEY_ID=your-access-key-id
R2_SECRET_ACCESS_KEY=your-secret-access-key
R2_BUCKET_NAME=opencut-transcription
  1. Visit the Modal Secrets dashboard.
  2. Create a custom secret named opencut-r2-secrets.
  3. Use Import .env and paste the variables from your .env.local file.

You are now ready to trigger automatic captions inside OpenCut.

Last updated on