Skip to content

A toolbox of film styles made in code for Claude Code: 66 ready to use, and your own. Each style is a style prompt plus a demo film made entirely in code by Claude Opus 5.5, with no video model. By Lemomo. · 一套用代码做片的风格工具箱:66 种现成风格,也能做出你自己的

mux.sh warns when a film misses -14 LUFS / -1.2 dBTP; MAINTAINING: register before the gates, style number, fact sheet for real events; frames.sh <slug>

lemomo-aif3c590dffab3
diff --git a/MAINTAINING.md b/MAINTAINING.md
index b2e9b17..a874378 100644
--- a/MAINTAINING.md
+++ b/MAINTAINING.md
@@ -17,17 +17,23 @@ Work in `styles/<slug>/` (lowercase letters, digits, hyphens; unique). Start fro
Assets are CC0, CC BY or OFL only, each in `demo/CREDITS`. No watermark on any film. Real people, brands and events appear only in an unofficial fan film; its `DEMO.md` says so.
+## Register
+
+1. **Number.** `num` in `style.json` is the next free number after the highest in `styles/*/style.json` (two digits as a string, e.g. `"55"`); it orders the gallery within a category.
+2. `python3 styleboard/build.py` reads every `styles/*/style.json` and rewrites the gallery data, the README grid and counts, `styles/README.md` and the style list in `AGENTS.md`. Never edit those generated parts by hand. Then `python3 styleboard/build.py --frames <slug>` (the README grid frame at `frame_sec`) and `sh styleboard/frames.sh <slug>` (the gallery card from `demo/stills/styleframe.jpg`).
+3. `sh tools/web_cuts.sh` makes the 720p web cut in `.release/web/` (only for films that are new or changed).
+
## Gates
- **Human:** approve the style frame before production, and the finished film.
-- **Machine:** `asr_check.py` passes on every line; loudness about −14 LUFS; `readcheck.mjs` passes; `python3 tools/release.py check --strict` is clean.
+- **Machine:** `asr_check.py` passes on every line; `mux.sh` reports about −14 LUFS and no warning; `readcheck.mjs` passes; `python3 tools/release.py check --strict <slug>` is clean (it needs the Register steps above).
+- **Real events and products:** every fact on screen and in the voice-over comes from an official source, kept in `demo/FACTS.md` (claim, URL, quoted wording); check the final script against it before the last render.
-## Register and publish
+## Publish
-1. `python3 styleboard/build.py` reads every `styles/*/style.json` and rewrites the gallery data, the README grid and counts, `styles/README.md` and the style list in `AGENTS.md`. Never edit those generated parts by hand. `--frames <slug>` makes the README grid frame at `frame_sec`; `sh styleboard/frames.sh` makes the gallery card images.
-2. `sh tools/publish.sh` uploads the full films (`films` release) and the 720p web cuts (`web` release, used by the gallery), then verifies them. Per-demo resource packs are no longer published.
-3. `git status --short`, `git add -A`, commit.
-4. Push `main`, then watch CI (`gh run watch`): the gallery build fails when a card links a film that isn't on the `web` release.
+1. `sh tools/publish.sh` uploads the full films (`films` release) and the 720p web cuts (`web` release, used by the gallery), then verifies them. Per-demo resource packs are no longer published.
+2. `git status --short`, `git add -A`, commit.
+3. Push `main`, then watch CI (`gh run watch`): the gallery build fails when a card links a film that isn't on the `web` release.
Don't push before the upload has finished, and don't commit `tools/assets.json` from a failed run.
diff --git a/core/render/mux.sh b/core/render/mux.sh
index ac513fb..0858cdc 100755
--- a/core/render/mux.sh
+++ b/core/render/mux.sh
@@ -1,7 +1,8 @@
#!/bin/sh
# 合成成片:mux.sh video.mp4 mix.wav out.mp4 [fps] [grain]
# 视频按目标帧率输出(定格片段自动复制帧);grain = 颗粒强度(默认 2,0 = 不加;像素/矢量风格用 0)
-# 音频两遍 loudnorm → −14 LUFS / TP −1.2(单遍会偏 0.5 LU 左右);最后打印实测的 I / LRA / 真峰值
+# 音频两遍 loudnorm → −14 LUFS / TP −1.2(单遍会偏 0.5 LU 左右);最后打印实测的 I / LRA / 真峰值,没达标(响度偏出 ±1 LU 或峰值高于 −1 dB)就警告
+# (混音本身削波或峰值极高时,loudnorm 的动态模式两个目标都会错过,实测 −20 LUFS / +5 dBTP)
# 任何一步 ffmpeg 失败都以非 0 退出,并且不留半个文件;只有成品存在且非空才打印它的路径。
# 静音 / 极轻(低于 −70 LUFS,loudnorm 量不出来)的音频:只有"成功解码、量出来确实静音"才跳过响度归一并警告,仍然出片。
# 不是音频、没有音频流、或者文件坏了:以 1 退出,不出片。"坏"按实际解码出来的东西来判断,不是看到报错字样就算:
@@ -89,5 +90,11 @@ ffmpeg -y -loglevel error -i "$V" -i "$A" \
|| { rm -f "$O"; die "ffmpeg failed while writing '$O' (its message is above)"; }
[ -s "$O" ] || { rm -f "$O"; die "no output was written to '$O'"; }
echo "$O"
-ffmpeg -hide_banner -nostats -i "$O" -af ebur128=peak=true -f null - 2>&1 | grep -E "^\s+(I|LRA|Peak):" | head -3
+R=$(ffmpeg -hide_banner -nostats -i "$O" -af ebur128=peak=true -f null - 2>&1 | grep -E "^\s+(I|LRA|Peak):" | head -3)
+echo "$R"
+if [ "$NORM" = 1 ]; then
+ OI=$(echo "$R" | awk '$1 == "I:" { print $2 }'); OP=$(echo "$R" | awk '$1 == "Peak:" { print $2 }')
+ awk -v i="$OI" -v p="$OP" 'BEGIN { exit !(i + 0 < -15 || i + 0 > -13 || p + 0 > -1) }' \
+ && echo "mux.sh: warning: the film missed the target (-14 LUFS, true peak <= -1.2 dB): measured $OI LUFS, peak $OP dB. The mix is probably clipping or has very hot peaks: lower it and tame the peaks, then mux again" >&2
+fi
exit 0
diff --git a/styleboard/frames.sh b/styleboard/frames.sh
index 436e5d9..d0c3497 100755
--- a/styleboard/frames.sh
+++ b/styleboard/frames.sh
@@ -1,14 +1,17 @@
#!/bin/sh
# 把各风格 demo 的风格帧收进图鉴:styles/<slug>/demo/stills/styleframe.jpg → img/<slug>_0.jpg
+# sh styleboard/frames.sh [slug]:给了 slug 只做这一个风格(新风格用这个,免得把所有卡片重新编码一遍)
cd "$(dirname "$0")"
-for f in ../styles/*/demo/stills/styleframe.jpg; do
+ONLY="${1:-*}"
+[ "$ONLY" = "*" ] || [ -f "../styles/$ONLY/demo/stills/styleframe.jpg" ] || { echo "frames.sh: no styles/$ONLY/demo/stills/styleframe.jpg" >&2; exit 1; }
+for f in ../styles/$ONLY/demo/stills/styleframe.jpg; do
s=$(basename "$(dirname "$(dirname "$(dirname "$f")")")")
ffmpeg -v error -y -i "$f" -vf scale=1280:-1 -q:v 3 "img/${s}_0.jpg" && echo "$s"
done
-python3 - <<'PY'
+ONLY="$ONLY" python3 - <<'PY'
import json, glob, os
c = json.load(open('img/credits.json'))
-for p in glob.glob('../styles/*/demo/stills/styleframe.jpg'):
+for p in glob.glob(f"../styles/{os.environ['ONLY']}/demo/stills/styleframe.jpg"):
s = p.split('/')[2]; c[f'{s}_0.jpg'] = {'frame': True}
json.dump(c, open('img/credits.json', 'w'), ensure_ascii=False, indent=1)
PY