Spaces:
Running
Running
php2shell: 成品混音音轨 + 导出实测 + 第2轮质检 + 文案校对(推送 #5 最终)
Browse files- .gitattributes +2 -0
- php2shell/README.md +20 -1
- php2shell/dist/assets/index-CEf9jHNV.js +0 -0
- php2shell/dist/assets/index-CiV4ZY-L.js +0 -0
- php2shell/dist/assets/index-DiAP0g3E.js +0 -0
- php2shell/dist/assets/index-o0cTigVv.js +0 -0
- php2shell/dist/audio/{voice.mp3 → mix.mp3} +2 -2
- php2shell/dist/index.html +1 -1
- php2shell/studio/qa/qa_round2.json +147 -0
- php2shell/studio/qa/qa_sheet_round2.jpg +3 -0
- php2shell/tools/render_mix_node.mjs +1 -1
- php2shell/web/src/main.ts +25 -25
- php2shell/web/src/ui/export.ts +2 -1
- php2shell/web/src/ui/publish.ts +4 -4
.gitattributes
CHANGED
|
@@ -228,3 +228,5 @@ php2shell/studio/audio/voice.wav filter=lfs diff=lfs merge=lfs -text
|
|
| 228 |
php2shell/dist/audio/voice.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 229 |
php2shell/dist/live/php2shell-livephotos.zip filter=lfs diff=lfs merge=lfs -text
|
| 230 |
php2shell/studio/qa/qa_sheet_round1.jpg filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 228 |
php2shell/dist/audio/voice.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 229 |
php2shell/dist/live/php2shell-livephotos.zip filter=lfs diff=lfs merge=lfs -text
|
| 230 |
php2shell/studio/qa/qa_sheet_round1.jpg filter=lfs diff=lfs merge=lfs -text
|
| 231 |
+
php2shell/dist/audio/mix.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 232 |
+
php2shell/studio/qa/qa_sheet_round2.jpg filter=lfs diff=lfs merge=lfs -text
|
php2shell/README.md
CHANGED
|
@@ -93,7 +93,23 @@ php2shell/
|
|
| 93 |
6. ✅ 浏览器 MP4 导出(24/30/60fps,横/竖,高清/流畅)
|
| 94 |
7. ✅ 四平台文案 + 9 张多比例封面(16:9×3、4:3×3、3:4×3)
|
| 95 |
8. ✅ livecanvas 实况图 ZIP(6 张 jpg+mov)+ 图文文案 → **推送 #3**
|
| 96 |
-
9. vibe qa 质检、Dockerfile 加 `/php2shell/` 路由、上线验收 → **推送 #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
## 7. 进度日志
|
| 99 |
|
|
@@ -104,3 +120,6 @@ php2shell/
|
|
| 104 |
- 2026-10-21 · 沙盒仅 2 核/2GB,1080p 全片逐帧截图会超时 → 质检改用 960×540/30fps 代理片(与网页同一引擎、同一时间轴)分段渲染后 `vibe qa`。
|
| 105 |
- 2026-10-22 · 质检第 1 轮(`vibe qa`,960×540 代理片):0 失败 / 2 警告 —— 响度 −16.5 LUFS 偏轻。修复:在网页混音总线加母带链(压缩 → 限幅 → 软削波,天花板 −3 dBFS),播放与导出共用;复测 −13.9 LUFS、真峰值 −1.4 dBTP,质检 0 失败 / 1 警告(仅代理分辨率)。
|
| 106 |
- 2026-10-22 · 构图修正:横屏主画面由左 60% 改为整宽(片名、结尾保留左图右文);“整条街”“结尾”按城市实际包围盒计算尺寸,避免与文字重叠;所有压在图形上的说明文字加深色底板;片名卡开场即出现。实况图用新画面重新生成,ZIP 改为 UTF-8 文件名(Mac 解压不乱码)。
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
6. ✅ 浏览器 MP4 导出(24/30/60fps,横/竖,高清/流畅)
|
| 94 |
7. ✅ 四平台文案 + 9 张多比例封面(16:9×3、4:3×3、3:4×3)
|
| 95 |
8. ✅ livecanvas 实况图 ZIP(6 张 jpg+mov)+ 图文文案 → **推送 #3**
|
| 96 |
+
9. ✅ vibe qa 质检(2 轮)、Dockerfile 加 `/php2shell/` 路由、导出链路实测、上线验收 → **推送 #5(最终)**
|
| 97 |
+
|
| 98 |
+
## 8. 交付物与使用方法
|
| 99 |
+
|
| 100 |
+
**在线访问**:https://ethscriptions-tz.hf.space/php2shell/ (手机打开自动切竖屏)
|
| 101 |
+
|
| 102 |
+
| 交付物 | 位置 / 用法 |
|
| 103 |
+
|---|---|
|
| 104 |
+
| 网页视频(旁白 + 配乐 + 音效) | 页面左侧播放器:播放/暂停(空格键)、拖动进度、按章节跳转、横屏 16:9 ↔ 竖屏 9:16 切换 |
|
| 105 |
+
| 浏览器本地导出 MP4 | 「导出 MP4」卡片:画幅(横 1920×1080 / 竖 1080×1920)× 帧率(24 / 30 / 60)× 清晰度(高清 / 流畅),全程本地 WebCodecs 编码,建议桌面版 Chrome / Edge |
|
| 106 |
+
| 四平台标题 · 描述 · 标签 | 「标题 · 描述 · 标签」卡片:小红书 / 抖音 / 微信视频号 / 哔哩哔哩,实时字数与话题数校验,一键复制 |
|
| 107 |
+
| 封面 | 9 张:16:9 ×3、4:3 ×3、3:4 ×3,可按比例筛选、多选后下载 JPG |
|
| 108 |
+
| 实况图 | 「实况图」卡片 → 下载 ZIP:6 组 1080×1440 的 `jpg + mov`(Apple Live Photo 配对元数据),附图文标题 / 正文 / 标签 |
|
| 109 |
+
|
| 110 |
+
**目录**:`studio/`(research.md、storyboard.json、配音时间轴、qa 报告)· `web/`(网页源码)· `tools/`(时间轴、实况图、Node 端混音)· `dist/`(线上站点)。
|
| 111 |
+
|
| 112 |
+
**重新生成**:改旁白 → `vibe voice studio` → `node tools/build_timeline.mjs` → `cd web && bun run build` → `node tools/make_livephotos.mjs`。
|
| 113 |
|
| 114 |
## 7. 进度日志
|
| 115 |
|
|
|
|
| 120 |
- 2026-10-21 · 沙盒仅 2 核/2GB,1080p 全片逐帧截图会超时 → 质检改用 960×540/30fps 代理片(与网页同一引擎、同一时间轴)分段渲染后 `vibe qa`。
|
| 121 |
- 2026-10-22 · 质检第 1 轮(`vibe qa`,960×540 代理片):0 失败 / 2 警告 —— 响度 −16.5 LUFS 偏轻。修复:在网页混音总线加母带链(压缩 → 限幅 → 软削波,天花板 −3 dBFS),播放与导出共用;复测 −13.9 LUFS、真峰值 −1.4 dBTP,质检 0 失败 / 1 警告(仅代理分辨率)。
|
| 122 |
- 2026-10-22 · 构图修正:横屏主画面由左 60% 改为整宽(片名、结尾保留左图右文);“整条街”“结尾”按城市实际包围盒计算尺寸,避免与文字重叠;所有压在图形上的说明文字加深色底板;片名卡开场即出现。实况图用新画面重新生成,ZIP 改为 UTF-8 文件名(Mac 解压不乱码)。
|
| 123 |
+
- 2026-10-22 · 质检第 2 轮(新排版重渲代理片):0 失败 / 2 警告 —— ①代理片 960×540(有意为之,网页导出为 1080p);②时间线镜头字幕 OCR 0%:tesseract 把“十月二十一日”误认为“HEREEH”(笔画简单的数字字),用 1920×1080 全分辨率静帧复测识别完全正确,判定为代理分辨率下的 OCR 误差。报告见 `studio/qa/qa_round2.json`。
|
| 124 |
+
- 2026-10-22 · 稳定性:浏览器内整轨离线合成在 2GB 内存环境会崩溃 → 改为发布已质检的成品混音 `audio/mix.mp3`(−14.2 LUFS,与 Node 端同一套合成代码生成),播放与导出共用,秒开且不占内存;无头浏览器实测导出 24fps 横屏、60fps 竖屏片段,ffprobe/ffmpeg 完整解码通过、有声。
|
| 125 |
+
- 2026-10-22 · 文案校对:B站标题“5分钟”改“3分钟”;去掉“近7成网站连夜抢修”这类把使用率说成受影响率的表述;四平台标题字数全部在限制内(小红书 ≤20、抖音 ≤30、视频号 ≤16、B站 ≤80)。
|
php2shell/dist/assets/index-CEf9jHNV.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
php2shell/dist/assets/index-CiV4ZY-L.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
php2shell/dist/assets/index-DiAP0g3E.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
php2shell/dist/assets/index-o0cTigVv.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
php2shell/dist/audio/{voice.mp3 → mix.mp3}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75e2eb755f8c6b6b90f412e9e435e359e9cc30d893f69a588be3f8efe341684a
|
| 3 |
+
size 4708844
|
php2shell/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
| 6 |
<title>PHP2Shell:后厨里的两扇暗门 · 网页视频工作室</title>
|
| 7 |
<meta name="description" content="PHP2Shell 双漏洞科普动画,网页实时渲染播放,浏览器本地导出 MP4(24/30/60fps,横屏/竖屏),附四平台文案、多比例封面与实况图。" />
|
| 8 |
-
<script type="module" crossorigin src="./assets/index-
|
| 9 |
<link rel="stylesheet" crossorigin href="./assets/index-D2Vbdm6o.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
| 6 |
<title>PHP2Shell:后厨里的两扇暗门 · 网页视频工作室</title>
|
| 7 |
<meta name="description" content="PHP2Shell 双漏洞科普动画,网页实时渲染播放,浏览器本地导出 MP4(24/30/60fps,横屏/竖屏),附四平台文案、多比例封面与实况图。" />
|
| 8 |
+
<script type="module" crossorigin src="./assets/index-CiV4ZY-L.js"></script>
|
| 9 |
<link rel="stylesheet" crossorigin href="./assets/index-D2Vbdm6o.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
php2shell/studio/qa/qa_round2.json
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"video": "/workspaces/hf-tz/php2shell/render/out/final.mp4",
|
| 3 |
+
"meta": {
|
| 4 |
+
"w": 960,
|
| 5 |
+
"h": 540,
|
| 6 |
+
"fps": 30.0,
|
| 7 |
+
"dur": 195.133333,
|
| 8 |
+
"audio": true
|
| 9 |
+
},
|
| 10 |
+
"results": [
|
| 11 |
+
{
|
| 12 |
+
"level": "WARN",
|
| 13 |
+
"check": "分辨率",
|
| 14 |
+
"msg": "960×540(时间轴 1920×1080)"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"level": "PASS",
|
| 18 |
+
"check": "帧率",
|
| 19 |
+
"msg": "30.0 fps"
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"level": "PASS",
|
| 23 |
+
"check": "时长",
|
| 24 |
+
"msg": "195.13s(时间轴 195.13s)"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"level": "PASS",
|
| 28 |
+
"check": "音轨",
|
| 29 |
+
"msg": "有"
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"level": "PASS",
|
| 33 |
+
"check": "响度",
|
| 34 |
+
"msg": "-13.9 LUFS(目标 −14)"
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"level": "PASS",
|
| 38 |
+
"check": "真峰值",
|
| 39 |
+
"msg": "-1.4 dBTP(应 ≤ −1)"
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"level": "PASS",
|
| 43 |
+
"check": "黑场",
|
| 44 |
+
"msg": "无"
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"level": "PASS",
|
| 48 |
+
"check": "冻结画面",
|
| 49 |
+
"msg": "无"
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"level": "PASS",
|
| 53 |
+
"check": "文字@hook",
|
| 54 |
+
"msg": "OCR 读出 25 字;字幕命中 83%"
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"level": "PASS",
|
| 58 |
+
"check": "文字@title",
|
| 59 |
+
"msg": "OCR 读出 107 字;字幕命中 100%"
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"level": "PASS",
|
| 63 |
+
"check": "文字@kitchen",
|
| 64 |
+
"msg": "OCR 读出 78 字;字幕命中 100%"
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"level": "PASS",
|
| 68 |
+
"check": "文字@street",
|
| 69 |
+
"msg": "OCR 读出 86 字;字幕命中 100%"
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"level": "PASS",
|
| 73 |
+
"check": "文字@door1",
|
| 74 |
+
"msg": "OCR 读出 55 字;字幕命中 100%"
|
| 75 |
+
},
|
| 76 |
+
{
|
| 77 |
+
"level": "PASS",
|
| 78 |
+
"check": "文字@oom",
|
| 79 |
+
"msg": "OCR 读出 93 字;字幕命中 100%"
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"level": "PASS",
|
| 83 |
+
"check": "文字@cleanup",
|
| 84 |
+
"msg": "OCR 读出 59 字;字幕命中 100%"
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"level": "PASS",
|
| 88 |
+
"check": "文字@door2",
|
| 89 |
+
"msg": "OCR 读出 75 字;字幕命中 100%"
|
| 90 |
+
},
|
| 91 |
+
{
|
| 92 |
+
"level": "PASS",
|
| 93 |
+
"check": "文字@key",
|
| 94 |
+
"msg": "OCR 读出 39 字;字幕命中 100%"
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"level": "PASS",
|
| 98 |
+
"check": "文字@stale",
|
| 99 |
+
"msg": "OCR 读出 62 字;字幕命中 100%"
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"level": "PASS",
|
| 103 |
+
"check": "文字@nologin",
|
| 104 |
+
"msg": "OCR 读出 75 字;字幕命中 100%"
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"level": "PASS",
|
| 108 |
+
"check": "文字@scale",
|
| 109 |
+
"msg": "OCR 读出 75 字;字幕命中 100%"
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"level": "PASS",
|
| 113 |
+
"check": "文字@funnel",
|
| 114 |
+
"msg": "OCR 读出 91 字;字幕命中 100%"
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"level": "WARN",
|
| 118 |
+
"check": "文字@timeline",
|
| 119 |
+
"msg": "OCR 读出 82 字;字幕命中 0%(字太小、对比度不足或被遮挡?)"
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"level": "PASS",
|
| 123 |
+
"check": "文字@response",
|
| 124 |
+
"msg": "OCR 读出 91 字;字幕命中 100%"
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"level": "PASS",
|
| 128 |
+
"check": "文字@fix1",
|
| 129 |
+
"msg": "OCR 读出 100 字;字幕命中 100%"
|
| 130 |
+
},
|
| 131 |
+
{
|
| 132 |
+
"level": "PASS",
|
| 133 |
+
"check": "文字@fix2",
|
| 134 |
+
"msg": "OCR 读出 100 字;字幕命中 100%"
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"level": "PASS",
|
| 138 |
+
"check": "文字@outro",
|
| 139 |
+
"msg": "OCR 读出 109 字;字幕命中 100%"
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"level": "INFO",
|
| 143 |
+
"check": "接触表",
|
| 144 |
+
"msg": "/workspaces/hf-tz/php2shell/render/out/qa_sheet.jpg"
|
| 145 |
+
}
|
| 146 |
+
]
|
| 147 |
+
}
|
php2shell/studio/qa/qa_sheet_round2.jpg
ADDED
|
Git LFS Details
|
php2shell/tools/render_mix_node.mjs
CHANGED
|
@@ -15,7 +15,7 @@ const OUT = process.argv[2] || join(ROOT, 'render/audio/mix.wav')
|
|
| 15 |
const SR = 48000
|
| 16 |
|
| 17 |
// 把 voice.mp3 解码为 Float32(用 ffmpeg 转 raw f32le)
|
| 18 |
-
const voiceMp3 = join(ROOT, '
|
| 19 |
const raw = spawnSync('ffmpeg', ['-loglevel', 'error', '-i', voiceMp3, '-ac', '2', '-ar', String(SR), '-f', 'f32le', '-'], { maxBuffer: 1 << 30 })
|
| 20 |
if (raw.status !== 0) { console.error('ffmpeg decode voice failed', raw.stderr?.toString().slice(-300)); process.exit(1) }
|
| 21 |
const inter = new Float32Array(raw.stdout.buffer, raw.stdout.byteOffset, Math.floor(raw.stdout.length / 4))
|
|
|
|
| 15 |
const SR = 48000
|
| 16 |
|
| 17 |
// 把 voice.mp3 解码为 Float32(用 ffmpeg 转 raw f32le)
|
| 18 |
+
const voiceMp3 = join(ROOT, 'studio/audio/voice.wav')
|
| 19 |
const raw = spawnSync('ffmpeg', ['-loglevel', 'error', '-i', voiceMp3, '-ac', '2', '-ar', String(SR), '-f', 'f32le', '-'], { maxBuffer: 1 << 30 })
|
| 20 |
if (raw.status !== 0) { console.error('ffmpeg decode voice failed', raw.stderr?.toString().slice(-300)); process.exit(1) }
|
| 21 |
const inter = new Float32Array(raw.stdout.buffer, raw.stdout.byteOffset, Math.floor(raw.stdout.length / 4))
|
php2shell/web/src/main.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import './ui/style.css'
|
| 2 |
import { render } from './engine/render'
|
| 3 |
import { TL, sceneAt } from './engine/core'
|
| 4 |
-
import { renderMix, scheduleLive, LiveHandles } from './audio/synth'
|
| 5 |
import { exportMP4, exportSupported, FpsOpt, Orient, Quality } from './ui/export'
|
| 6 |
import { PLATFORMS, LIVE_POST, cleanTitle } from './ui/publish'
|
| 7 |
import { COVERS, coverCanvas, CoverDef } from './ui/covers'
|
|
@@ -37,8 +36,7 @@ let startAt = 0
|
|
| 37 |
let audioCtx: AudioContext | null = null
|
| 38 |
let mixBuffer: AudioBuffer | null = null
|
| 39 |
let mixPromise: Promise<AudioBuffer> | null = null
|
| 40 |
-
let
|
| 41 |
-
let liveHandles: LiveHandles | null = null
|
| 42 |
|
| 43 |
const canvas = el('canvas') as HTMLCanvasElement
|
| 44 |
const ctx = canvas.getContext('2d', { alpha: false })!
|
|
@@ -50,35 +48,31 @@ function drawFrame(t: number) {
|
|
| 50 |
render(ctx, Math.max(0, Math.min(TL.total - 0.001, t)), W, H, { subtitles: true, hud: true, grain: true })
|
| 51 |
}
|
| 52 |
|
| 53 |
-
|
| 54 |
-
if (voiceBuffer) return voiceBuffer
|
| 55 |
-
if (!audioCtx) audioCtx = new (window.AudioContext || (window as any).webkitAudioContext)()
|
| 56 |
-
const res = await fetch('./audio/voice.mp3')
|
| 57 |
-
const arr = await res.arrayBuffer()
|
| 58 |
-
voiceBuffer = await audioCtx.decodeAudioData(arr)
|
| 59 |
-
return voiceBuffer
|
| 60 |
-
}
|
| 61 |
async function ensureMix(): Promise<AudioBuffer> {
|
| 62 |
if (mixBuffer) return mixBuffer
|
| 63 |
if (mixPromise) return mixPromise
|
| 64 |
mixPromise = (async () => {
|
| 65 |
-
|
| 66 |
-
const
|
| 67 |
-
const
|
| 68 |
-
mixBuffer =
|
| 69 |
-
return
|
| 70 |
})()
|
|
|
|
| 71 |
return mixPromise
|
| 72 |
}
|
| 73 |
|
| 74 |
-
function stopAudio() { if (
|
| 75 |
async function startAudio(from: number): Promise<number> {
|
| 76 |
-
const
|
| 77 |
if (!audioCtx) return performance.now() / 1000
|
| 78 |
if (audioCtx.state === 'suspended') await audioCtx.resume()
|
| 79 |
stopAudio()
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
| 82 |
}
|
| 83 |
|
| 84 |
function loop() {
|
|
@@ -92,7 +86,7 @@ function loop() {
|
|
| 92 |
async function play() {
|
| 93 |
if (playing) return
|
| 94 |
const btn = $('#playBtn'); if (btn) btn.innerHTML = '⏸'
|
| 95 |
-
if (!
|
| 96 |
if (cur >= TL.total) cur = 0
|
| 97 |
const started = await startAudio(cur)
|
| 98 |
setStatus('player', '')
|
|
@@ -242,7 +236,7 @@ function build() {
|
|
| 242 |
buildLive()
|
| 243 |
drawFrame(0); syncBar()
|
| 244 |
// 预解码旁白(不阻塞)
|
| 245 |
-
|
| 246 |
}
|
| 247 |
|
| 248 |
function sceneStart(id: string) { return TL.scenes.find((s) => s.id === id)?.start ?? 0 }
|
|
@@ -283,7 +277,7 @@ function wireControls() {
|
|
| 283 |
const bar = $('#expBar') as HTMLElement
|
| 284 |
const wasPlaying = playing; if (wasPlaying) pause()
|
| 285 |
try {
|
| 286 |
-
setStatus('export', '
|
| 287 |
const mix = await ensureMix()
|
| 288 |
const blob = await exportMP4({ fps: ef, orient: eo, quality: eq, mix, signal: abort, onProgress: (p, label) => { bar.style.width = (p * 100).toFixed(0) + '%'; setStatus('export', `${label} · ${(p * 100).toFixed(0)}%`) } })
|
| 289 |
const url = URL.createObjectURL(blob)
|
|
@@ -391,5 +385,11 @@ function buildLive() {
|
|
| 391 |
|
| 392 |
build()
|
| 393 |
|
| 394 |
-
// QA 辅助:
|
| 395 |
-
;(window as any).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import './ui/style.css'
|
| 2 |
import { render } from './engine/render'
|
| 3 |
import { TL, sceneAt } from './engine/core'
|
|
|
|
| 4 |
import { exportMP4, exportSupported, FpsOpt, Orient, Quality } from './ui/export'
|
| 5 |
import { PLATFORMS, LIVE_POST, cleanTitle } from './ui/publish'
|
| 6 |
import { COVERS, coverCanvas, CoverDef } from './ui/covers'
|
|
|
|
| 36 |
let audioCtx: AudioContext | null = null
|
| 37 |
let mixBuffer: AudioBuffer | null = null
|
| 38 |
let mixPromise: Promise<AudioBuffer> | null = null
|
| 39 |
+
let srcNode: AudioBufferSourceNode | null = null
|
|
|
|
| 40 |
|
| 41 |
const canvas = el('canvas') as HTMLCanvasElement
|
| 42 |
const ctx = canvas.getContext('2d', { alpha: false })!
|
|
|
|
| 48 |
render(ctx, Math.max(0, Math.min(TL.total - 0.001, t)), W, H, { subtitles: true, hud: true, grain: true })
|
| 49 |
}
|
| 50 |
|
| 51 |
+
// 音轨:旁白 + 配乐 + 音效的成品混音(由 tools/render_mix_node.mjs 用同一套合成代码生成,已过 −14 LUFS 质检)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
async function ensureMix(): Promise<AudioBuffer> {
|
| 53 |
if (mixBuffer) return mixBuffer
|
| 54 |
if (mixPromise) return mixPromise
|
| 55 |
mixPromise = (async () => {
|
| 56 |
+
if (!audioCtx) audioCtx = new (window.AudioContext || (window as any).webkitAudioContext)()
|
| 57 |
+
const res = await fetch('./audio/mix.mp3')
|
| 58 |
+
const arr = await res.arrayBuffer()
|
| 59 |
+
mixBuffer = await audioCtx.decodeAudioData(arr)
|
| 60 |
+
return mixBuffer
|
| 61 |
})()
|
| 62 |
+
mixPromise.catch(() => { mixPromise = null })
|
| 63 |
return mixPromise
|
| 64 |
}
|
| 65 |
|
| 66 |
+
function stopAudio() { if (srcNode) { try { srcNode.stop() } catch { } srcNode.disconnect(); srcNode = null } }
|
| 67 |
async function startAudio(from: number): Promise<number> {
|
| 68 |
+
const mix = await ensureMix()
|
| 69 |
if (!audioCtx) return performance.now() / 1000
|
| 70 |
if (audioCtx.state === 'suspended') await audioCtx.resume()
|
| 71 |
stopAudio()
|
| 72 |
+
srcNode = audioCtx.createBufferSource(); srcNode.buffer = mix; srcNode.connect(audioCtx.destination)
|
| 73 |
+
const when = audioCtx.currentTime + 0.05
|
| 74 |
+
srcNode.start(when, Math.min(from, mix.duration - 0.01))
|
| 75 |
+
return when
|
| 76 |
}
|
| 77 |
|
| 78 |
function loop() {
|
|
|
|
| 86 |
async function play() {
|
| 87 |
if (playing) return
|
| 88 |
const btn = $('#playBtn'); if (btn) btn.innerHTML = '⏸'
|
| 89 |
+
if (!mixBuffer) setStatus('player', '正在载入音轨…')
|
| 90 |
if (cur >= TL.total) cur = 0
|
| 91 |
const started = await startAudio(cur)
|
| 92 |
setStatus('player', '')
|
|
|
|
| 236 |
buildLive()
|
| 237 |
drawFrame(0); syncBar()
|
| 238 |
// 预解码旁白(不阻塞)
|
| 239 |
+
ensureMix().catch(() => { })
|
| 240 |
}
|
| 241 |
|
| 242 |
function sceneStart(id: string) { return TL.scenes.find((s) => s.id === id)?.start ?? 0 }
|
|
|
|
| 277 |
const bar = $('#expBar') as HTMLElement
|
| 278 |
const wasPlaying = playing; if (wasPlaying) pause()
|
| 279 |
try {
|
| 280 |
+
setStatus('export', '载入音轨…'); bar.style.width = '4%'
|
| 281 |
const mix = await ensureMix()
|
| 282 |
const blob = await exportMP4({ fps: ef, orient: eo, quality: eq, mix, signal: abort, onProgress: (p, label) => { bar.style.width = (p * 100).toFixed(0) + '%'; setStatus('export', `${label} · ${(p * 100).toFixed(0)}%`) } })
|
| 283 |
const url = URL.createObjectURL(blob)
|
|
|
|
| 385 |
|
| 386 |
build()
|
| 387 |
|
| 388 |
+
// QA 辅助:导出前 N 秒(验证编码/封装链路)
|
| 389 |
+
;(window as any).__qaExport = async (seconds = 4, fps: FpsOpt = 30, orient: Orient = 'landscape') => {
|
| 390 |
+
const mix = await ensureMix()
|
| 391 |
+
const blob = await exportMP4({ fps, orient, quality: 'medium', mix, seconds })
|
| 392 |
+
const buf = new Uint8Array(await blob.arrayBuffer())
|
| 393 |
+
let bin = ''; for (let i = 0; i < buf.length; i += 0x8000) bin += String.fromCharCode(...buf.subarray(i, i + 0x8000))
|
| 394 |
+
return btoa(bin)
|
| 395 |
+
}
|
php2shell/web/src/ui/export.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface ExportOpts {
|
|
| 14 |
mix: AudioBuffer
|
| 15 |
onProgress?: (p: number, label: string) => void
|
| 16 |
signal?: { aborted: boolean }
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
const DIMS = {
|
|
@@ -48,7 +49,7 @@ async function pickAudio(sampleRate: number): Promise<{ codec: 'aac' | 'opus'; m
|
|
| 48 |
export async function exportMP4(opts: ExportOpts): Promise<Blob> {
|
| 49 |
const { fps, orient, quality, mix, onProgress, signal } = opts
|
| 50 |
const [W, H] = DIMS[orient][quality]
|
| 51 |
-
const total = TL.total
|
| 52 |
const frameCount = Math.round(total * fps)
|
| 53 |
const bitrate = quality === 'high' ? (orient === 'portrait' ? 12_000_000 : 14_000_000) : 6_000_000
|
| 54 |
|
|
|
|
| 14 |
mix: AudioBuffer
|
| 15 |
onProgress?: (p: number, label: string) => void
|
| 16 |
signal?: { aborted: boolean }
|
| 17 |
+
seconds?: number // 仅导出前 N 秒(测试用)
|
| 18 |
}
|
| 19 |
|
| 20 |
const DIMS = {
|
|
|
|
| 49 |
export async function exportMP4(opts: ExportOpts): Promise<Blob> {
|
| 50 |
const { fps, orient, quality, mix, onProgress, signal } = opts
|
| 51 |
const [W, H] = DIMS[orient][quality]
|
| 52 |
+
const total = Math.min(TL.total, opts.seconds ?? TL.total)
|
| 53 |
const frameCount = Math.round(total * fps)
|
| 54 |
const bitrate = quality === 'high' ? (orient === 'portrait' ? 12_000_000 : 14_000_000) : 6_000_000
|
| 55 |
|
php2shell/web/src/ui/publish.ts
CHANGED
|
@@ -8,14 +8,14 @@ export interface Platform {
|
|
| 8 |
}
|
| 9 |
|
| 10 |
const COMMON_DESC = `一台几乎看不见的"后厨发动机"——PHP,在 2026 年 10 月 21 日被公开了两扇"不用钥匙就能打开的暗门":两个未认证远程代码执行漏洞,CVSS 9.2。
|
| 11 |
-
本片用"厨房爆满"和"旧钥匙"两个比喻,讲清这两个漏洞到底怎么回事,为什么全球大量网站都要同步抢修,以及网站运营者该做
|
| 12 |
要点:使用 PHP ≠ 一定受影响;修复版本 PHP 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35,升级后要重启所有进程。
|
| 13 |
内容为科普示意,信息截至 2026-10-21,以 PHP 官方安全公告为准,不构成安全或投资建议。`
|
| 14 |
|
| 15 |
export const PLATFORMS: Platform[] = [
|
| 16 |
{
|
| 17 |
key: 'xhs', name: '小红书', color: '#FF2E4D', titleMax: 20, tagMax: 10,
|
| 18 |
-
titles: ['全球
|
| 19 |
desc: COMMON_DESC,
|
| 20 |
tags: ['网络安全', 'PHP', '涨知识', '程序员', '科普', '漏洞预警', '后端开发', '运维', '建站', '互联网'],
|
| 21 |
},
|
|
@@ -27,14 +27,14 @@ export const PLATFORMS: Platform[] = [
|
|
| 27 |
},
|
| 28 |
{
|
| 29 |
key: 'wxch', name: '微信视频号', color: '#FA9D3B', titleMax: 16, tagMax: 99,
|
| 30 |
-
titles: ['PHP两扇暗门:高危漏洞科普', '
|
| 31 |
desc: COMMON_DESC,
|
| 32 |
tags: ['网络安全', 'PHP', '科普', '漏洞预警', '程序员', '运维'],
|
| 33 |
},
|
| 34 |
{
|
| 35 |
key: 'bili', name: '哔哩哔哩', color: '#FB7299', titleMax: 80, tagMax: 10,
|
| 36 |
titles: [
|
| 37 |
-
'【
|
| 38 |
'用"厨房爆满"和"没收走的旧钥匙"讲清PHP的两个高危漏洞(CVE-2026-109618/109619),以及网站该怎么办',
|
| 39 |
'PHP同时出现两扇"不用钥匙的暗门":一台被无数网站共用的发动机,为什么补丁发布当天变成全球抢修?',
|
| 40 |
],
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
const COMMON_DESC = `一台几乎看不见的"后厨发动机"——PHP,在 2026 年 10 月 21 日被公开了两扇"不用钥匙就能打开的暗门":两个未认证远程代码执行漏洞,CVSS 9.2。
|
| 11 |
+
本片用"厨房爆满"和"旧钥匙"两个比喻,讲清这两个漏洞到底怎么回事,为什么全球大量网站都要同步抢修,以及网站运营者现在该做什么。
|
| 12 |
要点:使用 PHP ≠ 一定受影响;修复版本 PHP 8.5.12 / 8.4.27 / 8.3.36 / 8.2.35,升级后要重启所有进程。
|
| 13 |
内容为科普示意,信息截至 2026-10-21,以 PHP 官方安全公告为准,不构成安全或投资建议。`
|
| 14 |
|
| 15 |
export const PLATFORMS: Platform[] = [
|
| 16 |
{
|
| 17 |
key: 'xhs', name: '小红书', color: '#FF2E4D', titleMax: 20, tagMax: 10,
|
| 18 |
+
titles: ['PHP曝两扇暗门,全球同步抢修', '你的网站用的哪个PHP版本?', 'PHP两扇暗门:9分高危漏洞科普'],
|
| 19 |
desc: COMMON_DESC,
|
| 20 |
tags: ['网络安全', 'PHP', '涨知识', '程序员', '科普', '漏洞预警', '后端开发', '运维', '建站', '互联网'],
|
| 21 |
},
|
|
|
|
| 27 |
},
|
| 28 |
{
|
| 29 |
key: 'wxch', name: '微信视频号', color: '#FA9D3B', titleMax: 16, tagMax: 99,
|
| 30 |
+
titles: ['PHP两扇暗门:高危漏洞科普', 'PHP高危漏洞:全球连夜抢修', '你的网站用哪个PHP版本'],
|
| 31 |
desc: COMMON_DESC,
|
| 32 |
tags: ['网络安全', 'PHP', '科普', '漏洞预警', '程序员', '运维'],
|
| 33 |
},
|
| 34 |
{
|
| 35 |
key: 'bili', name: '哔哩哔哩', color: '#FB7299', titleMax: 80, tagMax: 10,
|
| 36 |
titles: [
|
| 37 |
+
'【3分钟科普】PHP2Shell:后厨里的两扇暗门——近7成网站在用的PHP,同时爆出两个9.2分远程代码执行漏洞,全球同步抢修',
|
| 38 |
'用"厨房爆满"和"没收走的旧钥匙"讲清PHP的两个高危漏洞(CVE-2026-109618/109619),以及网站该怎么办',
|
| 39 |
'PHP同时出现两扇"不用钥匙的暗门":一台被无数网站共用的发动机,为什么补丁发布当天变成全球抢修?',
|
| 40 |
],
|