SuperAPI AI Directory

ppt-to-video-workflow

Design & creation

View repository

Updated 10-15 20:21

About this skill

PPT to Video Workflow

This is a comprehensive skill that converts PPT/slides into a video with narration and subtitles.

Trigger

Use this skill for requests such as the following:

  • "Make a PPT into a video"
  • "Generate a slide video"
  • "Make a presentation video"
  • "Generate a video with narration"
  • "Make a video with subtitles"
  • "Convert a PPTX file into a video"

Full Workflow

┌─────────────────────────────────────────────────────────────────────┐
│                        입력 소스 (택1)                               │
├─────────────────────────────────────────────────────────────────────┤
│  [PPTX 파일]              또는           [slides.json]              │
│       │                                       │                     │
│       ▼                                       ▼                     │
│  이미지 추출 (python-pptx)          슬라이드 렌더링 (Pillow)         │
│       │                                       │                     │
│       └───────────────┬───────────────────────┘                     │
│                       ▼                                             │
│              slide_01.png, slide_02.png, ...                        │
└─────────────────────────────────────────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      나레이션 생성                                   │
├─────────────────────────────────────────────────────────────────────┤
│  [slides.json + reference_audio.wav]                                │
│       │                                                             │
│       ▼                                                             │
│  Chatterbox TTS API (슬라이드별 음성 생성)                          │
│       │                                                             │
│       ▼                                                             │
│  narration_01.mp3, narration_02.mp3, ... + timing.json              │
└─────────────────────────────────────────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      자막 생성 (선택)                                │
├─────────────────────────────────────────────────────────────────────┤
│  [timing.json]                                                      │
│       │                                                             │
│       ▼                                                             │
│  문장 분할 + ASS 자막 생성                                          │
│       │                                                             │
│       ▼                                                             │
│  subtitle.ass                                                       │
└─────────────────────────────────────────────────────────────────────┘
                        │
                        ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      영상 합성                                       │
├─────────────────────────────────────────────────────────────────────┤
│  [slide_*.png + narration_*.mp3 + subtitle.ass]                     │
│       │                                                             │
│       ▼                                                             │
│  FFmpeg (페이드 전환 + 자막 하드코딩)                               │
│       │                                                             │
│       ▼                                                             │
│  final_video.mp4                                                    │
└─────────────────────────────────────────────────────────────────────┘

Input Format

Option 1: PPTX file

Extract slide images from an existing PPTX file.

from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE_TYPE
from PIL import Image
import io

prs = Presentation("presentation.pptx")
for i, slide in enumerate(prs.slides):
    for shape in slide.shapes:
        if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
            image = Image.open(io.BytesIO(shape.image.blob))
            image.save(f"slide_{i+1:02d}.png")

Option 2: slides.json

Render slides from structured JSON.

{
  "slides": [
    {
      "slide": 1,
      "title": "슬라이드 제목",
      "content": ["항목1", "항목2", "항목3"],
      "narration": "이 슬라이드에서 읽을 전체 대본 텍스트입니다."
    }
  ]
}

Required Files

  • reference_audio.wav: Reference voice for voice cloning (3-10 seconds)

Script

1. render_slides.py

Render slides.json as 1920x1080 images.

# Academic 테마 (기본, 흰색 배경)
python scripts/render_slides.py slides.json -i generated_images/ -o rendered_slides/

# RDF 다크 테마 (골드/청록 강조)
python scripts/render_slides.py slides.json -i generated_images/ -o rendered_slides/ -t rdf

Options:

  • -i, --images: AI-generated image directory
  • -o, --output: Output directory
  • -t, --theme: Theme selection (academic or rdf)

Output: rendered_slides/slide_01.png, slide_02.png, ...

2. generate_narration.py

Generate TTS voice for each slide.

python scripts/generate_narration.py slides.json reference_audio.wav -o narrations/

Options:

  • -o, --output: Output directory
  • -l, --language: Language code (default: ko)

Output:

  • narrations/narration_01.mp3, narration_02.mp3, ...
  • narrations/timing.json (time information + full text)

timing.json structure:

{
  "total_slides": 17,
  "total_duration": 374.96,
  "slides": [
    {
      "slide": 1,
      "audio_file": "narrations/narration_01.mp3",
      "duration": 11.76,
      "text": "전체 나레이션 텍스트..."
    }
  ]
}

3. generate_subtitles.py

Generate an ASS subtitle file from timing.json.

python scripts/generate_subtitles.py narrations/timing.json -o subtitle.ass

Subtitle Splitting Rules:

  • Maximum 2 lines per subtitle
  • Maximum 40 characters per line (based on Korean)
  • Split at punctuation (., !, ?)
  • Ensure a minimum display time of 2 seconds

