jpskill.com
✍️ ライティング コミュニティ

youtube-transcription

YouTube動画のURLから、OpenAI Whisperとyt-dlpを使って動画の内容を文字起こしし、字幕の作成や音声コンテンツの抽出など、動画の内容をテキストデータとして活用するSkill。

📜 元の英語説明(参考)

Transcribe YouTube videos to text using OpenAI Whisper and yt-dlp. Use when the user wants to get a transcript from a YouTube video, generate subtitles, convert video speech to text, create SRT/VTT captions, or extract spoken content from YouTube URLs.

🇯🇵 日本人クリエイター向け解説

一言でいうと

YouTube動画のURLから、OpenAI Whisperとyt-dlpを使って動画の内容を文字起こしし、字幕の作成や音声コンテンツの抽出など、動画の内容をテキストデータとして活用するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o youtube-transcription.zip https://jpskill.com/download/15584.zip && unzip -o youtube-transcription.zip && rm youtube-transcription.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15584.zip -OutFile "$d\youtube-transcription.zip"; Expand-Archive "$d\youtube-transcription.zip" -DestinationPath $d -Force; ri "$d\youtube-transcription.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して youtube-transcription.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → youtube-transcription フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

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モデルの選択

Model Parameters VRAM Relative Speed Use Case
tiny 39M ~1 GB ~32x クイックドラフト、テスト
base 74M ~1 GB ~16x 高速な文字起こし
small 244M ~2 GB ~6x 良好なバランス
medium 769M ~5 GB ~2x 高い精度
large 1550M ~10 GB 1x 最高の精度

