Communitygithub.com

AI 비디오 생성기 — 숏폼 콘텐츠 파이프라인

AI를 활용하여 숏폼 비디오(틱톡, 유튜브 쇼츠, 인스타그램 릴스)를 자동으로 생성합니다. 스크립트 작성, 텍스트 음성 변환, 스톡 푸티지 선택, 자막 생성 및 최종 비디오 조립까지 전 과정을 자동화합니다.

AI 비디오 생성기 — 숏폼 콘텐츠 파이프라인란 무엇인가요?

이 스킬은 숏폼 비디오 콘텐츠 제작의 전 과정을 AI로 자동화하는 방법을 제공합니다. 틱톡, 유튜브 쇼츠, 인스타그램 릴스와 같은 플랫폼에 최적화된 비디오를 생성하며, 스크립트 작성(Claude 또는 OpenAI), 텍스트 음성 변환(ElevenLabs 또는 OpenAI TTS), 스톡 푸티지 검색(Pexels API), 자막 생성(WhisperX), 그리고 FFmpeg를 이용한 최종 비디오 조립까지 단계별로 구현합니다. MoneyPrinterTurbo 프로젝트(53k+ 스타)에서 영감을 받았으며, Python 환경에서 pip로 필요한 라이브러리를 설치하고 API 키만 준비하면 바로 사용할 수 있습니다. 주요 기능으로는 45초 분량의 최적화된 스크립트 생성, 두 가지 TTS 엔진 지원, 세로 방향(1080x1920) 비디오 조립, 워드 레벨 자막 정렬 등이 포함되어 있어 콘텐츠 크리에이터나 자동화 파이프라인 구축자에게 매우 유용합니다.

지원 대상✓Claude Code✓Codex CLI✓Cursor✓Gemini CLI
npx skills add https://github.com/TerminalSkills/skills/tree/HEAD/skills/ai-video-generator

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

AI 비디오 생성기 — 숏폼 콘텐츠 파이프라인은(는) 무엇을 하나요?

개요

AI를 사용하여 숏폼 비디오(틱톡, 유튜브 쇼츠, 인스타그램 릴스) 제작의 모든 단계를 자동화합니다: 주제 연구, 스크립트 작성, 텍스트 음성 변환, 스톡 푸티지 매칭, 자막 생성 및 최종 조립. MoneyPrinterTurbo(53k+ 스타)에서 영감을 받았습니다.

지침

1단계: 환경 설정

pip install anthropic openai requests moviepy pydub whisperx srt
sudo apt install ffmpeg  # Linux — 또는: brew install ffmpeg (macOS)

필요한 API 키: Anthropic 또는 OpenAI(스크립트), ElevenLabs 또는 OpenAI TTS(음성), Pexels(무료 스톡 푸티지).

2단계: AI 스크립트 작성

import anthropic

def generate_script(topic, duration_seconds=45):
    """숏폼 콘텐츠에 최적화된 비디오 스크립트를 생성합니다."""
    client = anthropic.Anthropic()
    prompt = f"""다음 주제에 대한 {duration_seconds}초 비디오 스크립트를 작성하세요: {topic}
    형식:
    HOOK (처음 3초): 스크롤을 멈추게 하는 놀라운 문장이나 질문
    BODY (본문): 각각 1-2문장으로 구성된 3-5개의 강력한 사실 또는 포인트
    CTA (마지막 5초): 행동 유도 — 팔로우, 좋아요, 댓글
    규칙:
    - 대화체, 복잡한 문장 금지
    - 각 문장은 별도 줄에 작성
    - 약 {duration_seconds * 2.5:.0f} 단어 ({duration_seconds}초, 분당 150단어 기준)
    - 강력한 단어 사용: 비밀, 충격적, 아무도 알려주지 않는, 실제로
    - 이모지나 해시태그 금지 — 이것은 음성 해설 스크립트입니다
    """
    response = client.messages.create(
        model="claude-sonnet-4-20250514", max_tokens=500,
        messages=[{"role": "user", "content": prompt}]
    )
    return response.content[0].text

3단계: 텍스트 음성 변환(TTS) 나레이션

import requests, os