Output: subtitle.ass

4. create_video.py

Generate a video by compositing images and narration.

# 기본 (자막 없음)
python scripts/create_video.py rendered_slides/ narrations/ -o final_video.mp4

# 자막 포함
python scripts/create_video.py rendered_slides/ narrations/ -o final_video.mp4 --subtitle

# 페이드 효과 없이
python scripts/create_video.py rendered_slides/ narrations/ -o final_video.mp4 --no-fade

Options:

  • -o, --output: Output filename
  • --subtitle: Include subtitles (automatically generates ASS file)
  • --no-fade: Disable fade transition effects

Output:

  • final_video.mp4
  • final_video.ass (when using --subtitle)

Full Workflow Examples

Case 1: Generate a video from slides.json

# 1. 슬라이드 렌더링
python ~/.claude/skills/ppt-to-video-workflow/scripts/render_slides.py \
    slides.json -i generated_images/ -o rendered_slides/ -t rdf

# 2. 나레이션 생성
python ~/.claude/skills/ppt-to-video-workflow/scripts/generate_narration.py \
    slides.json reference_audio.wav -o narrations/

# 3. 영상 합성 (자막 포함)
python ~/.claude/skills/ppt-to-video-workflow/scripts/create_video.py \
    rendered_slides/ narrations/ -o presentation.mp4 --subtitle

Case 2: Generate a video from a PPTX file

# 1. PPTX에서 이미지 추출
from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE_TYPE
from PIL import Image
import io, os

os.makedirs("pptx_slides", exist_ok=True)
prs = Presentation("presentation.pptx")

for i, slide in enumerate(prs.slides):
    for shape in slide.shapes:
        if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
            img = Image.open(io.BytesIO(shape.image.blob))
            img = img.resize((1920, 1080), Image.LANCZOS)
            img.save(f"pptx_slides/slide_{i+1:02d}.png")
            break
# 2. 나레이션 생성 (slides.json 필요)
python ~/.claude/skills/ppt-to-video-workflow/scripts/generate_narration.py \
    slides.json audio.wav -o narrations/

# 3. 영상 합성
python ~/.claude/skills/ppt-to-video-workflow/scripts/create_video.py \
    pptx_slides/ narrations/ -o output.mp4 --subtitle

Case 3: Add only subtitles to an existing video

# 1. 자막 파일 생성
python ~/.claude/skills/ppt-to-video-workflow/scripts/generate_subtitles.py \
    narrations/timing.json -o subtitle.ass

# 2. FFmpeg로 자막 하드코딩
ffmpeg -i input.mp4 -vf "ass=subtitle.ass" -c:a copy output_with_subtitle.mp4

Themes

Academic (default)

  • White background
  • Red accent (#DC3545)
  • Thin top bar
  • Simple bullet points

RDF Dark Theme

  • Dark header (#1A1A1A) + grid dot pattern
  • Gold accent (#F5A623)
  • Teal secondary (#4ECDC4)
  • Gold vertical bar section titles
  • Shadow effect on images
  • Teal bottom bar

Settings

Item 값
Resolution 1920x1080 (Full HD)
FPS 30
Video format MP4 (H.264 + AAC)
Transition effect Fade (0.5 seconds)
Korean font AppleSDGothicNeo, NanumGothic
Theme academic, rdf
Subtitle format ASS (Advanced SubStation Alpha)
Subtitle font AppleSDGothicNeo-Medium (42pt)
Subtitle position Bottom center
Subtitle background Semi-transparent black (50% opacity)

Dependencies

pip install pillow pydub gradio-client python-pptx
  • Python 3.x
  • Pillow: Image rendering
  • FFmpeg: Video compositing (system installation required)
  • pydub: Audio processing
  • gradio-client: Chatterbox TTS API
  • python-pptx: PPTX file processing

Directory structure

ppt-to-video-workflow/
├── SKILL.md                    # 이 문서
└── scripts/
    ├── render_slides.py        # 슬라이드 → 이미지 렌더링
    ├── generate_narration.py   # TTS 나레이션 생성
    ├── generate_subtitles.py   # ASS 자막 생성
    └── create_video.py         # 영상 합성

Related skills

  • academic-ppt-generator: slides.json generation and PPTX conversion
  • chatterbox-tts-workflow: TTS generation (single file)

Expected deliverables

Input:

  • slides.json (title, content, narration)
  • reference_audio.wav (reference voice)

Output:

  • slide_*.png (slide images)
  • narration_*.mp3 (per-slide audio)
  • timing.json (timing information)
  • subtitle.ass (subtitle file)
  • final_video.mp4 (final video)