英語のみのモデル(tiny.enbase.ensmall.enmedium.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. ワンライナーパイプライン

ダウンロードと文字起こしを組み合わせる:

# 1つのコマンドでダウンロードと文字起こし
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

出力形式

Format Extension Description
txt .txt プレーンテキストの文字起こし
srt .srt SubRip字幕形式(タイムスタンプ付き)
vtt .vtt WebVTT字幕形式
tsv .tsv タブ区切り値
json .json ワードレベルのタイムスタンプを含む完全なデータ

<example> User: このYouTubeビデオをテキストに文字起こししてください Steps:

  1. yt-dlp -x --audio-format wav -o "video.wav" "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  2. whisper video.wav --model medium --language en --output_format txt Output: video.txt に完全な文字起こしが含まれます </example>

<example> User: YouTubeの講義のSRT字幕を生成してください Steps:

  1. yt-dlp -x --audio-format wav -o "lecture.wav" "https://www.youtube.com/watch?v=LECTURE_ID"
  2. whisper lecture.wav --model medium --output_format srt Output: lecture.srt にタイムスタンプ付きの字幕が含まれます </example>

<example> User: スペイン語のYouTubeビデオを文字起こししてください Steps:

  1. yt-dlp -x --audio-format wav -o "spanish.wav" "https://www.youtube.com/watch?v=VIDEO_ID"
  2. whisper spanish.wav --model medium --language es --output_format all Output: spanish.txt, spanish.srt, spanish.vtt, spanish.json </example>

<example> User: 短いビデオのクイック文字起こし(精度よりも速度優先) Command: yt-dlp -x --audio-format mp3 -o "quick.mp3" "URL" && whisper quick.mp3 --model tiny.en </example>

<example> User: Pythonでタイムスタンプ付きの文字起こしを取得

import whisper
model = whisper.load_model("medium")
result = model.transcribe("audio.wav")
for seg in result["segments"]:
    print(f"[{seg['start']:.1f}s] {seg['text']}")

</example>

ガイドライン

  • 話されている言語がわかっている場合は、--languageフラグを使用すると、精度が大幅に向上します
  • 長いビデオ(1時間以上)の場合は、速度と精度のバランスを取るためにsmallまたはmediumモデルを使用してください
  • 英語のみのモデル(.enサフィックス)は、英語のコンテンツに対してより高速かつ正確です
  • CUDAを搭載したGPUは文字起こしを劇的に高速化します。CPUでも動作しますが、5〜10倍遅くなります
  • 文字起こしが失敗する場合は、ffmpegが正しくインストールされ、PATHにあることを確認してください
  • BGMのあるビデオの場合、より大きなモデル(medium/large)の方が適切に処理できます
  • ディスク容量を節約するために、文字起こし後にオーディオファイルをクリーンアップしてください
  • 必要なものを選択できるように、--output_format allを使用して、すべての形式を一度に取得してください
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

YouTube Video Transcription

Transcribe YouTube videos to text using OpenAI Whisper and yt-dlp.

Overview

This skill downloads audio from YouTube videos using yt-dlp and transcribes it using OpenAI's Whisper model. Supports multiple output formats (txt, srt, vtt, json) and various model sizes for different accuracy/speed tradeoffs.

Instructions

1. Install dependencies

# Install whisper and yt-dlp
pip install openai-whisper yt-dlp

# Verify ffmpeg is installed (required for audio processing)
ffmpeg -version

If ffmpeg is missing:

2. Download audio from YouTube

# Download best audio quality as WAV
yt-dlp -x --audio-format wav -o "%(title)s.%(ext)s" "YOUTUBE_URL"

# Download as MP3 (smaller file)
yt-dlp -x --audio-format mp3 -o "%(title)s.%(ext)s" "YOUTUBE_URL"

# Download with video ID as filename (safer for special characters)
yt-dlp -x --audio-format wav -o "%(id)s.%(ext)s" "YOUTUBE_URL"

3. Choose Whisper model

Model Parameters VRAM Relative Speed Use Case
tiny 39M ~1 GB ~32x Quick drafts, testing
base 74M ~1 GB ~16x Fast transcription
small 244M ~2 GB ~6x Good balance
medium 769M ~5 GB ~2x High accuracy
large 1550M ~10 GB 1x Best accuracy

English-only models (tiny.en, base.en, small.en, medium.en) are faster for English content.

4. Run transcription

CLI approach:

# Basic transcription (auto-detect language)
whisper audio.wav --model medium

# Specify language for better accuracy
whisper audio.wav --model medium --language en

# Output specific format
whisper audio.wav --model medium --output_format srt

# All formats at once
whisper audio.wav --model medium --output_format all

# Specify output directory
whisper audio.wav --model medium --output_dir ./transcripts

Python approach:

import whisper

# Load model (downloads on first run)
model = whisper.load_model("medium")

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

# Get plain text
print(result["text"])

# Get segments with timestamps
for segment in result["segments"]:
    print(f"[{segment['start']:.2f} - {segment['end']:.2f}] {segment['text']}")

5. One-liner pipeline

Combine download and transcription:

# Download and transcribe in one command
yt-dlp -x --audio-format wav -o "audio.wav" "YOUTUBE_URL" && whisper audio.wav --model medium --output_format all

6. Alternative: yt-whisper tool

For simpler workflow, use the dedicated yt-whisper package:

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

# Transcribe directly from URL
yt_whisper "https://www.youtube.com/watch?v=VIDEO_ID"

# With options
yt_whisper "YOUTUBE_URL" --model medium --language en --output_format srt

Output Formats

Format Extension Description
txt .txt Plain text transcript
srt .srt SubRip subtitle format (with timestamps)
vtt .vtt WebVTT subtitle format
tsv .tsv Tab-separated values
json .json Full data with word-level timestamps

Examples

<example> User: Transcribe this YouTube video to text Steps:

  1. yt-dlp -x --audio-format wav -o "video.wav" "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  2. whisper video.wav --model medium --language en --output_format txt Output: video.txt with full transcript </example>

<example> User: Generate SRT subtitles for a YouTube lecture Steps:

  1. yt-dlp -x --audio-format wav -o "lecture.wav" "https://www.youtube.com/watch?v=LECTURE_ID"
  2. whisper lecture.wav --model medium --output_format srt Output: lecture.srt with timestamped subtitles </example>

<example> User: Transcribe a Spanish YouTube video Steps:

  1. yt-dlp -x --audio-format wav -o "spanish.wav" "https://www.youtube.com/watch?v=VIDEO_ID"
  2. whisper spanish.wav --model medium --language es --output_format all Output: spanish.txt, spanish.srt, spanish.vtt, spanish.json </example>

<example> User: Quick transcription of a short video (speed over accuracy) Command: yt-dlp -x --audio-format mp3 -o "quick.mp3" "URL" && whisper quick.mp3 --model tiny.en </example>

<example> User: Get transcript with timestamps in Python

import whisper
model = whisper.load_model("medium")
result = model.transcribe("audio.wav")
for seg in result["segments"]:
    print(f"[{seg['start']:.1f}s] {seg['text']}")

</example>

Guidelines

  • Use --language flag when you know the spoken language for significantly better accuracy
  • For long videos (>1 hour), use small or medium model to balance speed and accuracy
  • English-only models (.en suffix) are faster and more accurate for English content
  • GPU with CUDA dramatically speeds up transcription; CPU works but is 5-10x slower
  • If transcription fails, ensure ffmpeg is properly installed and in PATH
  • For videos with background music, larger models (medium/large) handle it better
  • Clean up audio files after transcription to save disk space
  • Use --output_format all to get every format at once, then choose what you need