video-production

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Video Production

视频制作

Overview

概述

Assemble course videos from individual lesson files with title slides and auto-generated timestamps for YouTube.
将单个课时文件整合为带标题幻灯片和自动生成时间戳的课程视频,用于YouTube发布。

Quick Decision Tree

快速决策树

What do you need?
├── Full course assembly (end-to-end)
│   └── references/workflow.md
│   └── Combines all scripts below
├── Download videos from Drive
│   └── Script: scripts/gdrive_video_download.py
├── Create title slides
│   └── Script: scripts/create_title_slides.py
├── Stitch videos together
│   └── Script: scripts/stitch_videos.py
└── Generate YouTube description
    └── Script: scripts/generate_youtube_description.py
你需要什么?
├── 完整课程整合(端到端)
│   └── references/workflow.md
│   └── 整合以下所有脚本
├── 从Drive下载视频
│   └── 脚本:scripts/gdrive_video_download.py
├── 制作标题幻灯片
│   └── 脚本:scripts/create_title_slides.py
├── 拼接视频
│   └── 脚本:scripts/stitch_videos.py
└── 生成YouTube描述
    └── 脚本:scripts/generate_youtube_description.py

Environment Setup

环境设置

Google Drive OAuth (same as google-workspace skill).
Google Drive OAuth(与google-workspace技能相同)。

System Requirements

系统要求

  • FFmpeg installed and in PATH
  • Python 3.9+
  • 已安装FFmpeg并添加至系统PATH
  • Python 3.9及以上版本

Complete Workflow

完整工作流

bash
undefined
bash
undefined

Full course assembly from Drive folder

从Drive文件夹整合完整课程

python scripts/stitch_videos.py
--folder "https://drive.google.com/drive/folders/xxx"
--output "Complete Course.mp4"
--slide-duration 3
undefined
python scripts/stitch_videos.py
--folder "https://drive.google.com/drive/folders/xxx"
--output "Complete Course.mp4"
--slide-duration 3
undefined

Pipeline Steps

流水线步骤

  1. Download - Get all videos from Drive folder
  2. Parse Titles - Extract clean names from
    [e1] Intro
    format
  3. Get Metadata - FFprobe for duration/resolution
  4. Generate Slides - Title card for each lesson
  5. Build Concat List - video1 → slide2 → video2 → ...
  6. Stitch with FFmpeg - Concatenate all segments
  7. Calculate Timestamps - Track cumulative duration
  8. Generate Description - YouTube-ready markdown
  1. 下载 - 从Drive文件夹获取所有视频
  2. 解析标题 - 从
    [e1] Intro
    格式中提取清晰名称
  3. 获取元数据 - 使用FFprobe获取时长/分辨率
  4. 生成幻灯片 - 为每个课时制作标题卡片
  5. 构建拼接列表 - video1 → slide2 → video2 → ...
  6. 用FFmpeg拼接 - 合并所有片段
  7. 计算时间戳 - 跟踪累计时长
  8. 生成描述 - 生成符合YouTube要求的markdown格式描述

Outputs

输出文件

FileDescription
{output_name}.mp4
Final stitched video
youtube_description.md
Timestamped description
metadata.json
Processing info
文件描述
{output_name}.mp4
最终拼接完成的视频
youtube_description.md
带时间戳的描述文件
metadata.json
处理信息记录

Performance

性能表现

InputTimeOutput Size
5 videos (30 min)~5 min~1.5 GB
10 videos (1 hr)~10 min~3 GB
20 videos (2 hr)~20 min~6 GB
输入耗时输出大小
5个视频(30分钟)~5分钟~1.5 GB
10个视频(1小时)~10分钟~3 GB
20个视频(2小时)~20分钟~6 GB

Security Notes

安全说明

Credential Handling

凭证处理

  • Google OAuth credentials for Drive access (see google-workspace skill)
  • mycreds.txt
    and
    client_secrets.json
    never committed to git
  • No additional API keys required for local video processing
  • 用于Drive访问的Google OAuth凭证(参考google-workspace技能)
  • mycreds.txt
    client_secrets.json
    绝不提交至git
  • 本地视频处理无需额外API密钥

