Skip to content

eternityspring/reelbench-skills / skills/video-sync

video-sync

Verified

把拉片数据和原片合成一条**能直接看的视频**:一边是画面,一边是这一镜的分镜信息 (镜号、起止、时长、景别、类别、运镜、画面描述、台词),**镜头切了信息跟着切**, 镜头表自动滚动并高亮当前这一镜。 版式只看原片的宽高比:**横版 / 方版 → 画面在上、信息在下;竖版 → 画面在左、信息在右**, 画面永远原样缩放,不裁不拉。 镜头表**随播放滚动**:切点处滚一小段把当前镜头带到锚点、随后停住,高亮条同步滑过去。 实现上只截三张图(底板 + 铺开的长图 ×2),滚动与高亮由 ffmpeg 按时间裁窗, **布局全在 scripts/panel.css 里,改它就能改版式**,不用碰脚本。 吃 video-shots 产出的 shots.json(有 frames/ 就把关键帧当缩略图用)。 零 npm 依赖,用 ffmpeg 合成、无头浏览器渲面板。 Use when asked to 导出视频、合成视频、分镜视频、带分镜信息的视频、解说版视频、 video with shot info、annotated shot video。

FileKindSize
README.en.mdmarkdown7.7 KB
README.mdmarkdown6.8 KB
SKILL.mdskill md7.4 KB
assets/output-portrait.pngbinary321.2 KB
assets/panel-landscape.pngbinary214.7 KB
assets/panel-portrait.pngbinary89.1 KB
references/layout.mdmarkdown6.5 KB
references/panel-style.mdmarkdown2.9 KB
scripts/panel.cssother6.8 KB
scripts/panel.htmlother5.4 KB
scripts/selftest.mjsscript18.1 KB
scripts/video-sync.mjsscript29.8 KB

references/panel-style.md

View on GitHub
# 面板设计约定

改样式前先读这份,别凭感觉发挥。

## 三个文件

| 文件 | 管什么 |
| --- | --- |
| `scripts/panel.css` | **面板的布局与长相本身**。改它就能改版式,不用碰别的 |
| `scripts/panel.html` | 骨架 + 渲染逻辑:填数据、算滚动位置、切高亮 |
| `scripts/video-sync.mjs` | 算几何、下发数据、截图、合成。**改布局不用动它** |

`panels` 命令会把这三样拼成 `panels/panel.html`(单文件、CSS 内联、数据内嵌)。
**用浏览器打开它就能预览**,地址后面加 `#S07` 换镜头。改完 CSS 重跑 `panels` 就是新版面。

## 两种版式共用一份 HTML

`body` 上挂 `.landscape` / `.portrait`,CSS 用 grid 区域切换:

```
.landscape   head head      .portrait   head
             now  list                  now
             strip strip                 list
                                        strip
```

**同一套 DOM,两套 grid**——不写第二份模板,也就不会改了一边忘了另一边。

## 字号跟着面板尺寸走

导出的是**视频**,不是网页:屏幕上舒服的 13px 在手机上播就是一团糊。
所以 `panel.html` 按面板尺寸算一个根字号:

```
base = clamp(12, min(面板宽/38, 面板高/26), 26)
```

1280×576 的面板 → 22px;972×1080 的竖版面板 → 26px。

**所以 CSS 里一律用 `rem`**,写死 `px` 的只有边框和圆角。加一行 `font-size:14px` 就等于
在小面板上正常、在大面板上小得看不清。

## 四块内容

1. **片头**:片名 + 当前镜号 / 总镜数。一行,最占眼的是镜号
2. **当前镜头卡**:镜号(大)、起止时间码、时长、景别/类别/运镜 chips、**画面描述(正文主角)**、
   主体 / 画面文字 / 声音
3. **镜头表**:整张表都渲出来,靠 `transform: translateY()` 滚动——
   当前行钉在列表高度 28% 的位置,前后不够就贴边,**不留空白**
4. **进度条**:一镜一段,宽度 = 时长占比,颜色 = 景别色阶。走过的段半亮,当前段全亮

## 配色

深底(`#12160f`)+ 嫩绿高亮(`#dceba7`)。深底是为了贴在画面旁边不抢戏——
浅色面板在暗调片子旁边会像个灯箱。

景别色阶(`--color` 由数据下发,与 `video-shots` 报告同一套):越近的景别越深。

## 别做的事

- **别加动画**。面板是一帧静态图,`transition`/`animation` 在截图里只会截到中间状态
- **别用外链资源**(网络字体、CDN 图标)。截图是离线跑的,加载不到就是空白
- **别让内容溢出**。`body` 的宽高被脚本钉死成面板尺寸,溢出的部分直接被截掉——
  长描述用 `-webkit-line-clamp` 截断,别指望滚动条
- **别把关键信息放最下面**。镜头表底部有一层渐隐遮罩(提示还有更多),压在上面会看不清
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall