로컬 Whisper 사용하기
하나의 스크립트, 세 가지 백엔드, 하나의 출력 형식. 모든 다운스트림(컷 목록, 자막 타이밍, 싱크 게이트)은 <stem>.words.json을 읽습니다:
[
{"w": "Your", "s": 0.02, "e": 0.27},
{"w": "AI", "s": 0.27, "e": 0.4}
]
w = 인식된 단어, s/e = 시작/끝 시간(초).
요구 사항 (컴퓨터에서 Claude Code 사용 시)
ffmpeg(아무 빌드):brew install ffmpeg/apt install ffmpeg- Python 3.9+
- 하나의 백엔드:
| 백엔드 | 설치 | 기본 모델 | 사용 시기 |
|---|---|---|---|
mlx | pip install mlx-whisper | mlx-community/whisper-large-v3-turbo | Apple Silicon. 세 가지 중 단어 TIMING이 가장 우수 |
faster-whisper | pip install faster-whisper | large-v3-turbo | Linux/Windows, 또는 CUDA |
whisper-cpp | brew install whisper-cpp (바이너리는 whisper-cli) | 없음, --model 전달 필요 | Python ML 스택을 원하지 않는 경우 |
whisper.cpp 모델 다운로드 (466 MB, 영어):
mkdir -p ~/whisper-models
curl -L -o ~/whisper-models/ggml-small.en.bin \
https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.en.bin
설치 확인 (auto가 사용할 백엔드를 출력):
ffmpeg -version | head -1
python3 -c "import mlx_whisper" 2>/dev/null && echo mlx || \
python3 -c "import faster_whisper" 2>/dev/null && echo faster-whisper || \
command -v whisper-cli || echo "백엔드 없음: 표에서 하나를 설치하세요"
Claude.ai에서는 사용할 수 없습니다(쉘 없음). 대신 사용자에게 SRT 파일을 업로드하도록 요청하세요.
실행하기
python3 scripts/transcribe.py take.mov # 자동 백엔드, 영어
python3 scripts/transcribe.py take.mov --backend whisper-cpp --model ~/whisper-models/ggml-small.en.bin
python3 scripts/transcribe.py final.mp4 --out qa/ --words-per-cue 2
python3 scripts/transcribe.py interview.m4a --lang auto # 언어 감지
먼저 ffmpeg로 16kHz 모노를 추출하므로 모든 컨테이너(mov, mp4, m4a, wav)가 작동합니다.
--out이 없으면 출력은 입력 파일 옆에 생성됩니다:
<stem>.words.json, <stem>.txt, <stem>.srt.
작업별 모델 선택
| 작업 | 모델 | 이유 |
|---|---|---|
| 자막 큐 TIMING, 싱크 게이트 | large-v3-turbo (mlx 또는 faster-whisper) | 작은 모델은 동일한 오디오에서 단어당 0.1~0.4초 드리프트 발생 |
| 전사 텍스트, 컷 목록, 재촬영 감지 | small.en 또는 turbo | 텍스트 품질은 비슷함; small.en은 CPU에서 빠름 |
| 비영어 | large-v3-turbo with --lang <code> | .en 모델은 영어 전용 |
재작업을 줄이는 규칙
- 스크립트의 텍스트, Whisper의 타이밍. Whisper는 이름을 잘못 알아듣습니다("Cloud" for Claude). 자막의 경우 스크립트의 단어를
words.json에 정렬하고 스크립트 철자를 유지하세요(edit-styletools/make_cues.py가 이를 수행). 스크립트가 없는 항목에 대해서는 수정 맵({"cloud code": "Claude Code"})을 유지하세요. - 스크립트에서 숫자는 숫자로 작성하세요. Whisper는
2,000을 출력하고 "two thousand"를 출력하지 않으므로 철자로 작성된 스크립트는 정렬에 실패합니다. - 최종 렌더링을 다시 전사하여 게시된 SRT와 싱크 검사를 수행하세요. 원본 테이크의 시간은 모든 컷 후에 틀립니다.
- Whisper는 음성이 나중에 시작하더라도 첫 번째 단어를 0.00 근처에 스탬프합니다. 오디오 에너지로 실제 시작점을 찾아 헤드를 자르기 전에 확인하고, 첫 2초를 다시 전사하여 첫 번째 단어가 살아남았는지 확인하세요.
- 긴 파일(약 30분 이상): 세 백엔드 모두에서 잘 작동하며, Apple Silicon에서 turbo로 대략 실시간 / 10 정도입니다. 같은 기기에서 녹음 중이라면
nice -n 15아래에서 실행하세요.
오류 처리
| 증상 | 해결 방법 |
|---|---|
no local Whisper found | 표에서 하나의 백엔드를 설치하세요 |
whisper-cpp needs --model | 위에서 ggml 모델을 다운로드하거나 WHISPER_MODEL 설정 |
whisper-cli not found지만 설치됨 | WHISPER_BIN=/path/to/whisper-cli 설정 (launchd/cron PATH는 종종 /opt/homebrew/bin 누락) |
| 빈 출력 또는 0단어 출력 | 파일에 오디오가 있는지 확인: ffprobe -v error -select_streams a -show_entries stream=codec_name -of csv=p=0 FILE |
| 잘못된 언어 / 횡설수설 | --lang <code>를 명시적으로 전달 |
| 단어들이 붙어 출력("2,000files") | 일부 빌드에서 whisper.cpp 버그; 타이밍 작업은 mlx 또는 faster-whisper 사용 |
보고할 출력
whisper-cpp: 17 words, 5.68s -> o/take.words.json / .txt / .srt
그런 다음 words.json 경로를 다음 스킬(edit-style, longform-edit, reel-captions)에 전달하세요.