Data Privacy

数据隐私

  • All video processing happens locally using FFmpeg
  • No video content is uploaded to external cloud services
  • Source videos downloaded from Google Drive to local
    .tmp/
  • Final videos stored locally until manually uploaded
  • Metadata JSON contains file names and timestamps only
  • 所有视频处理通过FFmpeg在本地完成
  • 视频内容不会上传至外部云服务
  • 源视频从Google Drive下载至本地
    .tmp/
    目录
  • 最终视频存储在本地,直到手动上传
  • Metadata JSON仅包含文件名和时间戳信息

Access Scopes

访问权限范围

  • Google Drive:
    drive.readonly
    sufficient for downloading
  • Google Drive:
    drive
    required for uploading final videos
  • No external video processing APIs used
  • Google Drive:仅
    drive.readonly
    权限即可完成下载
  • Google Drive:上传最终视频需要
    drive
    权限
  • 未使用任何外部视频处理API

Compliance Considerations

合规注意事项

  • Local Processing: All encoding/stitching done locally (privacy-preserving)
  • No Cloud Upload: Videos never leave your machine during processing
  • Content Rights: Ensure you have rights to source video content
  • Course Content: Verify licensing for educational content distribution
  • YouTube ToS: Generated descriptions comply with YouTube guidelines
  • Storage: Large video files require adequate local disk space
  • Cleanup: Remove temporary files from
    .tmp/
    after processing
  • 本地处理:所有编码/拼接操作在本地完成(隐私保护)
  • 无云上传:处理过程中视频绝不会离开你的设备
  • 内容权限:确保你拥有源视频内容的使用权限
  • 课程内容:验证教育内容分发的许可协议
  • YouTube服务条款:生成的描述符合YouTube指南
  • 存储:大型视频文件需要足够的本地磁盘空间
  • 清理:处理完成后删除
    .tmp/
    目录下的临时文件

Troubleshooting

故障排除

Common Issues

常见问题

Issue: FFmpeg not found

问题:未找到FFmpeg

Symptoms: "FFmpeg not found" or "command not found: ffmpeg" Cause: FFmpeg not installed or not in system PATH Solution:
  • Install FFmpeg:
    brew install ffmpeg
    (macOS) or download from ffmpeg.org
  • Verify installation:
    ffmpeg -version
  • Add FFmpeg to PATH if installed in non-standard location
  • Restart terminal after installation
症状:提示“FFmpeg not found”或“command not found: ffmpeg” 原因:未安装FFmpeg或未添加至系统PATH 解决方案
  • 安装FFmpeg:macOS使用
    brew install ffmpeg
    ,或从ffmpeg.org下载
  • 验证安装:执行
    ffmpeg -version
  • 若安装在非标准位置,需将FFmpeg添加至PATH
  • 安装完成后重启终端

Issue: Codec mismatch / incompatible videos

问题:编解码器不匹配/视频不兼容

Symptoms: "Non-monotonous DTS" or codec errors during stitching Cause: Source videos have different codecs, resolutions, or frame rates Solution:
  • Re-encode all source videos to the same format before stitching
  • Use FFmpeg to normalize:
    ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mp4
  • Ensure consistent resolution (e.g., all 1920x1080)
  • Match frame rates across all videos (e.g., all 30fps)
症状:拼接时出现“Non-monotonous DTS”或编解码器错误 原因:源视频的编解码器、分辨率或帧率不同 解决方案
  • 拼接前将所有源视频重新编码为相同格式
  • 使用FFmpeg标准化:
    ffmpeg -i input.mp4 -c:v libx264 -c:a aac output.mp4
  • 确保分辨率一致(如均为1920x1080)
  • 所有视频的帧率保持一致(如均为30fps)

Issue: Audio out of sync

问题:音视频不同步

