video-subtitle-skill 是做什么的?
AI 驱动的视频字幕与文字叠加技能,适用于 Claude Code —— 专为 Shorts/TikTok/Reels 等短视频平台设计的动画标题工具。
功能概述
该技能利用 AI 自动生成和叠加视频字幕,提供以下核心功能:
- 自动字幕生成:基于视频语音或脚本,智能创建时间轴对齐的字幕。
- 动画标题效果:支持多种动态文本样式,适合短视频平台的快节奏需求。
- 自定义样式:允许调整字体、颜色、大小、位置及动画速度。
- 多语言支持:能够处理多种语言的字幕生成与翻译。
- 无缝集成:与 Claude Code 工作流深度整合,支持命令行调用。
使用方法
在 Claude Code 中激活该技能后,可通过以下方式使用:
-
基本命令:
claude code --skill video-subtitle --input video.mp4 -
指定输出格式:
claude code --skill video-subtitle --input video.mp4 --output srt -
设置动画类型:
claude code --skill video-subtitle --input video.mp4 --animation bounce
环境变量
| 变量名 | 描述 | 默认值 |
|---|---|---|
VIDEO_SUBTITLE_API_KEY | AI 服务 API 密钥 | 无 |
VIDEO_SUBTITLE_LANG | 输出字幕语言 | zh-CN |
VIDEO_SUBTITLE_STYLE | 默认字体样式 | default |
依赖项
- Python 3.8+
- FFmpeg
- Whisper(语音识别模型)
- OpenCV(视频处理)
常见问题
Q: 如何处理长视频?
A: 建议将视频分段处理,单段时长不超过 10 分钟以保证字幕对齐精度。
Q: 支持哪些字幕格式?
A: 支持 SRT、VTT、ASS 等常见字幕格式输出。
Q: 如何调整动画速度?
A: 通过 --speed 参数控制,取值范围 0.5 到 2.0。
贡献指南
欢迎提交 Pull Request 或 Issue 来改进此技能。请遵循以下步骤:
- Fork 仓库
- 创建特性分支 (
git checkout -b feature/xxx) - 提交更改 (
git commit -m "添加xxx功能") - 推送到分支 (
git push origin feature/xxx) - 创建 Pull Request
许可证
MIT License
Copyright (c) 2024 YanlongLai
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.