def generate_voice_elevenlabs(text, output_path='narration.mp3'):
    """ElevenLabs를 사용하여 음성 해설을 생성합니다."""
    url = "https://api.elevenlabs.io/v1/text-to-speech/21m00Tcm4TlvDq8ikWAM"
    headers = {"xi-api-key": os.environ["ELEVENLABS_API_KEY"], "Content-Type": "application/json"}
    data = {"text": text, "model_id": "eleven_turbo_v2_5",
            "voice_settings": {"stability": 0.5, "similarity_boost": 0.75}}
    response = requests.post(url, json=data, headers=headers)
    with open(output_path, 'wb') as f:
        f.write(response.content)
    return output_path

def generate_voice_openai(text, output_path='narration.mp3'):
    """OpenAI TTS를 사용하여 음성 해설을 생성합니다 (더 저렴한 대안)."""
    from openai import OpenAI
    client = OpenAI()
    response = client.audio.speech.create(model="tts-1-hd", voice="onyx", input=text)
    response.stream_to_file(output_path)
    return output_path

4단계: 스톡 푸티지 선택

def search_pexels_videos(query, count=5):
    """Pexels에서 세로 방향의 스톡 비디오 클립을 검색합니다."""
    url = "https://api.pexels.com/videos/search"
    headers = {"Authorization": os.environ["PEXELS_API_KEY"]}
    params = {"query": query, "per_page": count, "orientation": "portrait", "size": "medium"}
    response = requests.get(url, headers=headers, params=params)
    videos = response.json().get('videos', [])
    results = []
    for v in videos:
        files = sorted(v['video_files'], key=lambda x: x.get('height', 0), reverse=True)
        hd = next((f for f in files if f.get('height', 0) >= 720), files[0])
        results.append({'id': v['id'], 'url': hd['link'], 'duration': v['duration']})
    return results

5단계: 자막 생성

def generate_subtitles(audio_path, output_srt='subtitles.srt'):
    """WhisperX를 사용하여 단어 수준의 자막을 생성합니다."""
    import whisperx, srt
    from datetime import timedelta
    model = whisperx.load_model("base", device="cpu")
    audio = whisperx.load_audio(audio_path)
    result = model.transcribe(audio)
    align_model, metadata = whisperx.load_align_model(language_code="en")
    aligned = whisperx.align(result["segments"], align_model, metadata, audio)
    subs = []
    words = [w for seg in aligned["segments"] for w in seg.get("words", [])]
    for i in range(0, len(words), 4):
        group = words[i:i + 4]
        if not group: continue
        start = timedelta(seconds=group[0].get('start', 0))
        end = timedelta(seconds=group[-1].get('end', 0))
        text = ' '.join(w['word'] for w in group)
        subs.append(srt.Subtitle(index=len(subs)+1, start=start, end=end, content=text))
    with open(output_srt, 'w') as f:
        f.write(srt.compose(subs))
    return output_srt

6단계: FFmpeg를 사용한 비디오 조립

import subprocess

def assemble_video(clips, narration, subtitles, output='final.mp4'):
    """최종 비디오 조립: 클립 연결, 나레이션 및 자막 추가."""
    concat_list = 'concat_list.txt'
    with open(concat_list, 'w') as f:
        for clip in clips:
            f.write(f"file '{clip}'\n")
    subprocess.run([
        'ffmpeg', '-y', '-f', 'concat', '-safe', '0', '-i', concat_list,
        '-vf', 'scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920',
        '-c:v', 'libx264', '-preset', 'fast', '-an', 'temp_video.mp4'
    ], check=True)
    subtitle_filter = (f"subtitles={subtitles}:force_style='"
        "FontName=Arial,FontSize=18,PrimaryColour=&H00FFFFFF,"
        "OutlineColour=&H00000000,Outline=2,Bold=1,Alignment=2'")
    subprocess.run([
        'ffmpeg', '-y', '-i', 'temp_video.mp4', '-i', narration,
        '-vf', subtitle_filter, '-c:v', 'libx264', '-c:a', 'aac',
        '-shortest', output
    ], check=True)
    return output

7단계: 전체 파이프라인