Symptoms: Audio drifts from video over time Cause: Inconsistent frame rates or variable frame rate sources Solution:
  • Use constant frame rate for all source videos
  • Re-encode with
    -vsync cfr
    flag
  • Avoid mixing video from different sources/devices
  • Check audio sample rates match across files
症状:播放过程中音频逐渐与视频脱节 原因:帧率不一致或源视频为可变帧率 解决方案
  • 所有源视频使用恒定帧率
  • 添加
    -vsync cfr
    参数重新编码
  • 避免混合不同来源/设备的视频
  • 检查所有文件的音频采样率是否匹配

Issue: Insufficient disk space

问题:磁盘空间不足

Symptoms: "No space left on device" or incomplete output Cause: Not enough free space for video processing Solution:
  • Check available disk space:
    df -h
  • Clear
    .tmp/
    directory of old files
  • Move large source videos to external drive
  • Process fewer videos at once
症状:提示“No space left on device”或输出文件不完整 原因:视频处理所需的可用空间不足 解决方案
  • 检查可用磁盘空间:执行
    df -h
  • 清理
    .tmp/
    目录下的旧文件
  • 将大型源视频移至外部驱动器
  • 减少单次处理的视频数量

Issue: Google Drive download fails

问题:Google Drive下载失败

Symptoms: Videos fail to download from Drive folder Cause: OAuth issue, permissions, or network timeout Solution:
  • Verify Google OAuth credentials (see google-workspace skill)
  • Check folder sharing permissions
  • Try downloading single file first to test
  • Check for network connectivity issues
症状:无法从Drive文件夹下载视频 原因:OAuth问题、权限不足或网络超时 解决方案
  • 验证Google OAuth凭证(参考google-workspace技能)
  • 检查文件夹共享权限
  • 先尝试下载单个文件进行测试
  • 检查网络连接是否正常

Issue: Title slides not generating

问题:标题幻灯片未生成

Symptoms: Missing title cards in final video Cause: Font or image generation issue Solution:
  • Verify ImageMagick or Pillow is installed
  • Check font files exist if custom fonts specified
  • Review title text for special characters
  • Try with default font settings first
症状:最终视频中缺少标题卡片 原因:字体或图片生成问题 解决方案
  • 验证是否已安装ImageMagick或Pillow
  • 若使用自定义字体,检查字体文件是否存在
  • 检查标题文本是否包含特殊字符
  • 先尝试使用默认字体设置

Resources

资源

  • references/workflow.md - Complete video course workflow
  • references/workflow.md - 完整视频课程工作流文档

Integration Patterns

集成模式

Full Course Pipeline

完整课程流水线

Skills: google-workspace → video-production → google-workspace Use case: End-to-end course video assembly Flow:
  1. Download lesson videos from Google Drive folder
  2. Generate title slides and stitch all videos together
  3. Upload final video back to Drive and generate YouTube description
技能组合:google-workspace → video-production → google-workspace 使用场景:端到端课程视频整合 流程
  1. 从Google Drive文件夹下载课时视频
  2. 生成标题幻灯片并拼接所有视频
  3. 将最终视频上传回Drive并生成YouTube描述

Transcript to Timestamps

转录文本转时间戳

Skills: transcript-search → video-production Use case: Generate YouTube descriptions from meeting recordings Flow:
  1. Search transcripts for relevant meetings
  2. Extract topic timestamps from transcript
  3. Generate formatted YouTube description with chapter markers
技能组合:transcript-search → video-production 使用场景:从会议录制生成YouTube描述 流程
  1. 搜索转录文本找到相关会议
  2. 从转录文本中提取主题时间戳
  3. 生成带章节标记的格式化YouTube描述

Content to Title Slides

内容转标题幻灯片

Skills: content-generation → video-production Use case: Create branded title cards for videos Flow:
  1. Generate title slide images with content-generation
  2. Export slides in video-compatible format
  3. Insert title slides between video segments
技能组合:content-generation → video-production 使用场景:为视频创建品牌化标题卡片 流程
  1. 通过content-generation生成标题幻灯片图片
  2. 导出为视频兼容格式的幻灯片
  3. 在视频片段之间插入标题幻灯片