Communitygithub.com

jsath/claude-skills

使用本機 Whisper 將音訊或影片轉錄為文字,並產生逐字時間戳記(words.json)、純文字檔(.txt)及字幕檔(.srt),無需 API 金鑰,資料不上傳雲端。

claude-skills 是什麼?

這項技能讓 AI 代理能夠在本地端使用三種不同的 Whisper 後端(mlx-whisper、faster-whisper 或 whisper.cpp)來轉錄音訊或影片檔案。它會產生一個結構化的 `words.json` 檔案,其中包含每個單詞的開始與結束時間(以秒為單位),同時也會輸出純文字檔與標準的 SRT 字幕格式。首要設計目標是作為影片剪輯工作流程的「轉錄層」,其他技能(如 edit-style、longform-edit、reel-captions)會依賴 `words.json` 來進行基於時間軸的裁切、字幕或同步檢查。此技能支援 macOS(Apple Silicon)、Linux 與 Windows,且會自動選擇可用的後端,並提供模型選擇建議(如用於精確時間的 large-v3-turbo,或用於快速文字擷取的 small.en)。使用者也可以指定自訂的模型路徑,或透過 `--lang auto` 參數啟用語言偵測。它會先使用 ffmpeg 將輸入檔案轉換為 16kHz 的單聲道音訊,因此能處理各種容器格式(如 .mov、.mp4、.m4a、.wav)。錯誤處理涵蓋了常見問題,例如後端未安裝、模型檔案遺失或音訊串流無效,並會提供具體的修復指示。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jsath/claude-skills/tree/HEAD/skills/use-local-whisper

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

使用本機 Whisper

一個腳本,三種後端,統一的輸出格式。下游的所有操作(裁切清單、字幕時間軸、同步檢查)都會讀取 <stem>.words.json:

[
{"w": "Your", "s": 0.02, "e": 0.27},
{"w": "AI", "s": 0.27, "e": 0.40}
]

w = 辨識出的單詞,s/e = 開始/結束時間(秒)。

系統需求(Claude Code,於電腦上執行)

  • ffmpeg(任何版本):brew install ffmpeg / apt install ffmpeg
  • Python 3.9+
  • 一個後端:
後端安裝方式預設模型使用時機
mlxpip install mlx-whispermlx-community/whisper-large-v3-turboApple Silicon。三者中提供最佳的字詞時間戳記
faster-whisperpip install faster-whisperlarge-v3-turboLinux/Windows,或使用 CUDA
whisper-cppbrew 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 "NO BACKEND: install one from the table"

此技能無法在 Claude.ai 上使用(無終端機)。請要求使用者上傳 SRT 檔案。

執行轉錄

python3 scripts/transcribe.py take.mov                       # 使用 auto 後端,英文
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 將音訊轉換為 16 kHz 的單聲道格式,因此能支援任何容器(mov, mp4, m4a, wav)。 輸出結果會放置在輸入檔案的同一目錄,除非指定了 --out 參數: <stem>.words.json, <stem>.txt, <stem>.srt。

依據任務選擇模型

任務建議模型原因
字幕時間戳記、同步檢查large-v3-turbo(mlx 或 faster-whisper)小模型在相同音訊上,每個單詞可能會有 0.1 到 0.4 秒的時間偏差
轉錄文字、裁切清單、重拍偵測small.en 或 turbo文字品質相近;small.en 在 CPU 上速度較快
非英文內容large-v3-turbo 搭配 --lang <code>.en 模型僅適用於英文

避免重工的規則

  1. 文字來自腳本,時間來自 Whisper。 Whisper 可能會誤判專有名詞(例如將 "Claude" 誤認為 "Cloud")。對於字幕,請將腳本中的文字對齊 words.json 的時間戳記,並保留腳本的拼寫(edit-style 的 tools/make_cues.py 即執行此工作)。對於沒有腳本的內容,請維護一個修正對應表(例如 {"cloud code": "Claude Code"})。
  2. 在腳本中將數字寫為數字。 Whisper 輸出 2,000,而非 "two thousand",因此使用文字拼寫的腳本將無法對齊。
  3. 為最終發布的 SRT 及同步檢查,重新轉錄正式渲染後的版本。 從原始片段取得的時間在每次裁切後都會不準確。
  4. 即使語音稍晚才開始,Whisper 仍會將第一個單詞標記在接近 0.00 秒的位置。 在裁切開頭前,請從音訊能量找出真正的聲音起始點,然後重新轉錄前 2 秒,以證明第一個單詞仍存在。
  5. 長檔案(超過約 30 分鐘):三個後端均能順利處理;在 Apple Silicon 搭配 turbo 模型下,預估約為即時速度的 1/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)。

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

jsath/claude-skills

Writes captions for a finished video from its transcript: pulls the line worth repeating, writes first-line options, writes per-platform versions (Instagram, TikTok, YouTube title and description, others on request), keeps the creator's voice using their best past captions, and checks the call to action matches what the video actually says. Use when a creator asks for captions, a caption hook, a YouTube title and description, or a CTA check. Drafts only; never posts or schedules.

jsath/claude-skills

Write CAPTIONS-PLATFORMS.md for one finished short video: a per-platform post caption for Instagram, TikTok, YouTube Shorts (title + description), Facebook, Threads, Bluesky and X, each within that platform's limits, with your comment-keyword CTA on the platforms where it belongs and never on X. Keyword, CTA, platforms, hashtags and limits come from a config file; a checker script fails the file on any miss. Use after an edit is finished, when asked to 'write the captions', 'caption this reel for every platform', or before scheduling.