def generate_video(topic, output_dir='./output'):
    """완전한 파이프라인: 주제 -> 완성된 비디오."""
    import os
    os.makedirs(output_dir, exist_ok=True)
    script = generate_script(topic)
    narration = generate_voice_elevenlabs(script, f'{output_dir}/narration.mp3')
    keywords = topic.split()[:3]
    videos = search_pexels_videos(' '.join(keywords), count=3)
    clips = []
    for i, v in enumerate(videos):
        path = f'{output_dir}/clip_{i}.mp4'
        requests.get(v['url'], stream=True)  # 클립 다운로드
        clips.append(path)
    subs = generate_subtitles(narration, f'{output_dir}/subs.srt')
    return assemble_video(clips, narration, subs, f'{output_dir}/final.mp4')

예제

예제 1: 기술 팁 비디오 배치 생성

크리에이터가 한 번의 실행으로 틱톡용 기술 테마 숏폼 비디오 5개를 제작합니다:

topics = [
    "아무도 말하지 않는 AI 도구",
    "무료로 사용하기에 죄책감 드는 앱",
    "당신의 마음을 사로잡을 웹사이트",
    "모든 학생이 알아야 할 무료 AI 도구",
    "50달러 미만으로 내 인생을 바꾼 테크 기기"
]
for topic in topics:
    output = generate_video(topic, output_dir=f'./output/{topic[:30]}')
    print(f"비디오 준비 완료: {output}")
# 각 비디오: ~45초, 세로 1080x1920, 자막 및 나레이션 포함
# 총 비용: ~$0.25 (비디오당 $0.05 x 5) ElevenLabs + Claude Sonnet 사용

예제 2: 유튜브용 일일 금융 쇼츠

한 금융 채널이 트렌딩 머니 주제로 일일 쇼츠 업로드를 자동화합니다:

import schedule

def daily_finance_video():
    topic = "2025년에 실제로 효과가 있는 3가지 패시브 인컴 아이디어"
    script = generate_script(topic, duration_seconds=55)
    # 스크립트 출력:
    # HOOK: "이것들을 몰라서 매일 돈을 잃고 있습니다."
    # BODY: 1. 주문형 인쇄 스토어 ($500-2k/월)
    #       2. AI 생성 콘텐츠 라이선싱 ($300-1k/월)
    #       3. 배당 ETF 스태킹 ($200-800/월 패시브)
    # CTA: "아무도 말해주지 않는 돈 관련 팁을 위해 팔로우하세요."
    narration = generate_voice_openai(script, './daily/narration.mp3')
    videos = search_pexels_videos("money finance investing", count=4)
    # 돈/차트/라이프스타일 푸티지의 세로 클립 4개 다운로드
    # 굵은 흰색 자막과 함께 55초 쇼츠로 조립
    final = assemble_video(['./daily/clip_0.mp4', './daily/clip_1.mp4'],
                           narration, './daily/subs.srt', './daily/final.mp4')

schedule.every().day.at("08:00").do(daily_finance_video)

지침

  • 저작권 존중 — 로열티 프리 스톡 푸티지(Pexels, Pixabay) 또는 자신의 콘텐츠만 사용
  • AI 사용 공개 — YouTube와 TikTok은 AI 생성 콘텐츠 공개를 요구합니다
  • 게시 전 검토 — 항상 최종 비디오를 시청하세요. AI 스크립트에는 부정확성이 포함될 수 있습니다
  • 처음 3초 최적화 — 후크가 시청자의 이탈 여부를 결정합니다
  • 여러 음성 테스트 — ElevenLabs는 수십 가지 음성을 제공합니다. 자신의 분야에 맞는 음성을 찾으세요
  • 성과 모니터링 — 조회수, 유지율, 클릭률을 추적하여 콘텐츠 스타일을 반복 개선하세요

참고 자료

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

>- 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.

TerminalSkills/skills

>- Lovable (formerly GPT Engineer) is a browser-based AI app builder that turns a natural-language description into a working full-stack web app with a built-in backend, authentication, database and one-click publishing. Use when the user wants to prototype or ship a web app with Lovable, write effective Lovable prompts, connect Supabase or GitHub, review generated security rules, or move a Lovable project into their own editor.

관련 스킬