LH Video Gen
Generate vertical short videos (9:16) from a Markdown script. Parses script sections, generates TTS audio, renders subtitle cards, and composites into MP4 wi...
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 488 · 3 current installs · 3 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description align with the shipped code: generate.py parses Markdown, produces TTS audio (via a local TTS tool or a user-supplied TTS command), renders HTML slides (via headless Chrome) and composes video with FFmpeg. No unrelated env vars or services are requested.
Instruction Scope
SKILL.md instructs the agent to run the provided script and to optionally set CHROME_PATH or EDGE_TTS_PATH; those are relevant. One non-security note: the templates and script encourage/contain hard-coded branding and SEO guidance (e.g., requiring core keywords and the phrase to promote "关注刘贺同学" and '龙虾哥' branding). That is scope creep for content (not a technical mismatch) and may be undesired by some users.
Install Mechanism
No install spec or external downloads are present; this is an instruction+code skill that relies on locally installed FFmpeg and Chrome. Nothing is extracted from arbitrary URLs or installed automatically.
Credentials
The skill requests no secrets or special environment variables. It optionally reads CHROME_PATH and EDGE_TTS_PATH to locate local binaries/scripts — these are proportional and documented. The script may detect and invoke a sibling ../lh-edge-tts script if present; that behavior is expected for optional integration but the referenced script should be trusted.
Persistence & Privilege
always is false and the skill does not request persistent platform privileges. It writes temporary files under a tmp directory near the output path and cleans some temporary files; it does not modify other skills or system-wide settings.
Assessment
This skill appears coherent and performs only local operations (reads your Markdown, writes temp files, runs local Chrome/FFmpeg and an optional local TTS tool). Before installing or running:
- Ensure FFmpeg and Chrome are installed from trusted sources.
- If you rely on the auto-detected ../lh-edge-tts script, verify that script is trusted: the skill will execute it (it runs python on that script). Malicious or untrusted code in that sibling path could run on your machine.
- If you pass a custom --tts-command, be careful: the skill runs that string with a shell (shell=True). Only use trusted TTS commands and avoid passing untrusted templates that could execute additional shell operations.
- The provided HTML templates contain hard-coded branding and SEO guidance (promotional phrases). If you don’t want those, edit the templates before generating videos.
- The skill reads your input Markdown and writes audio/image/video files under a tmp folder next to your output; do not include secrets in the script content if you are concerned about local file storage.
Overall: technically coherent for its stated purpose. The main operational risks are executing a local sibling TTS script and running user-supplied shell commands for TTS — verify those components are trusted before use.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Video-Gen Skill
从视频脚本 Markdown 文件一键生成竖版短视频(9:16)。
核心思路:以图定音
- 每段脚本的画面说明 -> 字幕卡片图
- 每段口播文案 -> TTS 配音
- 每张图展示时长 = 对应音频时长,音画天然同步
快速开始
python3 generate.py script.md -o output.mp4
使用预制图片(跳过 Chrome 截图)
python3 generate.py script.md --images-dir ./my-slides -o output.mp4
图片命名规则:slide_01.png, slide_02.png...,与脚本分段一一对应。
自定义 TTS 命令
python3 generate.py script.md --tts-command "my-tts {text} -o {output} -v {voice} -r {rate}"
占位符:{text} 口播文案、{output} 输出路径、{voice} 音色、{rate} 语速。
参数说明
python3 generate.py <脚本路径> [选项]
选项:
-o, --output 输出 MP4 路径(默认:tmp/video-output.mp4)
-v, --voice TTS 音色(默认:zh-CN-YunxiNeural)
-r, --rate 语速(默认:+0%,如 +10%、-10%)
-w, --width 视频宽度(默认:1080)
--height 视频高度(默认:1920,9:16)
--images-dir 使用已有图片目录,跳过 Chrome 截图
--tts-command 自定义 TTS 命令模板(占位符:{text} {output} {voice} {rate})
--keep-temp 保留临时文件(图片、音频、片段)
--no-subs 不烧录字幕
依赖
系统依赖
- FFmpeg:视频合成(
brew install ffmpeg) - Chrome:HTML 截图(仅在未使用
--images-dir时需要)- 自动检测 macOS/Linux 常见路径,或通过
CHROME_PATH环境变量指定
- 自动检测 macOS/Linux 常见路径,或通过
推荐搭配的 Skill
以下 Skill 非必需,但搭配使用效果更佳:
- lh-edge-tts:TTS 配音生成。自动检测同级目录
../lh-edge-tts/scripts/tts_converter.py,或通过EDGE_TTS_PATH环境变量指定,或用--tts-command替换为任意 TTS 工具 - lh-html-to-image:如需自定义更复杂的字幕卡片,可用此 Skill 生成图片后通过
--images-dir传入
脚本格式
用 --- 分隔各段,每段包含 **口播**、**字幕**、**画面** 字段:
# 视频标题
---
## 开场
**画面**:场景描述
**口播**:TTS 配音文案
**字幕**:屏幕显示文字\n支持换行
---
## 结尾
**画面**:场景描述
**口播**:TTS 配音文案
**字幕**:屏幕显示文字
完整模板:templates/script-template.md
工作流程
- 解析脚本 Markdown,提取各分段
- 每段口播 -> TTS 生成 mp3
- 每段字幕 -> HTML 模板截图生成 9:16 图片(或从
--images-dir加载) - 每张图 + 对应音频 -> FFmpeg 合成视频片段
- 拼接所有片段 -> 输出 MP4
Files
5 totalSelect a file
Select a file to preview.
Comments
Loading comments…