jsath/claude-skills

Turns one published long-form video or podcast transcript into up to thirty pieces: 10 clips with new hooks and exact timestamps, 8 X posts, 4 LinkedIn posts, 3 carousels, 2 threads, a newsletter, a community post and a blog post, laid out on a two-week plan, all built only from what was said. In Claude Code it also cuts, reframes and captions the clips with ffmpeg. Use when someone wants to repurpose a long video, find clips, or write social posts from a transcript. Never posts or schedules.

jsath/claude-skills

Turn a raw talking-head take into a dynamically edited 1080x1920 reel: full-face, full-graphic and split layouts that switch every 2 to 5 seconds, real UI and official-logo panels, captions on every word timed by Whisper, voice plus synthesised SFX (no music bed) mastered to -14 LUFS, and hard QA gates (caption sync on the final render, A/V length, loudness, colour, framing, contact sheet, claims). Also covers writing the script so it does not read as AI. Use when asked to 'edit this reel', 'make it look edited', 'add captions / dynamic layout / graphics', or 'write a reel script'.

jsath/claude-skills

Edits a raw long-form YouTube recording (screen recording export, camera file, or either plus a separate mic) into a publish-ready video automatically, like Descript on autopilot: transcribes with word timestamps, removes retakes and keeps the last take, tightens dead space while keeping silent on-screen action (speeding up long waits), masters the voice to -14 LUFS / -1.5 dBTP with no music bed, re-transcribes the FINAL render for an every-word SRT (optional burned-in captions), drafts chapters, titles and a description, and fails loudly on QA gates (words, A/V sync, caption sync per chapter, caption coverage, loudness) plus contact sheets you look at. Use when someone says edit this long-form, clean up my recording, cut the retakes and dead space, process the long-form inbox, or descript this. Needs Claude Code with ffmpeg, whisper.cpp and Python 3.

jsath/claude-skills

Turns one podcast episode transcript into a week of written content: an Episode Prep agent that checks the transcript and speaker names, a Clip Spotter that picks the best short-clip moments with exact timestamps and hooks for an editor to cut, a Show Notes Writer that writes show notes and chapter markers, a Repurpose Writer that turns the big ideas into a newsletter, a LinkedIn post and Instagram captions, and an Episode Planner that spreads it all over the week. Works from a transcript the user supplies or exports from their transcription tool. It does not edit audio or video and does not cut clips. Use when a podcaster asks for show notes, chapters, clip timestamps, or posts from an episode, or says \"repurpose this episode\". Drafts only; never posts.

jsath/claude-skills

Turns one raw talking-head take into a finished 1080x1920 vertical reel in Claude Code with free local tools (ffmpeg, whisper.cpp, headless Playwright): transcribes, keeps the last take of repeated lines, cuts pauses, captions every word, adds real screenshots and official logos, and runs measured QA gates. Use when someone wants a raw phone take edited into a Reel, TikTok or Short, retakes and silences cut, word-by-word captions, or a finished video checked. In Claude.ai it only produces a cut list, shot plan and .srt from a pasted transcript.

jsath/claude-skills

Turns notes, voice-note transcripts and half ideas into Reel, TikTok and YouTube scripts in the creator's own voice: ranks an idea bank, writes ten hooks per idea, writes the script at the right length, rewrites anything that sounds like AI using transcripts of the creator's past videos, and fact-checks every claim with a source and date. Use when someone wants a video script, hooks, a ranked list of what to film, a voice pass, a claims check, or a record sheet to read from while filming.

jsath/claude-skills

Reviews and rewrites a video script (YouTube long-form, a short, or a talking-head reel) so it sounds like one person talking to one friend and holds attention: kills forced analogies and presenter phrases, fixes framing, checks hooks, open loops and re-engagement beats, and suggests titles. Use when someone says fix this script, polish my script, make it sound like me, tighten this before I film, or asks for a hook or title for a video. Returns the rewritten script plus a short change log.

jsath/claude-skills

Make a 1280x720 YouTube thumbnail (or a banner/cover) that reads at phone size: a text-free background plate (generated or from a real frame), a real cutout of the person, 1 to 3 words in tight colour blocks, an official logo, composed by a script that checks overlaps and frame edges and renders the 320px and 168px views you must look at. Use when asked for a thumbnail, cover, banner, 'make this clickable', or to fix a thumbnail that looks cluttered or small.

jsath/claude-skills

Runs five agents that keep a YouTube channel's titles and descriptions matched to what people search for now: a Channel Reader that pulls the user's own video list and stats with their YouTube Data API key, YouTube Analytics OAuth or a pasted YouTube Studio export, a Niche Watcher that finds what is working right now for similar-size channels from public search results the API returns or the user provides, a Title Writer that drafts titles, descriptions and chapters for new videos, a Back Catalogue agent that picks old videos worth a refresh and drafts new versions, and a Change Tracker that records every change the user makes and compares before and after on matched windows. Use when a creator asks for YouTube SEO, better titles or descriptions, what is working in their niche, a back catalogue refresh, or says \"seo run\". Never invents search volumes or stats and never changes a video; drafts only.

相關技能