Communitygithub.com

YouTube動画文字起こし (YouTube Video Transcription)

OpenAI Whisper と yt-dlp を使って YouTube 動画をテキストに文字起こしします。

YouTube動画文字起こし (YouTube Video Transcription) とは?

このスキルは、yt-dlp を使って YouTube 動画から音声をダウンロードし、OpenAI の Whisper モデルで文字起こしを行うものです。複数の出力形式(txt、srt、vtt、json)と様々なモデルサイズ(tiny から large まで)に対応しており、精度と速度のトレードオフを調整できます。コマンドラインインターフェースと Python API の両方をサポートしており、ワンライナーでダウンロードから文字起こしまでを実行することも可能です。特に長尺動画や複数言語の動画に対して、柔軟な文字起こしソリューションを提供します。対応プラットフォームは、macOS、Ubuntu/Debian、Windows です。

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

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

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 でダウンロード(ファイルサイズ小)
yt-dlp -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

関連スキル