Communitygithub.com

YouTube 동영상 텍스트 변환 (Transcription)

OpenAI Whisper와 yt-dlp를 사용하여 YouTube 동영상을 텍스트로 변환합니다. 사용자가 YouTube 동영상에서 자막을 생성하거나, 음성을 텍스트로 추출하거나, SRT/VTT 캡션을 만들고자 할 때 유용합니다.

YouTube 동영상 텍스트 변환 (Transcription)란 무엇인가요?

이 스킬은 YouTube 동영상의 오디오를 다운로드하고 OpenAI Whisper 모델을 사용하여 텍스트로 변환하는 종합적인 도구입니다. yt-dlp로 최상의 오디오 품질을 WAV 또는 MP3 형식으로 추출한 후, Whisper의 다양한 모델(tiny, base, small, medium, large) 중에서 정확도와 속도 간의 균형에 맞게 선택하여 변환합니다. SRT, VTT, JSON, TXT 등 여러 출력 형식을 지원하며, 특정 언어를 지정하면 정확도가 크게 향상됩니다. 긴 동영상이나 배경 음악이 있는 콘텐츠의 경우 medium 또는 large 모델을 권장하며, GPU(CUDA)를 사용하면 변환 속도가 비약적으로 빨라집니다. 이 스킬은 Claude Code, Cursor, Codex 등 AI 에이전트 환경에서 사용하기 적합하며, 명령줄(CLI) 또는 Python 코드로 쉽게 통합할 수 있습니다.

지원 대상~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/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단어 수준 타임스탬프를 포함한 전체 데이터

예제

<예제> 사용자: 이 YouTube 동영상을 텍스트로 변환해 줘 단계:

  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 출력: 전체 변환 내용이 담긴 video.txt </예제>

<예제> 사용자: YouTube 강의의 SRT 자막을 생성해 줘 단계:

  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 출력: 타임스탬프가 포함된 lecture.srt 자막 파일 </예제>

<예제> 사용자: 스페인어 YouTube 동영상을 변환해 줘 단계:

  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 출력: spanish.txt, spanish.srt, spanish.vtt, spanish.json </예제>

<예제> 사용자: 짧은 동영상 빠르게 변환 (정확도보다 속도 우선) 명령어: yt-dlp -x --audio-format mp3 -o "quick.mp3" "URL" && whisper quick.mp3 --model tiny.en </예제>

<예제> 사용자: 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']}")

</예제>

지침

  • --language 플래그를 사용하여 언어를 알 때 지정하면 정확도가 크게 향상됩니다.
  • 긴 동영상(1시간 이상)의 경우 small 또는 medium 모델을 사용하여 속도와 정확도의 균형을 맞추세요.
  • 영어 전용 모델(.en 접미사)은 영어 콘텐츠에 대해 더 빠르고 정확합니다.
  • GPU(CUDA)를 사용하면 변환 속도가 비약적으로 빨라집니다. 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.

TerminalSkills/skills

>- Run GitHub Actions locally with act. Use when a user asks to test GitHub Actions workflows locally, debug CI pipelines without pushing, or run workflows offline.

TerminalSkills/skills

>- You are an expert in AG2 (formerly AutoGen), the open-source multi-agent conversation framework. You help developers build systems where multiple AI agents collaborate through structured conversations — with tool use, human-in-the-loop, code execution, group chat orchestration, and nested conversations — for complex tasks like software development, research, and data analysis.

TerminalSkills/skills

>- Generate short-form videos with AI — script writing, text-to-speech narration, stock footage selection, subtitle generation, and video assembly. Use when: creating TikTok/YouTube Shorts/Reels content, automating video production, building content pipelines.

TerminalSkills/skills

>- Animate 3D objects and characters in Blender with Python. Use when the user wants to keyframe properties, create armatures and rigs, set up IK/FK chains, animate shape keys for facial animation, edit F-Curves, use the NLA editor to blend actions, add drivers for expression-based animation, or script any animation workflow in Blender.

TerminalSkills/skills

>- Automate motion capture and tracking workflows in Blender with Python. Use when the user wants to import BVH or FBX mocap data, retarget motion to armatures, track camera or object motion from video, solve camera motion, clean up motion capture data, or script any tracking pipeline in Blender.

TerminalSkills/skills

>- You are an expert in Bolt.new by StackBlitz, the AI-powered full-stack development environment that runs entirely in the browser. You help developers go from idea to deployed app in minutes using natural language prompts — Bolt generates complete applications with frontend, backend, database, and deployment, all running in a WebContainer without local setup.

TerminalSkills/skills

>- Assists with using Bun as an all-in-one JavaScript/TypeScript runtime, package manager, bundler, and test runner. Use when building HTTP servers, managing packages, running tests, or migrating from Node.js. Trigger words: bun, bun serve, bun install, bun test, bun build, javascript runtime, bun runtime.

TerminalSkills/skills

>- Self-host customer support with Chatwoot. Use when a user asks to set up open-source customer support, add live chat without SaaS costs, build a multi-channel inbox, or deploy a free Intercom alternative.

TerminalSkills/skills

>- You are an expert in Chi, the lightweight, idiomatic Go HTTP router built on `net/http`. You help developers build composable HTTP services using Chi's middleware stack, route groups, URL parameters, sub-routers, and context-based request scoping — providing Express-like ergonomics while staying 100% compatible with Go's standard library.

TerminalSkills/skills

When the user wants to edit, review, or improve existing marketing copy. Also use when the user mentions 'edit this copy,' 'review my copy,' 'copy feedback,' 'proofread,' 'polish this,' 'make this better,' or 'copy sweep.' This skill provides a systematic approach to editing marketing copy through multiple focused passes.

TerminalSkills/skills

>- Add live chat and customer support with Crisp. Use when a user asks to add a chat widget, implement live customer support, set up a help desk, create a knowledge base, or add a chatbot to a website.

TerminalSkills/skills

>- Assists with building custom interactive data visualizations using D3.js. Use when creating charts, graphs, maps, force layouts, or hierarchical diagrams that require fine-grained control beyond what charting libraries provide. Trigger words: d3, data visualization, chart, svg, scales, force graph, treemap, choropleth.

TerminalSkills/skills

dbt (data build tool) transforms data in your warehouse using SQL SELECT statements. Learn project setup, models, tests, documentation, incremental materializations, and integration with data warehouses like PostgreSQL, BigQuery, and Snowflake.

TerminalSkills/skills

>- You are an expert in dlt, the open-source Python library for building data pipelines. You help developers load data from any API, file, or database into warehouses and lakes using simple Python decorators — with automatic schema inference, incremental loading, and built-in data contracts. dlt is the "requests library for data pipelines.

TerminalSkills/skills

Data Version Control for ML projects. Track large datasets and models alongside Git, build reproducible ML pipelines, and run experiments with metric comparison. Works with any storage backend including S3, GCS, Azure, and local filesystems.

TerminalSkills/skills

>- You are an expert in E2B, the cloud platform for running AI-generated code in secure sandboxes. You help developers give AI agents the ability to execute code, install packages, read/write files, and run long processes in isolated cloud environments — each sandbox is a lightweight VM that boots in ~150ms with full Linux, filesystem, and networking.

TerminalSkills/skills

>- Transcode, convert, edit, and process audio and video with FFmpeg. Use when a user asks to convert video formats (webm to mp4, mkv to mp4), extract audio from video, compress video files, trim or cut clips, concatenate videos, add subtitles, create thumbnails, apply filters, change resolution or bitrate, re-encode media, create GIFs from video, add watermarks, normalize audio, stream media, or build automated media processing pipelines.

TerminalSkills/skills

>- Create advanced animations with GSAP. Use when building complex timelines, scroll-driven animations, SVG morphing, text animations, or high-performance web animations beyond CSS capabilities.

TerminalSkills/skills

>- Generate deterministic MP4 videos from HTML, CSS, media, and seekable animations using HeyGen's HyperFrames framework. Use when someone asks to "render HTML to video", "make a video with HyperFrames", "create a programmatic video", "turn an animation into MP4", "build a launch/product video from HTML", "render GSAP/Lottie/Three.js to video", or set up an agent-driven video pipeline. Covers init/preview/render/add/lint/inspect commands, data-* timing attributes, animation adapters, and the component catalog.

TerminalSkills/skills

When the user wants to perform load testing, stress testing, or performance testing of APIs and websites using k6. Also use when the user mentions "k6," "load test," "performance test," "stress test," "spike test," "soak test," "thresholds," "virtual users," or "VUs." For browser-based testing, see selenium.

관련 스킬