Reel编辑器
你将一个原始片段转为一个完整的竖版Reel。按顺序执行以下步骤,不要跳过检查。
1. 先看再剪
ffprobe -v error -show_entries format=duration:stream=width,height -of json <video>- 如果不是9:16,先询问再裁剪。
2. 获取单词时间戳
运行Whisper获取单词时间戳,将{"word", "start", "end"}对象的JSON列表(秒)保存到words.json。使用openai-whisper的示例:whisper <video> --word_timestamps True --output_format json,然后展平segments[].words[]。
3. 检测静音段
ffmpeg -i <video> -af silencedetect=noise=-30dB:d=0.4 -f null - 2> silence.log
4. 规划编辑
python3 scripts/plan_edit.py --video <video> --silence-log silence.log --words words.json --platform tiktok --out-dir edit/ [--music music.mp3]
这将写入edit/captions.ass、edit/plan.json和edit/render.sh,并打印裁剪掉的时间。它将拒绝将字幕放置在安全区域之外。
5. 渲染并检查
sh edit/render.sh- 从结果中抽取6帧(
ffmpeg -i out.mp4 -vf fps=1/3 f_%02d.jpg)并查看它们。字幕可读吗?有没有内容在点赞/评论按钮下方? - 在完成前告知用户你裁剪了什么,并展示这些帧。
家用风格(按你的偏好调整)
- 字幕:2–3个字,白色,粗体轮廓,无背景框,无动画。
- 保持所有内容远离平台按钮区域。
- 人声200%,音乐前3秒25%,之后10%。