Communitygithub.com

ComeOnOliver/skillshub

使用 OpenAI Whisper 與 yt-dlp 將 YouTube 影片轉錄為文字。

skillshub 是什麼?

這個技能透過 yt-dlp 下載 YouTube 影片的音訊,並使用 OpenAI 的 Whisper 模型進行轉錄。它支援多種輸出格式(txt、srt、vtt、json),並提供不同大小的模型,讓使用者可在準確度與速度之間取得平衡。技能適用於各種平台(macOS、Ubuntu/Debian、Windows),並提供了從 CLI 到 Python API 的多種實作方式。使用者可以指定語言以提升準確度,或使用純英文模型來加速英文內容的處理。此外,技能還包含一次性管線指令,能將下載與轉錄合併為單一步驟,並推薦 yt-whisper 工具作為更簡潔的替代方案。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/TerminalSkills/skills/youtube-transcription

在你喜歡的 AI 中提問

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

說明文件

YouTube 影片轉錄

使用 OpenAI Whisper 與 yt-dlp 將 YouTube 影片轉錄為文字。

概述

此技能使用 yt-dlp 從 YouTube 影片下載音訊,再透過 OpenAI 的 Whisper 模型進行轉錄。支援多種輸出格式(txt、srt、vtt、json)以及不同大小的模型,以在準確度與速度之間取得平衡。

操作說明

1. 安裝相依套件

# 安裝 whisper 和 yt-dlp
pip install openai-whisper yt-dlp

# 確認 ffmpeg 已安裝(音訊處理必需)
ffmpeg -version

如果缺少 ffmpeg:

2. 從 YouTube 下載音訊

# 以最佳音質下載為 WAV
yt-dlp -x --audio-format wav -o "%(title)s.%(ext)s" "YOUTUBE_URL"

# 下載為 MP3(檔案較小)
youtube-dl -x --audio-format mp3 -o "%(title)s.%(ext)s" "YOUTUBE_URL"

# 以影片 ID 作為檔名下載(避免特殊字元問題)
yt-dlp -x --audio-format wav -o "%(id)s.%(ext)s" "YOUTUBE_URL"

3. 選擇 Whisper 模型

模型參數VRAM相對速度使用情境
tiny39M~1 GB~32x快速草稿、測試
base74M~1 GB~16x快速轉錄
small244M~2 GB~6x良好平衡
medium769M~5 GB~2x高準確度
large1550M~10 GB1x最佳準確度

純英文模型(tiny.en、base.en、small.en、medium.en)處理英文內容速度更快。

4. 執行轉錄

CLI 方式:

# 基本轉錄(自動偵測語言)
whisper audio.wav --model medium

# 指定語言以提升準確度
whisper audio.wav --model medium --language en

# 指定輸出格式
whisper audio.wav --model medium --output_format srt

# 一次輸出所有格式
whisper audio.wav --model medium --output_format all

# 指定輸出目錄
whisper audio.wav --model medium --output_dir ./transcripts

Python 方式:

import whisper

# 載入模型(初次執行時會下載)
model = whisper.load_model("medium")

# 轉錄
result = model.transcribe("audio.wav", language="en")

# 取得純文字
print(result["text"])

# 取得附帶時間戳記的區段
for segment in result["segments"]:
    print(f"[{segment['start']:.2f} - {segment['end']:.2f}] {segment['text']}")

5. 單行管線

將下載與轉錄合併為一個指令:

# 下載並轉錄一行完成
yt-dlp -x --audio-format wav -o "audio.wav" "YOUTUBE_URL" && whisper audio.wav --model medium --output_format all

6. 替代方案:yt-whisper 工具

若想更簡潔,可使用專用的 yt-whisper 套件:

# 安裝
pip install git+https://github.com/m1guelpf/yt-whisper.git

# 直接從 URL 轉錄
yt_whisper "https://www.youtube.com/watch?v=VIDEO_ID"

# 加上選項
yt_whisper "YOUTUBE_URL" --model medium --language en --output_format srt

輸出格式

格式副檔名說明
txt.txt純文字轉錄稿
srt.srtSubRip 字幕格式(含時間戳記)
vtt.vttWebVTT 字幕格式
tsv.tsv定位點分隔值
json.json完整資料,含逐字時間戳記

範例

指南

  • 如果知道影片的語言,請使用 --language 標記,可顯著提升準確度
  • 對於長影片(超過 1 小時),建議使用 small 或 medium 模型以平衡速度與準確度
  • 純英文模型(.en 後綴)處理英文內容更快、更準確
  • 具備 CUDA 的 GPU 能大幅加快轉錄速度;使用 CPU 則慢 5-10 倍
  • 如果轉錄失敗,請確認 ffmpeg 已正確安裝且位於 PATH 環境變數中
  • 對於背景有音樂的影片,較大的模型(medium/large)處理效果更好
  • 轉錄完成後請清理音訊檔案以節省磁碟空間
  • 使用 --output_format all 一次取得所有格式,再從中選擇所需

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能