⚡ Whisper Large-v3 GPU & Eigene API-Endpoints

Große Audio-/Video-Archive & Colab GPU-Modus

Für Aufnahmen über 60 Minuten oder ganze Ordner auf Google Drive: Verbinde deinen eigenen Colab-GPU-Server (200 CCU) oder kopiere das fertige Whisper-Large-v3-Skript.

🔧 Option 1: Eigenen API-Key oder Colab-Tunnel (ngrok) hinterlegen

Wird nur lokal in deinem Browser (LocalStorage) gespeichert und bei Anfragen auf der Hauptseite genutzt.

🐍 Option 2: Google Colab GPU Batch-Skript (Whisper Large-v3)

Öffne Google Colab (Runtime: T4 oder A100 GPU), füge dieses Skript ein, und alle Dateien in /MyDrive/Audio_To_Transcribe werden automatisch mit Zeitstempeln transkribiert:

import os
import torch
from google.colab import drive

# 1. Mount Google Drive
drive.mount('/content/drive')

# 2. Install Whisper & FFmpeg
!pip install -q openai-whisper ffmpeg-python tqdm

import whisper

INPUT_FOLDER = '/content/drive/MyDrive/Audio_To_Transcribe'
OUTPUT_FOLDER = '/content/drive/MyDrive/Transcriptions'
os.makedirs(INPUT_FOLDER, exist_ok=True)
os.makedirs(OUTPUT_FOLDER, exist_ok=True)

device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using device: {device}")
model = whisper.load_model("large-v3", device=device)

exts = ('.mp3', '.m4a', '.wav', '.ogg', '.webm', '.mp4', '.mkv', '.mov')
files = [f for f in os.listdir(INPUT_FOLDER) if f.lower().endswith(exts)]

for fname in files:
    in_path = os.path.join(INPUT_FOLDER, fname)
    base = os.path.splitext(fname)[0]
    out_path = os.path.join(OUTPUT_FOLDER, f"{base}.txt")
    if os.path.exists(out_path):
        continue
    print(f"Transcribing: {fname}...")
    res = model.transcribe(in_path, verbose=False)
    with open(out_path, "w", encoding="utf-8") as out:
        out.write(f"=== Transcript: {fname} ===\n\n")
        for seg in res['segments']:
            s, e = int(seg['start']), int(seg['end'])
            out.write(f"[{s//60:02d}:{s%60:02d} - {e//60:02d}:{e%60:02d}] {seg['text'].strip()}\n")
    print(f"Saved: {out_path}")