v3.2: Fix offline timeline freeze & Windows OneCore ko-KR TTS, add standalone index.html player + documentary dossier/B-roll presets
Browse files- README.md +17 -3
- SKILL.md +25 -12
- assets/js/standalone_player.js +226 -0
- deck2video_offline_full.zip +2 -2
- html_builder.py +196 -3
- ingest_parser.py +31 -3
- offline_renderer.py +60 -14
- pyproject.toml +1 -1
- samples/sample_docu_patent.md +32 -0
- themes_and_presets.py +4 -1
- tts_timeline.py +156 -38
README.md
CHANGED
|
@@ -18,13 +18,27 @@ tags:
|
|
| 18 |
- offline-ready
|
| 19 |
---
|
| 20 |
|
| 21 |
-
# ๐ฌ Deck2Video v3.
|
| 22 |
|
| 23 |
-
ํ์ํฌ์ธํธ(`.pptx` โ **์ฌ๋ด DRM ์ฐ๋ ๋ธ๋ฆฟ์ง**, ๊ทธ๋ฃน ๋ํ ์ฌ๊ท ์ถ์ถ, ํ์ฌ ๋ก๊ณ ์๋ ์ ์ธ ๋ฐ ๋ํ ์ด๋ฏธ์ง ์ถ์ถ ํฌํจ), ์๋(`.docx`), ๋งํฌ๋ค์ด(`.md`), HTML ๋ฌธ์๋ฅผ ์
๋ ฅ๋ฐ์ **์ ํ๋ธ ์ธ๊ธฐ ํ
ํฌ ์ฑ๋(*์ซ๋ํ์ ๋ธ๊น์ผ๊ธฐ*, *ITํกํก* ๋ฑ) ๋ฐ Linear / Apple ํค๋
ธํธ ์คํ์ผ**์ `1920ร1080` ์ฝ๋ ๋ ๋๋ง ํ๋ ์ ํ
์ด์
์์์ ์๋ ์์ฑํ๋ **์จยท์คํ๋ผ์ธ ๊ฒธ์ฉ AI ์์ด์ ํธ ์คํฌ(v3.
|
| 24 |
|
| 25 |
---
|
| 26 |
|
| 27 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
์ฌ๋ด PC(Fasoo, MarkAny, Softcamp, MS Purview ๋ฑ)์์ `.pptx`/`.docx`๊ฐ DRM์ผ๋ก ์ํธํ๋์ด ์์ด ํ์ด์ฌ(`python-pptx`)์ด ์ง์ ์ด์ง ๋ชปํ ๋, AI ์์ด์ ํธ๊ฐ ์์๋ก ์ ์ ์ฌ๋ผ์ด๋ ์บก์ฒ ์ฌ๋ผ์ด๋์ผ๋ก ์ฐํํ์ง ์๋๋ก **2๋จ๊ณ ์์ด์ ํธ DRM ๋ธ๋ฆฟ์ง(`--stdin-json` / `--stdin-md` / Exit Code `42` ๊ฐ๋๋ ์ผ)**๊ฐ ๋ด์ฅ๋์์ต๋๋ค.
|
| 30 |
|
|
|
|
| 18 |
- offline-ready
|
| 19 |
---
|
| 20 |
|
| 21 |
+
# ๐ฌ Deck2Video v3.2 Agent Skill (`PPTX ยท DOCX ยท MD ยท HTML ยท ์ฌ๋ด DRM ๋ธ๋ฆฟ์ง โ 18์ข
๋ชจ์
/๋คํ ๋ ์ด์์ + ์น ํ๋ ์ด์ด ๋ด์ฅ + 1080p MP4`)
|
| 22 |
|
| 23 |
+
ํ์ํฌ์ธํธ(`.pptx` โ **์ฌ๋ด DRM ์ฐ๋ ๋ธ๋ฆฟ์ง**, ๊ทธ๋ฃน ๋ํ ์ฌ๊ท ์ถ์ถ, ํ์ฌ ๋ก๊ณ ์๋ ์ ์ธ ๋ฐ ๋ํ ์ด๋ฏธ์ง ์ถ์ถ ํฌํจ), ์๋(`.docx`), ๋งํฌ๋ค์ด(`.md`), HTML ๋ฌธ์๋ฅผ ์
๋ ฅ๋ฐ์ **์ ํ๋ธ ์ธ๊ธฐ ํ
ํฌยท๋คํ ์ฑ๋(*์ซ๋ํ์ ๋ธ๊น์ผ๊ธฐ*, *ITํกํก*, *์ค๋ช
์ข์ํ๋์์ ์จ* ๋ฑ) ๋ฐ Linear / Apple ํค๋
ธํธ ์คํ์ผ**์ `1920ร1080` ์ฝ๋ ๋ ๋๋ง ํ๋ ์ ํ
์ด์
์์์ ์๋ ์์ฑํ๋ **์จยท์คํ๋ผ์ธ ๊ฒธ์ฉ AI ์์ด์ ํธ ์คํฌ(v3.2)**์
๋๋ค.
|
| 24 |
|
| 25 |
---
|
| 26 |
|
| 27 |
+
## ๐ v3.2 ํต์ฌ ์
๋ฐ์ดํธ (์ฌ๋ด ์คํ๋ผ์ธ & ์น ํ๋ ์ด์ด ํจ์น + ๋คํ๋ฉํฐ๋ฆฌ ์คํ์ผ ์ถ๊ฐ!)
|
| 28 |
+
|
| 29 |
+
1. **์ฌ๋ด ์คํ๋ผ์ธ ๋ ๋๋ฌ(`--offline`) & ๋จ๋
`index.html` ์ฒซ ํ๋ฉด ๋ฉ์ถค ๋ฒ๊ทธ ์๋ฒฝ ํด๊ฒฐ**
|
| 30 |
+
* `window.__timelines` ์ด๊ธฐํ ๋ณด์ฅ ๋ฐ ๋ก์ปฌ ์ฌ๋ด ํ๋ก์ ์ฐํ(`--no-proxy-server`) ์ ์ฉ์ผ๋ก ์ฌ๋ด ํ์๋ง Chrome/Edge ๋ ๋๋ง ์ ๋ชจ๋ ์ฌ๋ผ์ด๋์ ์ ๋๋ฉ์ด์
์ด 100% ์ ์ ๊ตฌ๋๋ฉ๋๋ค.
|
| 31 |
+
* **๋จ๋
์น ํ๋ ์ ํ
์ด์
ํ๋ ์ด์ด(`standalone_player.js`) ๋ด์ฅ**: ์์ฑ๋ `index.html`์ ํฌ๋กฌ/์ฃ์ง์์ ๋๋ธํด๋ฆญํด ์ด๋ฉด ํ๋ฉด ํฌ๊ธฐ์ ๋ง์ถฐ ์๋ ์ค์ผ์ผ๋ง๋๋ฉฐ ํ๋จ **`โถ ์ฌ์ (Space) / โ ์ด์ / ๋ค์ โถ / ์ฌ๋ผ์ด๋ ์ด๋ ๋ฐ`**๊ฐ ํ์ฑํ๋์ด ์์ฑยทํจ๊ณผ์ยท๋ฐฐ๊ฒฝ์๊ณผ ํจ๊ป ์ค์๊ฐ ์น ์ฌ๋ผ์ด๋๋ก ๋ฐ๋ก ๋ฐํํ ์ ์์ต๋๋ค!
|
| 32 |
+
2. **Windows 10/11 ์ฌ๋ด PC ์คํ๋ผ์ธ ํ๊ตญ์ด TTS ๋ฌด์ ํ์ ํด๊ฒฐ (`tts_timeline.py`)**
|
| 33 |
+
* ๊ตฌํ SAPI5์ ํ๊ตญ์ด ์์ฑ์ด ์์ ๋ ์์ด ๋ณด์ด์ค(`Zira`)๊ฐ ์ ํ๋์ด ํ๊ธ์ ๋ฌด์ ์ฒ๋ฆฌํ๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ฌ, **Windows 10/11 ๊ธฐ๋ณธ ๋ด์ฅ `Speech_OneCore` ํ๊ตญ์ด ์์ฑ(`Heami` ๋ฑ)**์ ์๋ ํ์ํด ๋๋ ทํ ํ๊ตญ์ด ๋ด๋ ์ด์
์ ํฉ์ฑํฉ๋๋ค.
|
| 34 |
+
3. **์ ๊ท ๋คํ๋ฉํฐ๋ฆฌยท์ ๋๋ฆฌ์ฆ ํ๋ฆฌ์
์ถ๊ฐ (*์ค๋ช
์ข์ํ๋์์ ์จ* ์คํ์ผ ์ง์!)**
|
| 35 |
+
* **`dossier_stamp_card`**: ํฌ๋ํํธ ์๋ฅ์ฒ (๊ณต์ ํด๋ช
์) / ํ์ดํธ ํนํ์ฆ(USPTO) ๋ฌธ์ ์นด๋ + ๊ณ ๋ฌด๋์ฅ ์คํฌํ(`[STAMP: ๊ฐ๋ฐ ๊ณํ ์์]`) ํ๊ฒฉ ์ ๋๋ฉ์ด์
|
| 36 |
+
* **`cinema_broll_fullscreen`**: ํ์คํฌ๋ฆฐ ์ค์ฌ/AI ์๋ค๋งํฑ ์์ยท์ด๋ฏธ์ง B-Roll (`[BROLL: clip.mp4]`) + ๋คํ ๋น๋คํ
& ์ผ๋ฒ์ฆ ์ค ๊ต์ฐจํธ์ง ๋ ์ด์์
|
| 37 |
+
* **`docu_watermark` HUD**: ์๋จ ์ฌ๋ฆผ ์์-๊ทธ๋ฆฐ ์งํ ๋ฐ + ์ฐ์ธก ์๋จ 2์ค ์ฑ๋ ์ํฐ๋งํฌ (`--hud-style docu_watermark --brand "์ค๋ช
์ข์ํ๋ | ์์ ์จ"`)
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## ๐ก๏ธ v3.1~v3.2 ์ฌ๋ด ๋ฌธ์ ๋ณด์(DRM) ํ๊ฒฝ ์๋ฒฝ ์ฐ๋!
|
| 42 |
|
| 43 |
์ฌ๋ด PC(Fasoo, MarkAny, Softcamp, MS Purview ๋ฑ)์์ `.pptx`/`.docx`๊ฐ DRM์ผ๋ก ์ํธํ๋์ด ์์ด ํ์ด์ฌ(`python-pptx`)์ด ์ง์ ์ด์ง ๋ชปํ ๋, AI ์์ด์ ํธ๊ฐ ์์๋ก ์ ์ ์ฌ๋ผ์ด๋ ์บก์ฒ ์ฌ๋ผ์ด๋์ผ๋ก ์ฐํํ์ง ์๋๋ก **2๋จ๊ณ ์์ด์ ํธ DRM ๋ธ๋ฆฟ์ง(`--stdin-json` / `--stdin-md` / Exit Code `42` ๊ฐ๋๋ ์ผ)**๊ฐ ๋ด์ฅ๋์์ต๋๋ค.
|
| 44 |
|
SKILL.md
CHANGED
|
@@ -5,11 +5,11 @@ description: >
|
|
| 5 |
Word (.docx), Markdown (.md/.txt), HTML (.html), or Agent-extracted JSON (--stdin-json) into sleek
|
| 6 |
code-rendered 1920x1080 MP4 presentation & tech-briefing videos. Includes 10 procedural background
|
| 7 |
presets (incl. 3D Wireframe Globe & Briefing Grid), 3 HUD modes (Chapter Tabs & ITํกํก Tech Briefing),
|
| 8 |
-
6 caption styles (incl. Pill Karaoke & Briefing Bar),
|
| 9 |
-
Works both Online and 100% Air-Gapped Offline (--offline)
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# Deck-to-Video v3.
|
| 13 |
|
| 14 |
Use this skill whenever the user asks to:
|
| 15 |
- Convert **PowerPoint (`.pptx`)**, **Word (`.docx`)**, **Markdown/text (`.md`/`.txt`)**, **HTML (`.html`)**, or **corporate DRM-encrypted Office documents** into a sleek presentation video, deep-dive tech briefing (like *ITํกํก* or *์ซ๋ํ์ ๋ธ๊น์ผ๊ธฐ*), lecture video, or SaaS explainer.
|
|
@@ -136,20 +136,33 @@ python3 "<SKILL_DIR>/produce_deck_video.py" \
|
|
| 136 |
--bg cycle \
|
| 137 |
--output "./output/offline_video.mp4"
|
| 138 |
```
|
| 139 |
-
*(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
---
|
| 142 |
|
| 143 |
-
## 3. Complete v3.
|
| 144 |
|
| 145 |
- **10 Background Presets (`--bg` or `[BG: ...]`)**: `auto`, `cycle`, `horizon_wave`, `wireframe_globe`, `isometric_hud_grid`, `neural_constellation`, `aurora_mesh`, `blueprint_grid`, `vercel_spotlight`, `warm_editorial`, `clean_paper_light`, `cyber_matrix`
|
| 146 |
-
- **
|
| 147 |
- **6 Caption Styles (`--caption-style`)**: `glass_dual`, `briefing_clean`, `pill_karaoke`, `cinema_minimal`, `neon_bar_left`, `kinetic_pop`
|
| 148 |
-
- **
|
| 149 |
1. `hero_3d_briefing` โ 3D rotating wireframe sphere + giant glowing title + rainbow topic pills
|
| 150 |
2. `media_showcase_split` โ Giant keyword + Korean/ASCII text scramble + right neon `.mp4`/`.png` frame (`[MEDIA: path]`, `[MEDIA_CAPTION: ...]`, `[HERO_WORD: ...]`, `[SCRAMBLE: ...]`)
|
| 151 |
-
3. `
|
| 152 |
-
4. `
|
| 153 |
-
5. `
|
| 154 |
-
6. `
|
| 155 |
-
7. `
|
|
|
|
|
|
|
|
|
| 5 |
Word (.docx), Markdown (.md/.txt), HTML (.html), or Agent-extracted JSON (--stdin-json) into sleek
|
| 6 |
code-rendered 1920x1080 MP4 presentation & tech-briefing videos. Includes 10 procedural background
|
| 7 |
presets (incl. 3D Wireframe Globe & Briefing Grid), 3 HUD modes (Chapter Tabs & ITํกํก Tech Briefing),
|
| 8 |
+
6 caption styles (incl. Pill Karaoke & Briefing Bar), 18 scene archetypes (incl. Documentary Dossier Stamp & Fullscreen B-Roll), and 10 procedural SFX.
|
| 9 |
+
Works both Online and 100% Air-Gapped Offline (--offline) with built-in interactive browser player and Enterprise DRM Bridge.
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Deck-to-Video v3.2 Motion Presentation, Documentary & Enterprise DRM Bridge Skill (`deck-video-pipeline`)
|
| 13 |
|
| 14 |
Use this skill whenever the user asks to:
|
| 15 |
- Convert **PowerPoint (`.pptx`)**, **Word (`.docx`)**, **Markdown/text (`.md`/`.txt`)**, **HTML (`.html`)**, or **corporate DRM-encrypted Office documents** into a sleek presentation video, deep-dive tech briefing (like *ITํกํก* or *์ซ๋ํ์ ๋ธ๊น์ผ๊ธฐ*), lecture video, or SaaS explainer.
|
|
|
|
| 136 |
--bg cycle \
|
| 137 |
--output "./output/offline_video.mp4"
|
| 138 |
```
|
| 139 |
+
*(์์ฑ๋ `projects/<์ด๋ฆ>/index.html`์ ์ผ๋ฐ ํฌ๋กฌ/์ฃ์ง ๋ธ๋ผ์ฐ์ ๋ก ์ง์ ์ด๋ฉด ํ๋จ์ ์ธํฐ๋ํฐ๋ธ ์น ํ๋ ์ ํ
์ด์
์ฌ์ ์ปจํธ๋กค ๋ฐ `โถ ์ฌ์ / โ ์ด์ / ๋ค์ โถ`๊ฐ ์๋์ผ๋ก ํ์ฑํ๋ฉ๋๋ค!)*
|
| 140 |
+
|
| 141 |
+
### E. ์ค๋ช
์ข์ํ๋์์ ์จ Documentary / Editorial Style (`--hud-style docu_watermark`)
|
| 142 |
+
```bash
|
| 143 |
+
python3 "<SKILL_DIR>/produce_deck_video.py" \
|
| 144 |
+
--input "<SKILL_DIR>/samples/sample_docu_patent.md" \
|
| 145 |
+
--bg warm_editorial \
|
| 146 |
+
--hud-style docu_watermark \
|
| 147 |
+
--brand "์ค๋ช
์ข์ํ๋ | ์์ ์จ" \
|
| 148 |
+
--caption-style cinema_minimal \
|
| 149 |
+
--output "./output/documentary_video.mp4"
|
| 150 |
+
```
|
| 151 |
|
| 152 |
---
|
| 153 |
|
| 154 |
+
## 3. Complete v3.2 Presets & Slide Tags
|
| 155 |
|
| 156 |
- **10 Background Presets (`--bg` or `[BG: ...]`)**: `auto`, `cycle`, `horizon_wave`, `wireframe_globe`, `isometric_hud_grid`, `neural_constellation`, `aurora_mesh`, `blueprint_grid`, `vercel_spotlight`, `warm_editorial`, `clean_paper_light`, `cyber_matrix`
|
| 157 |
+
- **4 Top HUD Modes (`--hud-style`)**: `chapter_tabs`, `tech_briefing` (with `--brand "..."`), `docu_watermark` (with `--brand "์๋จ | ํ๋จ"`), `minimal`
|
| 158 |
- **6 Caption Styles (`--caption-style`)**: `glass_dual`, `briefing_clean`, `pill_karaoke`, `cinema_minimal`, `neon_bar_left`, `kinetic_pop`
|
| 159 |
+
- **18 Scene Archetypes (`[ARCHETYPE: ...]` or JSON `"archetype"`)**:
|
| 160 |
1. `hero_3d_briefing` โ 3D rotating wireframe sphere + giant glowing title + rainbow topic pills
|
| 161 |
2. `media_showcase_split` โ Giant keyword + Korean/ASCII text scramble + right neon `.mp4`/`.png` frame (`[MEDIA: path]`, `[MEDIA_CAPTION: ...]`, `[HERO_WORD: ...]`, `[SCRAMBLE: ...]`)
|
| 162 |
+
3. `cinema_broll_fullscreen` โ Fullscreen B-Roll `.mp4`/`.jpg` (`[BROLL: path]`) + Ken Burns zoom + dark cinema vignette
|
| 163 |
+
4. `dossier_stamp_card` โ Official Kraft manilla folder / White USPTO patent card + rubber stamp slam (`[STAMP: ๊ฐ๋ฐ ๊ณํ ์์]`, `[SOURCE: ...]`)
|
| 164 |
+
5. `changelog_vertical` โ Color-coded dates (`11.03 | v2.29 | ๋ด์ฉ`) + glowing spine + `[SOURCE: ...]`
|
| 165 |
+
6. `mission_staircase` โ 5-color `MISSION 1..5` rows + 3D ascending translucent stepper blocks
|
| 166 |
+
7. `swarm_network` โ Central golden `COORDINATOR` hub + 5 `@worker`/`@verifier` spoke nodes
|
| 167 |
+
8. `pricing_matrix` โ Multi-tier comparison table (`[PLANS: ๋ฌด๋ฃ โฉ0 | Pro | Ultra]`, rows `๊ธฐ๋ฅ | โ | โณ | โ`)
|
| 168 |
+
9. `arc_cards`, 10. `bento_grid`, 11. `mockup_steps`, 12. `book_quote`, 13. `notebook_flip`, 14. `vs_comparison`, 15. `data_bars`, 16. `process_timeline`, 17. `terminal_flow`, 18. `metric_summary`
|
assets/js/standalone_player.js
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Standalone Browser Presentation Player for Deck2Video v3.2
|
| 2 |
+
* Automatically inactive inside HyperFrames CLI & Offline Headless Renderer.
|
| 3 |
+
* Activates ONLY when a human opens index.html directly in Chrome / Edge / Safari.
|
| 4 |
+
*/
|
| 5 |
+
(function () {
|
| 6 |
+
if (!window.__IS_STANDALONE_BROWSER) return;
|
| 7 |
+
|
| 8 |
+
var tl = window.__timelines && window.__timelines["main"];
|
| 9 |
+
var choreo = window.__CHOREO_SPEC;
|
| 10 |
+
if (!tl || !choreo) return;
|
| 11 |
+
|
| 12 |
+
var totalDur = choreo.totalDuration || tl.duration() || 10;
|
| 13 |
+
var slides = choreo.slides || [];
|
| 14 |
+
var playing = false;
|
| 15 |
+
var curTime = 0;
|
| 16 |
+
|
| 17 |
+
var clips = Array.prototype.slice.call(document.querySelectorAll(".clip[data-start]"));
|
| 18 |
+
var audios = Array.prototype.slice.call(document.querySelectorAll("audio[data-start]"));
|
| 19 |
+
var videos = Array.prototype.slice.call(document.querySelectorAll("video[data-start]"));
|
| 20 |
+
|
| 21 |
+
function fitViewport() {
|
| 22 |
+
var root = document.getElementById("root");
|
| 23 |
+
if (!root) return;
|
| 24 |
+
var vw = window.innerWidth || 1920;
|
| 25 |
+
var vh = window.innerHeight || 1080;
|
| 26 |
+
var scale = Math.min(vw / 1920, vh / 1080);
|
| 27 |
+
document.documentElement.style.width = "100%";
|
| 28 |
+
document.documentElement.style.height = "100%";
|
| 29 |
+
document.body.style.width = "100%";
|
| 30 |
+
document.body.style.height = "100%";
|
| 31 |
+
document.body.style.display = "flex";
|
| 32 |
+
document.body.style.alignItems = "center";
|
| 33 |
+
document.body.style.justifyContent = "center";
|
| 34 |
+
document.body.style.background = "#02040a";
|
| 35 |
+
root.style.width = "1920px";
|
| 36 |
+
root.style.height = "1080px";
|
| 37 |
+
root.style.flexShrink = "0";
|
| 38 |
+
root.style.transformOrigin = "center center";
|
| 39 |
+
root.style.transform = "scale(" + scale.toFixed(4) + ")";
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
function fmtTime(sec) {
|
| 43 |
+
var s = Math.max(0, Math.floor(sec));
|
| 44 |
+
var m = Math.floor(s / 60);
|
| 45 |
+
var r = s % 60;
|
| 46 |
+
return (m < 10 ? "0" + m : String(m)) + ":" + (r < 10 ? "0" + r : String(r));
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
function currentSlideIndex(t) {
|
| 50 |
+
for (var i = 0; i < slides.length; i++) {
|
| 51 |
+
if (t >= slides[i].start && t < slides[i].end) return i;
|
| 52 |
+
}
|
| 53 |
+
return Math.max(0, slides.length - 1);
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
function syncClipsAndMedia(t, syncAudioPlay) {
|
| 57 |
+
for (var i = 0; i < clips.length; i++) {
|
| 58 |
+
var el = clips[i];
|
| 59 |
+
var st = parseFloat(el.getAttribute("data-start") || "0");
|
| 60 |
+
var dur = parseFloat(el.getAttribute("data-duration") || "999999");
|
| 61 |
+
el.style.visibility = t >= st && t < st + dur ? "visible" : "hidden";
|
| 62 |
+
}
|
| 63 |
+
for (var v = 0; v < videos.length; v++) {
|
| 64 |
+
var vid = videos[v];
|
| 65 |
+
var vst = parseFloat(vid.getAttribute("data-start") || "0");
|
| 66 |
+
var vdur = parseFloat(vid.getAttribute("data-duration") || "999999");
|
| 67 |
+
if (t >= vst && t < vst + vdur) {
|
| 68 |
+
var localV = Math.max(0, t - vst);
|
| 69 |
+
if (vid.duration && isFinite(vid.duration) && vid.duration > 0) {
|
| 70 |
+
localV = localV % vid.duration;
|
| 71 |
+
}
|
| 72 |
+
if (playing) {
|
| 73 |
+
if (vid.paused) vid.play().catch(function () {});
|
| 74 |
+
} else {
|
| 75 |
+
if (!vid.paused) vid.pause();
|
| 76 |
+
try { vid.currentTime = localV; } catch (e) {}
|
| 77 |
+
}
|
| 78 |
+
} else if (!vid.paused) {
|
| 79 |
+
vid.pause();
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
if (syncAudioPlay) {
|
| 83 |
+
for (var a = 0; a < audios.length; a++) {
|
| 84 |
+
var aud = audios[a];
|
| 85 |
+
var ast = parseFloat(aud.getAttribute("data-start") || "0");
|
| 86 |
+
var adur = parseFloat(aud.getAttribute("data-duration") || "0");
|
| 87 |
+
var vol = parseFloat(aud.getAttribute("data-volume") || "1");
|
| 88 |
+
aud.volume = Math.max(0, Math.min(1, vol));
|
| 89 |
+
if (playing && t >= ast && t < ast + adur - 0.04) {
|
| 90 |
+
var targetT = t - ast;
|
| 91 |
+
if (aud.paused) {
|
| 92 |
+
try { aud.currentTime = targetT; } catch (e) {}
|
| 93 |
+
aud.play().catch(function () {});
|
| 94 |
+
} else if (Math.abs((aud.currentTime || 0) - targetT) > 0.28) {
|
| 95 |
+
try { aud.currentTime = targetT; } catch (e) {}
|
| 96 |
+
}
|
| 97 |
+
} else if (!aud.paused) {
|
| 98 |
+
aud.pause();
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
tl.seek(t, false);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
function stopAllAudio() {
|
| 106 |
+
for (var a = 0; a < audios.length; a++) {
|
| 107 |
+
if (!audios[a].paused) audios[a].pause();
|
| 108 |
+
}
|
| 109 |
+
for (var v = 0; v < videos.length; v++) {
|
| 110 |
+
if (!videos[v].paused) videos[v].pause();
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
// Build sleek floating HUD bar outside #root so it fits any screen
|
| 115 |
+
var bar = document.createElement("div");
|
| 116 |
+
bar.setAttribute("data-layout-ignore", "");
|
| 117 |
+
bar.style.cssText =
|
| 118 |
+
"position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:9999;" +
|
| 119 |
+
"display:flex;align-items:center;gap:12px;padding:10px 18px;border-radius:999px;" +
|
| 120 |
+
"background:rgba(8,14,28,0.92);border:1px solid rgba(56,189,248,0.45);" +
|
| 121 |
+
"box-shadow:0 12px 32px rgba(0,0,0,0.65);font-family:sans-serif;color:#f8fafc;font-size:14px;user-select:none;";
|
| 122 |
+
|
| 123 |
+
var btnPrev = document.createElement("button");
|
| 124 |
+
btnPrev.textContent = "โ ์ด์ ";
|
| 125 |
+
var btnPlay = document.createElement("button");
|
| 126 |
+
btnPlay.textContent = "โถ ์ฌ์ (Space)";
|
| 127 |
+
var btnNext = document.createElement("button");
|
| 128 |
+
btnNext.textContent = "๋ค์ โถ";
|
| 129 |
+
|
| 130 |
+
[btnPrev, btnPlay, btnNext].forEach(function (b, idx) {
|
| 131 |
+
b.style.cssText =
|
| 132 |
+
"border:1px solid " + (idx === 1 ? "#38bdf8" : "rgba(148,163,184,0.35)") + ";" +
|
| 133 |
+
"background:" + (idx === 1 ? "#0284c7" : "rgba(30,41,59,0.85)") + ";" +
|
| 134 |
+
"color:#fff;font-weight:700;font-size:13px;padding:6px 14px;border-radius:999px;cursor:pointer;";
|
| 135 |
+
});
|
| 136 |
+
|
| 137 |
+
var slideBadge = document.createElement("span");
|
| 138 |
+
slideBadge.style.cssText = "font-weight:800;color:#7dd3fc;min-width:74px;text-align:center;";
|
| 139 |
+
|
| 140 |
+
var scrub = document.createElement("input");
|
| 141 |
+
scrub.type = "range";
|
| 142 |
+
scrub.min = "0";
|
| 143 |
+
scrub.max = String(totalDur);
|
| 144 |
+
scrub.step = "0.03";
|
| 145 |
+
scrub.value = "0";
|
| 146 |
+
scrub.style.cssText = "width:220px;accent-color:#38bdf8;cursor:pointer;";
|
| 147 |
+
|
| 148 |
+
var timeLabel = document.createElement("span");
|
| 149 |
+
timeLabel.style.cssText = "font-family:monospace;font-size:13px;color:#cbd5e1;min-width:96px;text-align:right;";
|
| 150 |
+
|
| 151 |
+
bar.appendChild(btnPrev);
|
| 152 |
+
bar.appendChild(btnPlay);
|
| 153 |
+
bar.appendChild(btnNext);
|
| 154 |
+
bar.appendChild(slideBadge);
|
| 155 |
+
bar.appendChild(scrub);
|
| 156 |
+
bar.appendChild(timeLabel);
|
| 157 |
+
document.body.appendChild(bar);
|
| 158 |
+
|
| 159 |
+
function updateUI() {
|
| 160 |
+
var sIdx = currentSlideIndex(curTime);
|
| 161 |
+
slideBadge.textContent = "SLIDE " + (sIdx + 1) + " / " + slides.length;
|
| 162 |
+
scrub.value = String(curTime.toFixed(2));
|
| 163 |
+
timeLabel.textContent = fmtTime(curTime) + " / " + fmtTime(totalDur);
|
| 164 |
+
btnPlay.textContent = playing ? "โธ ์ผ์์ ์ง" : "โถ ์ฌ์ (Space)";
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
function seekTo(newT) {
|
| 168 |
+
curTime = Math.max(0, Math.min(totalDur - 0.01, newT));
|
| 169 |
+
syncClipsAndMedia(curTime, playing);
|
| 170 |
+
updateUI();
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
function togglePlay() {
|
| 174 |
+
if (curTime >= totalDur - 0.05) curTime = 0;
|
| 175 |
+
playing = !playing;
|
| 176 |
+
if (!playing) stopAllAudio();
|
| 177 |
+
syncClipsAndMedia(curTime, playing);
|
| 178 |
+
updateUI();
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
gsap.ticker.add(function (time, deltaTime) {
|
| 182 |
+
if (!playing) return;
|
| 183 |
+
var dt = (deltaTime || 16.67) / 1000;
|
| 184 |
+
curTime += Math.min(0.1, Math.max(0.001, dt));
|
| 185 |
+
if (curTime >= totalDur) {
|
| 186 |
+
curTime = totalDur - 0.01;
|
| 187 |
+
playing = false;
|
| 188 |
+
stopAllAudio();
|
| 189 |
+
}
|
| 190 |
+
syncClipsAndMedia(curTime, true);
|
| 191 |
+
updateUI();
|
| 192 |
+
});
|
| 193 |
+
|
| 194 |
+
btnPlay.addEventListener("click", togglePlay);
|
| 195 |
+
btnPrev.addEventListener("click", function () {
|
| 196 |
+
var idx = currentSlideIndex(curTime);
|
| 197 |
+
var targetIdx = curTime - slides[idx].start > 1.2 ? idx : Math.max(0, idx - 1);
|
| 198 |
+
if (slides[targetIdx]) seekTo(slides[targetIdx].start + 0.05);
|
| 199 |
+
});
|
| 200 |
+
btnNext.addEventListener("click", function () {
|
| 201 |
+
var idx = currentSlideIndex(curTime);
|
| 202 |
+
var targetIdx = Math.min(slides.length - 1, idx + 1);
|
| 203 |
+
if (slides[targetIdx]) seekTo(slides[targetIdx].start + 0.05);
|
| 204 |
+
});
|
| 205 |
+
scrub.addEventListener("input", function () {
|
| 206 |
+
seekTo(parseFloat(scrub.value || "0"));
|
| 207 |
+
});
|
| 208 |
+
|
| 209 |
+
window.addEventListener("keydown", function (e) {
|
| 210 |
+
if (e.code === "Space") {
|
| 211 |
+
e.preventDefault();
|
| 212 |
+
togglePlay();
|
| 213 |
+
} else if (e.code === "ArrowRight") {
|
| 214 |
+
e.preventDefault();
|
| 215 |
+
btnNext.click();
|
| 216 |
+
} else if (e.code === "ArrowLeft") {
|
| 217 |
+
e.preventDefault();
|
| 218 |
+
btnPrev.click();
|
| 219 |
+
}
|
| 220 |
+
});
|
| 221 |
+
|
| 222 |
+
window.addEventListener("resize", fitViewport);
|
| 223 |
+
fitViewport();
|
| 224 |
+
// Show Slide 1 at rest (t = 0.45s so intro entrance is visible immediately when opened!)
|
| 225 |
+
seekTo(Math.min(0.45, totalDur * 0.1));
|
| 226 |
+
})();
|
deck2video_offline_full.zip
CHANGED
|
@@ -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:ca47fe3f972fa161f1c2d02e650fd2f8e82e2c3803cb817a3af3ac7887880155
|
| 3 |
+
size 92081880
|
html_builder.py
CHANGED
|
@@ -155,6 +155,83 @@ def _render_media_showcase_split_scene(
|
|
| 155 |
</div>"""
|
| 156 |
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
def _render_changelog_vertical_scene(slide: dict[str, Any], s_idx: int) -> str:
|
| 159 |
sid = f"s{s_idx + 1}"
|
| 160 |
bullets = (slide.get("bullets") or ["11.03 | v2.29 | ์์ฑ ๋ชจ๋ ๋ฐฐํฌ", "11.09 | v2.30 | ์ง์ ์
๋ฌด ๋ ์ด์์"])[:6]
|
|
@@ -805,6 +882,9 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 805 |
shutil.copy2(font_src, fonts_dst / "PretendardVariable.woff2")
|
| 806 |
if gsap_src.exists():
|
| 807 |
shutil.copy2(gsap_src, js_dst / "gsap.min.js")
|
|
|
|
|
|
|
|
|
|
| 808 |
|
| 809 |
requested_bg = (spec.get("bg_preset") or "horizon_wave").lower().strip()
|
| 810 |
all_text = " ".join(s.get("title", "") + " " + " ".join(s.get("bullets", [])) for s in spec.get("slides", []))
|
|
@@ -834,13 +914,30 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 834 |
total_dur = spec["total_duration"]
|
| 835 |
chapters = spec.get("chapters", [])
|
| 836 |
|
| 837 |
-
# 1. Top HUD Layer (`chapter_tabs` vs `tech_briefing` vs `minimal`)
|
| 838 |
if hud_style == "tech_briefing":
|
| 839 |
hud_markup = f"""
|
| 840 |
<header class="briefing-hud">
|
| 841 |
<span class="briefing-brand">{_esc(brand_label)}</span>
|
| 842 |
<span id="briefing-cursor" class="briefing-cursor" data-layout-ignore>|</span>
|
| 843 |
</header>"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 844 |
elif hud_style == "minimal":
|
| 845 |
hud_markup = ""
|
| 846 |
else:
|
|
@@ -899,6 +996,22 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 899 |
data-duration="{slide['duration']}"
|
| 900 |
data-track-index="5"
|
| 901 |
></video>""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 902 |
elif arch == "changelog_vertical":
|
| 903 |
inner_markup = _render_changelog_vertical_scene(slide, s_idx)
|
| 904 |
elif arch == "mission_staircase":
|
|
@@ -1065,7 +1178,7 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 1065 |
choreo_json = json.dumps(choreo_payload, ensure_ascii=False)
|
| 1066 |
is_light = theme["is_light"]
|
| 1067 |
border_subtle = "rgba(15, 23, 42, 0.14)" if is_light else "rgba(148, 163, 184, 0.22)"
|
| 1068 |
-
cinema_bg = "rgba(15, 23, 42, 0.88)" if is_light else "
|
| 1069 |
|
| 1070 |
html_doc = f"""<!doctype html>
|
| 1071 |
<html lang="ko" data-resolution="landscape">
|
|
@@ -1132,6 +1245,17 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 1132 |
}}
|
| 1133 |
.briefing-cursor {{ color: var(--accent); font-weight: 900; }}
|
| 1134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1135 |
.hud-corner {{ position: absolute; width: 52px; height: 52px; border-color: rgba(96, 165, 250, 0.55); border-style: solid; pointer-events: none; }}
|
| 1136 |
.hud-corner.tl {{ top: 48px; left: 56px; border-width: 2px 0 0 2px; }}
|
| 1137 |
.hud-corner.tr {{ top: 48px; right: 56px; border-width: 2px 2px 0 0; }}
|
|
@@ -1184,6 +1308,53 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 1184 |
.sim-line {{ padding: 18px 22px; border-radius: 14px; background: rgba(30, 41, 59, 0.72); border: 1px solid rgba(56, 189, 248, 0.35); display: flex; align-items: center; gap: 14px; font-size: 22px; font-weight: 700; color: #f8fafc; }}
|
| 1185 |
.sim-dot {{ width: 10px; height: 10px; border-radius: 50%; background: #38bdf8; flex-shrink: 0; }}
|
| 1186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1187 |
/* NEW 3: Vertical Changelog */
|
| 1188 |
.scene-changelog {{ align-items: flex-start; justify-content: center; max-width: 1580px; }}
|
| 1189 |
.clog-header {{ font-size: 52px; font-weight: 900; color: var(--text-primary); letter-spacing: -0.03em; align-self: flex-start; }}
|
|
@@ -1399,7 +1570,7 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 1399 |
.caption-box {{ padding: 14px 32px; border-radius: 18px; background: var(--cap-bg); border: 1px solid rgba(148, 163, 184, 0.2); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 1560px; }}
|
| 1400 |
.caption-box.style-briefing {{ width: 1540px; border-radius: 12px; background: rgba(3, 6, 14, 0.90); border: 1px solid rgba(56, 189, 248, 0.14); padding: 15px 36px; }}
|
| 1401 |
.briefing-ko {{ font-size: 36px; font-weight: 700; }}
|
| 1402 |
-
.caption-box.style-cinema {{ background: {cinema_bg}; border: none; padding: 10px 28px; }}
|
| 1403 |
.caption-box.style-neon-bar {{ align-items: flex-start; text-align: left; border-radius: 6px 18px 18px 6px; border-left: 6px solid var(--accent); padding: 14px 34px; }}
|
| 1404 |
.neon-bar-kicker {{ font-size: 14px; font-weight: 800; letter-spacing: 0.08em; color: #7dd3fc; }}
|
| 1405 |
.cap-ko {{ font-size: 39px; font-weight: 800; color: #ffffff; letter-spacing: -0.02em; line-height: 1.25; text-shadow: 0 2px 14px rgba(0,0,0,0.88); }}
|
|
@@ -1469,6 +1640,9 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 1469 |
for (let ci = 0; ci < CHOREO.chaptersCount; ci++) {{
|
| 1470 |
gsap.set("#chap-fill-" + ci, {{ scaleX: 0 }});
|
| 1471 |
}}
|
|
|
|
|
|
|
|
|
|
| 1472 |
|
| 1473 |
// Deterministic Text Scramble Decode Animations
|
| 1474 |
CHOREO.scrambles.forEach(function (sc) {{
|
|
@@ -1530,6 +1704,21 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 1530 |
}} else if (s.archetype === "media_showcase_split") {{
|
| 1531 |
tl.fromTo("#" + sid + "-hero-kw", {{ opacity: 0, x: -30 }}, {{ opacity: 1, x: 0, duration: 0.45, ease: "power3.out" }}, st + 0.10);
|
| 1532 |
tl.fromTo("#" + sid + "-media-frame", {{ opacity: 0, x: 36, scale: 0.96 }}, {{ opacity: 1, x: 0, scale: 1.0, duration: 0.52, ease: "power3.out" }}, st + 0.14);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1533 |
}} else if (s.archetype === "changelog_vertical") {{
|
| 1534 |
tl.fromTo("#" + sid + "-clog-spine", {{ scaleY: 0 }}, {{ scaleY: 1, duration: Math.min(1.4, dur * 0.6), ease: "power2.out" }}, st + 0.12);
|
| 1535 |
const rCount = Math.min(6, Math.max(1, s.bulletsCount));
|
|
@@ -1635,9 +1824,13 @@ def compile_hyperframes_project(spec: dict[str, Any], project_dir: Path) -> Path
|
|
| 1635 |
}});
|
| 1636 |
}}
|
| 1637 |
|
|
|
|
|
|
|
|
|
|
| 1638 |
window.__timelines["main"] = tl;
|
| 1639 |
tl.seek(0);
|
| 1640 |
</script>
|
|
|
|
| 1641 |
</body>
|
| 1642 |
</html>
|
| 1643 |
"""
|
|
|
|
| 155 |
</div>"""
|
| 156 |
|
| 157 |
|
| 158 |
+
def _render_dossier_stamp_scene(slide: dict[str, Any], s_idx: int) -> str:
|
| 159 |
+
"""Documentary official folder / patent dossier card with tilted rubber stamp (์ค๋ช
์ข์ํ๋์์ ์จ ์คํ์ผ)."""
|
| 160 |
+
sid = f"s{s_idx + 1}"
|
| 161 |
+
bullets = (slide.get("bullets") or ["ํต์ฌ ํญ๋ชฉ | ์ธ๋ถ ๋ด์ฉ ์์ฝ"])[:4]
|
| 162 |
+
title = slide.get("title", "๊ณต์ ๋ฌธ์ ์์ฝ")
|
| 163 |
+
combined_hdr = (title + " " + slide.get("badge", "") + " " + slide.get("stamp_text", "")).lower()
|
| 164 |
+
is_statement = any(k in combined_hdr for k in ["ํด๋ช
", "๊ณต์ ์
์ฅ", "statement", "์ฐ๋ ค", "๋
ผ๋", "์์", "๋ถ๊ฐ", "๋ฐ๋ฐ"])
|
| 165 |
+
is_patent = (not is_statement) and any(k in combined_hdr for k in ["ํนํ", "patent", "uspto", "๋ฑ๋ก"])
|
| 166 |
+
folder_cls = "dossier-card-white" if is_patent else "dossier-card-kraft"
|
| 167 |
+
tab_label = slide.get("badge") if slide.get("badge") and not slide.get("badge", "").startswith("SECTION") else (
|
| 168 |
+
"USPTO REGISTERED PATENT" if is_patent else "OFFICIAL STATEMENT ยท ๊ณต์ ๋ฌธ์ ์์ฝ"
|
| 169 |
+
)
|
| 170 |
+
stamp_txt = slide.get("stamp_text") or ("PATENT REGISTERED" if is_patent else "ํต์ฌ ์์ ํ์ธ")
|
| 171 |
+
stamp_cls = "rubber-stamp stamp-blue" if is_patent else "rubber-stamp stamp-red"
|
| 172 |
+
|
| 173 |
+
rows_html = []
|
| 174 |
+
for i, raw in enumerate(bullets):
|
| 175 |
+
k_txt, v_txt = _split_card_item(raw, i)
|
| 176 |
+
rows_html.append(f"""
|
| 177 |
+
<div id="{sid}-dos-row-{i}" class="dossier-row">
|
| 178 |
+
<span class="dossier-key">{_esc(k_txt)}</span>
|
| 179 |
+
<span class="dossier-val">{_esc(v_txt)}</span>
|
| 180 |
+
</div>""")
|
| 181 |
+
|
| 182 |
+
meta_right = slide.get("source_note") or slide.get("subtitle") or ""
|
| 183 |
+
meta_html = f'<span class="dossier-meta-right">{_esc(meta_right)}</span>' if meta_right else ""
|
| 184 |
+
|
| 185 |
+
return f"""
|
| 186 |
+
<div id="{sid}-inner" class="scene-inner scene-dossier">
|
| 187 |
+
<div id="{sid}-dos-shell" class="dossier-shell">
|
| 188 |
+
<div class="dossier-folder-tab">{_esc(tab_label)}</div>
|
| 189 |
+
<div class="dossier-card {folder_cls}">
|
| 190 |
+
<div class="dossier-head-row">
|
| 191 |
+
<h2 class="dossier-title">{_esc(title)}</h2>
|
| 192 |
+
{meta_html}
|
| 193 |
+
</div>
|
| 194 |
+
<div class="dossier-divider" data-layout-ignore></div>
|
| 195 |
+
<div class="dossier-rows">{"".join(rows_html)}</div>
|
| 196 |
+
<div id="{sid}-dos-stamp" class="{stamp_cls}" data-layout-ignore>{_esc(stamp_txt)}</div>
|
| 197 |
+
</div>
|
| 198 |
+
</div>
|
| 199 |
+
</div>"""
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
def _render_cinema_broll_scene(
|
| 203 |
+
slide: dict[str, Any],
|
| 204 |
+
s_idx: int,
|
| 205 |
+
rel_media_path: str,
|
| 206 |
+
media_kind: str,
|
| 207 |
+
) -> str:
|
| 208 |
+
"""Full-screen documentary B-Roll (image Ken-Burns or sibling video) with dark cinema vignette."""
|
| 209 |
+
sid = f"s{s_idx + 1}"
|
| 210 |
+
kicker = slide.get("badge") if slide.get("badge") and not slide.get("badge", "").startswith("SECTION") else ""
|
| 211 |
+
kicker_html = f'<div class="broll-kicker">{_esc(kicker)}</div>' if kicker else ""
|
| 212 |
+
|
| 213 |
+
if media_kind == "image" and rel_media_path:
|
| 214 |
+
bg_layer = f'<img id="{sid}-broll-img" src="{_esc(rel_media_path)}" alt="" class="broll-full-img" data-layout-allow-overflow data-layout-ignore />'
|
| 215 |
+
center_card = ""
|
| 216 |
+
elif media_kind == "video" and rel_media_path:
|
| 217 |
+
bg_layer = ""
|
| 218 |
+
center_card = ""
|
| 219 |
+
else:
|
| 220 |
+
bg_layer = ""
|
| 221 |
+
center_card = f"""
|
| 222 |
+
<div class="broll-atmos-title-wrap">
|
| 223 |
+
{kicker_html}
|
| 224 |
+
<h2 id="{sid}-broll-title" class="broll-atmos-title">{_esc(slide.get("title", ""))}</h2>
|
| 225 |
+
</div>"""
|
| 226 |
+
|
| 227 |
+
return f"""
|
| 228 |
+
<div id="{sid}-inner" class="scene-inner scene-broll-full">
|
| 229 |
+
{bg_layer}
|
| 230 |
+
<div class="broll-vignette" data-layout-ignore></div>
|
| 231 |
+
{center_card}
|
| 232 |
+
</div>"""
|
| 233 |
+
|
| 234 |
+
|
| 235 |
def _render_changelog_vertical_scene(slide: dict[str, Any], s_idx: int) -> str:
|
| 236 |
sid = f"s{s_idx + 1}"
|
| 237 |
bullets = (slide.get("bullets") or ["11.03 | v2.29 | ์์ฑ ๋ชจ๋ ๋ฐฐํฌ", "11.09 | v2.30 | ์ง์ ์
๋ฌด ๋ ์ด์์"])[:6]
|
|
|
|
| 882 |
shutil.copy2(font_src, fonts_dst / "PretendardVariable.woff2")
|
| 883 |
if gsap_src.exists():
|
| 884 |
shutil.copy2(gsap_src, js_dst / "gsap.min.js")
|
| 885 |
+
player_src = PIPELINE_ROOT / "assets" / "js" / "standalone_player.js"
|
| 886 |
+
if player_src.exists():
|
| 887 |
+
shutil.copy2(player_src, js_dst / "standalone_player.js")
|
| 888 |
|
| 889 |
requested_bg = (spec.get("bg_preset") or "horizon_wave").lower().strip()
|
| 890 |
all_text = " ".join(s.get("title", "") + " " + " ".join(s.get("bullets", [])) for s in spec.get("slides", []))
|
|
|
|
| 914 |
total_dur = spec["total_duration"]
|
| 915 |
chapters = spec.get("chapters", [])
|
| 916 |
|
| 917 |
+
# 1. Top HUD Layer (`chapter_tabs` vs `tech_briefing` vs `docu_watermark` vs `minimal`)
|
| 918 |
if hud_style == "tech_briefing":
|
| 919 |
hud_markup = f"""
|
| 920 |
<header class="briefing-hud">
|
| 921 |
<span class="briefing-brand">{_esc(brand_label)}</span>
|
| 922 |
<span id="briefing-cursor" class="briefing-cursor" data-layout-ignore>|</span>
|
| 923 |
</header>"""
|
| 924 |
+
elif hud_style == "docu_watermark":
|
| 925 |
+
if "|" in brand_label:
|
| 926 |
+
wm_top, wm_bot = [x.strip() for x in brand_label.split("|", 1)]
|
| 927 |
+
else:
|
| 928 |
+
words = brand_label.strip().split()
|
| 929 |
+
if len(words) >= 2:
|
| 930 |
+
wm_top, wm_bot = " ".join(words[:-1]), words[-1]
|
| 931 |
+
else:
|
| 932 |
+
wm_top, wm_bot = "DOCUMENTARY", brand_label.strip()[:12]
|
| 933 |
+
hud_markup = f"""
|
| 934 |
+
<div class="docu-top-bar" data-layout-ignore>
|
| 935 |
+
<div id="docu-prog-fill" class="docu-top-fill"></div>
|
| 936 |
+
</div>
|
| 937 |
+
<header class="docu-wm-hud">
|
| 938 |
+
<span class="docu-wm-top">{_esc(wm_top)}</span>
|
| 939 |
+
<span class="docu-wm-bot">{_esc(wm_bot)}</span>
|
| 940 |
+
</header>"""
|
| 941 |
elif hud_style == "minimal":
|
| 942 |
hud_markup = ""
|
| 943 |
else:
|
|
|
|
| 996 |
data-duration="{slide['duration']}"
|
| 997 |
data-track-index="5"
|
| 998 |
></video>""")
|
| 999 |
+
elif arch == "cinema_broll_fullscreen":
|
| 1000 |
+
inner_markup = _render_cinema_broll_scene(slide, s_idx, rel_media, media_kind)
|
| 1001 |
+
if media_kind == "video" and rel_media:
|
| 1002 |
+
video_overlays_html.append(f"""
|
| 1003 |
+
<video
|
| 1004 |
+
id="broll-vid-{s_idx + 1}"
|
| 1005 |
+
class="clip broll-video-overlay"
|
| 1006 |
+
src="{_esc(rel_media)}"
|
| 1007 |
+
muted
|
| 1008 |
+
playsinline
|
| 1009 |
+
data-start="{slide['start']}"
|
| 1010 |
+
data-duration="{slide['duration']}"
|
| 1011 |
+
data-track-index="5"
|
| 1012 |
+
></video>""")
|
| 1013 |
+
elif arch == "dossier_stamp_card":
|
| 1014 |
+
inner_markup = _render_dossier_stamp_scene(slide, s_idx)
|
| 1015 |
elif arch == "changelog_vertical":
|
| 1016 |
inner_markup = _render_changelog_vertical_scene(slide, s_idx)
|
| 1017 |
elif arch == "mission_staircase":
|
|
|
|
| 1178 |
choreo_json = json.dumps(choreo_payload, ensure_ascii=False)
|
| 1179 |
is_light = theme["is_light"]
|
| 1180 |
border_subtle = "rgba(15, 23, 42, 0.14)" if is_light else "rgba(148, 163, 184, 0.22)"
|
| 1181 |
+
cinema_bg = "rgba(15, 23, 42, 0.88)" if is_light else "rgba(4, 6, 12, 0.84)"
|
| 1182 |
|
| 1183 |
html_doc = f"""<!doctype html>
|
| 1184 |
<html lang="ko" data-resolution="landscape">
|
|
|
|
| 1245 |
}}
|
| 1246 |
.briefing-cursor {{ color: var(--accent); font-weight: 900; }}
|
| 1247 |
|
| 1248 |
+
/* HUD C: Documentary Watermark + Top Progress Bar (์ค๋ช
์ข์ํ๋์์ ์จ ์คํ์ผ) */
|
| 1249 |
+
.docu-top-bar {{ position: absolute; top: 18px; left: 36px; right: 380px; height: 4px; border-radius: 99px; background: rgba(148, 163, 184, 0.24); overflow: hidden; z-index: 22; }}
|
| 1250 |
+
.docu-top-fill {{ display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #38bdf8, #34d399); transform-origin: left center; }}
|
| 1251 |
+
.docu-wm-hud {{
|
| 1252 |
+
position: absolute; top: 44px; right: 76px; z-index: 22;
|
| 1253 |
+
display: flex; flex-direction: column; align-items: center; gap: 2px;
|
| 1254 |
+
text-shadow: 0 2px 12px rgba(0,0,0,0.85);
|
| 1255 |
+
}}
|
| 1256 |
+
.docu-wm-top {{ font-size: 16px; font-weight: 800; color: #f8fafc; letter-spacing: -0.01em; }}
|
| 1257 |
+
.docu-wm-bot {{ font-size: 38px; font-weight: 900; color: #ffffff; letter-spacing: -0.03em; line-height: 1.02; }}
|
| 1258 |
+
|
| 1259 |
.hud-corner {{ position: absolute; width: 52px; height: 52px; border-color: rgba(96, 165, 250, 0.55); border-style: solid; pointer-events: none; }}
|
| 1260 |
.hud-corner.tl {{ top: 48px; left: 56px; border-width: 2px 0 0 2px; }}
|
| 1261 |
.hud-corner.tr {{ top: 48px; right: 56px; border-width: 2px 2px 0 0; }}
|
|
|
|
| 1308 |
.sim-line {{ padding: 18px 22px; border-radius: 14px; background: rgba(30, 41, 59, 0.72); border: 1px solid rgba(56, 189, 248, 0.35); display: flex; align-items: center; gap: 14px; font-size: 22px; font-weight: 700; color: #f8fafc; }}
|
| 1309 |
.sim-dot {{ width: 10px; height: 10px; border-radius: 50%; background: #38bdf8; flex-shrink: 0; }}
|
| 1310 |
|
| 1311 |
+
/* NEW 2B: Documentary Dossier / Patent Stamp Card (์ค๋ช
์ข์ํ๋์์ ์จ ์คํ์ผ) */
|
| 1312 |
+
.scene-dossier {{ justify-content: center; align-items: center; }}
|
| 1313 |
+
.dossier-shell {{ width: 1440px; display: flex; flex-direction: column; align-items: flex-start; }}
|
| 1314 |
+
.dossier-folder-tab {{
|
| 1315 |
+
margin-left: 36px; padding: 10px 28px 8px 28px; border-radius: 14px 14px 0 0;
|
| 1316 |
+
background: #ebd9bd; color: #7c2d12; font-size: 16px; font-weight: 900; letter-spacing: 0.06em;
|
| 1317 |
+
}}
|
| 1318 |
+
.dossier-card {{
|
| 1319 |
+
position: relative; width: 100%; min-height: 500px; padding: 42px 58px 48px 58px;
|
| 1320 |
+
border-radius: 18px; box-shadow: 0 32px 72px rgba(0,0,0,0.65);
|
| 1321 |
+
display: flex; flex-direction: column; justify-content: space-between;
|
| 1322 |
+
}}
|
| 1323 |
+
.dossier-card-kraft {{ background: #ebd9bd; color: #1c1917; }}
|
| 1324 |
+
.dossier-card-white {{ background: #f8fafc; color: #0f172a; border-top: 8px solid #0ea5e9; }}
|
| 1325 |
+
.dossier-head-row {{ display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }}
|
| 1326 |
+
.dossier-title {{ font-size: 40px; font-weight: 900; letter-spacing: -0.03em; color: #0f172a; }}
|
| 1327 |
+
.dossier-meta-right {{ font-size: 18px; font-weight: 700; font-family: monospace; color: #475569; }}
|
| 1328 |
+
.dossier-divider {{ width: 100%; height: 2px; background: rgba(15, 23, 42, 0.75); margin: 18px 0 12px 0; }}
|
| 1329 |
+
.dossier-rows {{ display: flex; flex-direction: column; gap: 6px; flex: 1; justify-content: center; }}
|
| 1330 |
+
.dossier-row {{
|
| 1331 |
+
display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 28px;
|
| 1332 |
+
padding: 20px 8px; border-bottom: 1.5px dotted rgba(15, 23, 42, 0.28);
|
| 1333 |
+
}}
|
| 1334 |
+
.dossier-key {{ font-size: 24px; font-weight: 800; color: #7c2d12; }}
|
| 1335 |
+
.dossier-card-white .dossier-key {{ color: #0369a1; }}
|
| 1336 |
+
.dossier-val {{ font-size: 31px; font-weight: 900; color: #0f172a; letter-spacing: -0.02em; }}
|
| 1337 |
+
.rubber-stamp {{
|
| 1338 |
+
position: absolute; right: 56px; bottom: 38px; padding: 12px 28px;
|
| 1339 |
+
border-radius: 10px; font-size: 36px; font-weight: 900; letter-spacing: 0.04em;
|
| 1340 |
+
transform: rotate(-8deg); pointer-events: none;
|
| 1341 |
+
}}
|
| 1342 |
+
.stamp-red {{ border: 4px solid #dc2626; color: #dc2626; background: rgba(254, 226, 226, 0.35); }}
|
| 1343 |
+
.stamp-blue {{ border: 4px solid #0284c7; color: #0284c7; background: rgba(224, 242, 254, 0.45); }}
|
| 1344 |
+
|
| 1345 |
+
/* NEW 2C: Fullscreen Cinema B-Roll */
|
| 1346 |
+
.scene-broll-full {{ position: absolute; inset: 0; width: 1920px; height: 1080px; overflow: hidden; justify-content: center; align-items: center; }}
|
| 1347 |
+
.broll-full-img {{ position: absolute; inset: 0; width: 1920px; height: 1080px; object-fit: cover; display: block; }}
|
| 1348 |
+
.broll-video-overlay {{ position: absolute; inset: 0; width: 1920px; height: 1080px; object-fit: cover; z-index: 4; pointer-events: none; }}
|
| 1349 |
+
.broll-vignette {{
|
| 1350 |
+
position: absolute; inset: 0; pointer-events: none;
|
| 1351 |
+
background: radial-gradient(ellipse 80% 75% at 50% 45%, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.52) 100%),
|
| 1352 |
+
linear-gradient(180deg, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0) 24%, rgba(0,0,0,0) 68%, rgba(0,0,0,0.78) 100%);
|
| 1353 |
+
}}
|
| 1354 |
+
.broll-atmos-title-wrap {{ position: relative; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 1400px; text-align: center; padding: 0 64px; }}
|
| 1355 |
+
.broll-kicker {{ font-size: 20px; font-weight: 800; letter-spacing: 0.2em; color: #38bdf8; }}
|
| 1356 |
+
.broll-atmos-title {{ font-size: 64px; font-weight: 900; color: #ffffff; text-shadow: 0 4px 28px rgba(0,0,0,0.85); line-height: 1.25; }}
|
| 1357 |
+
|
| 1358 |
/* NEW 3: Vertical Changelog */
|
| 1359 |
.scene-changelog {{ align-items: flex-start; justify-content: center; max-width: 1580px; }}
|
| 1360 |
.clog-header {{ font-size: 52px; font-weight: 900; color: var(--text-primary); letter-spacing: -0.03em; align-self: flex-start; }}
|
|
|
|
| 1570 |
.caption-box {{ padding: 14px 32px; border-radius: 18px; background: var(--cap-bg); border: 1px solid rgba(148, 163, 184, 0.2); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 1560px; }}
|
| 1571 |
.caption-box.style-briefing {{ width: 1540px; border-radius: 12px; background: rgba(3, 6, 14, 0.90); border: 1px solid rgba(56, 189, 248, 0.14); padding: 15px 36px; }}
|
| 1572 |
.briefing-ko {{ font-size: 36px; font-weight: 700; }}
|
| 1573 |
+
.caption-box.style-cinema {{ background: {cinema_bg}; border: none; border-radius: 8px; padding: 10px 28px; }}
|
| 1574 |
.caption-box.style-neon-bar {{ align-items: flex-start; text-align: left; border-radius: 6px 18px 18px 6px; border-left: 6px solid var(--accent); padding: 14px 34px; }}
|
| 1575 |
.neon-bar-kicker {{ font-size: 14px; font-weight: 800; letter-spacing: 0.08em; color: #7dd3fc; }}
|
| 1576 |
.cap-ko {{ font-size: 39px; font-weight: 800; color: #ffffff; letter-spacing: -0.02em; line-height: 1.25; text-shadow: 0 2px 14px rgba(0,0,0,0.88); }}
|
|
|
|
| 1640 |
for (let ci = 0; ci < CHOREO.chaptersCount; ci++) {{
|
| 1641 |
gsap.set("#chap-fill-" + ci, {{ scaleX: 0 }});
|
| 1642 |
}}
|
| 1643 |
+
if (document.getElementById("docu-prog-fill")) {{
|
| 1644 |
+
tl.fromTo("#docu-prog-fill", {{ scaleX: 0.02 }}, {{ scaleX: 1.0, duration: CHOREO.totalDuration, ease: "none" }}, 0);
|
| 1645 |
+
}}
|
| 1646 |
|
| 1647 |
// Deterministic Text Scramble Decode Animations
|
| 1648 |
CHOREO.scrambles.forEach(function (sc) {{
|
|
|
|
| 1704 |
}} else if (s.archetype === "media_showcase_split") {{
|
| 1705 |
tl.fromTo("#" + sid + "-hero-kw", {{ opacity: 0, x: -30 }}, {{ opacity: 1, x: 0, duration: 0.45, ease: "power3.out" }}, st + 0.10);
|
| 1706 |
tl.fromTo("#" + sid + "-media-frame", {{ opacity: 0, x: 36, scale: 0.96 }}, {{ opacity: 1, x: 0, scale: 1.0, duration: 0.52, ease: "power3.out" }}, st + 0.14);
|
| 1707 |
+
}} else if (s.archetype === "dossier_stamp_card") {{
|
| 1708 |
+
tl.fromTo("#" + sid + "-dos-shell", {{ opacity: 0, y: 30, scale: 0.95 }}, {{ opacity: 1, y: 0, scale: 1.0, duration: 0.48, ease: "power3.out" }}, st + 0.08);
|
| 1709 |
+
const dRows = Math.min(4, Math.max(1, s.bulletsCount));
|
| 1710 |
+
for (let k = 0; k < dRows; k++) {{
|
| 1711 |
+
tl.fromTo("#" + sid + "-dos-row-" + k, {{ opacity: 0, x: -24 }}, {{ opacity: 1, x: 0, duration: 0.34, ease: "power2.out" }}, st + 0.22 + k * 0.16);
|
| 1712 |
+
}}
|
| 1713 |
+
const stampTime = st + 0.65;
|
| 1714 |
+
tl.fromTo("#" + sid + "-dos-stamp", {{ opacity: 0, scale: 2.2, rotation: -18 }}, {{ opacity: 1, scale: 1.0, rotation: -8, duration: 0.34, ease: "back.out(2.0)" }}, stampTime);
|
| 1715 |
+
}} else if (s.archetype === "cinema_broll_fullscreen") {{
|
| 1716 |
+
if (document.getElementById(sid + "-broll-img")) {{
|
| 1717 |
+
tl.fromTo("#" + sid + "-broll-img", {{ scale: 1.0 }}, {{ scale: 1.08, duration: dur, ease: "none" }}, st);
|
| 1718 |
+
}}
|
| 1719 |
+
if (document.getElementById(sid + "-broll-title")) {{
|
| 1720 |
+
tl.fromTo("#" + sid + "-broll-title", {{ opacity: 0, y: 20 }}, {{ opacity: 1, y: 0, duration: 0.55, ease: "power3.out" }}, st + 0.14);
|
| 1721 |
+
}}
|
| 1722 |
}} else if (s.archetype === "changelog_vertical") {{
|
| 1723 |
tl.fromTo("#" + sid + "-clog-spine", {{ scaleY: 0 }}, {{ scaleY: 1, duration: Math.min(1.4, dur * 0.6), ease: "power2.out" }}, st + 0.12);
|
| 1724 |
const rCount = Math.min(6, Math.max(1, s.bulletsCount));
|
|
|
|
| 1824 |
}});
|
| 1825 |
}}
|
| 1826 |
|
| 1827 |
+
window.__IS_STANDALONE_BROWSER = !window.__timelines && !window.__offlineCapture;
|
| 1828 |
+
window.__timelines = window.__timelines || {{}};
|
| 1829 |
+
window.__CHOREO_SPEC = CHOREO;
|
| 1830 |
window.__timelines["main"] = tl;
|
| 1831 |
tl.seek(0);
|
| 1832 |
</script>
|
| 1833 |
+
<script src="assets/js/standalone_player.js"></script>
|
| 1834 |
</body>
|
| 1835 |
</html>
|
| 1836 |
"""
|
ingest_parser.py
CHANGED
|
@@ -94,6 +94,8 @@ def check_openxml_drm(file_path: Path) -> None:
|
|
| 94 |
ARCHETYPES = [
|
| 95 |
"hero_3d_briefing",
|
| 96 |
"media_showcase_split",
|
|
|
|
|
|
|
| 97 |
"changelog_vertical",
|
| 98 |
"mission_staircase",
|
| 99 |
"swarm_network",
|
|
@@ -125,10 +127,23 @@ def _clean_chapter_label(raw_ch: str) -> str:
|
|
| 125 |
return (cleaned or raw_ch.strip())[:16]
|
| 126 |
|
| 127 |
|
| 128 |
-
def _infer_archetype(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
combined = f"{title} {' '.join(bullets)} {notes}".lower()
|
|
|
|
|
|
|
| 130 |
if has_media:
|
| 131 |
return "media_showcase_split"
|
|
|
|
|
|
|
| 132 |
if any(k in combined for k in ["์๊ธ", "ํ๋", "๊ฐ๊ฒฉํ", "ํ ๋น๋", "๋ฌด๋ฃ", "์ ๋ฃ", "pricing"]) and any("|" in b for b in bullets):
|
| 133 |
return "pricing_matrix"
|
| 134 |
date_bullets = sum(1 for b in bullets if re.match(r"^(?:\d{1,2}\.\d{1,2}|20\d{2}|v\d+\.\d+)", b.strip(), re.I))
|
|
@@ -220,9 +235,18 @@ def _compile_raw_slides_to_spec(deck_title: str, raw_slides: list[dict[str, Any]
|
|
| 220 |
|
| 221 |
bullets = item.get("bullets") or [item["title"]]
|
| 222 |
notes_lines = item.get("notes_lines", [])
|
| 223 |
-
|
|
|
|
|
|
|
| 224 |
archetype = meta.get("ARCHETYPE") or _infer_archetype(
|
| 225 |
-
s_idx,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
)
|
| 227 |
beats = _parse_notes_into_beats(item["title"], bullets, notes_lines)
|
| 228 |
|
|
@@ -248,6 +272,7 @@ def _compile_raw_slides_to_spec(deck_title: str, raw_slides: list[dict[str, Any]
|
|
| 248 |
"hero_word": meta.get("HERO_WORD", ""),
|
| 249 |
"scramble_text": meta.get("SCRAMBLE", ""),
|
| 250 |
"source_note": meta.get("SOURCE", ""),
|
|
|
|
| 251 |
"media_src": media_src,
|
| 252 |
"media_caption": meta.get("MEDIA_CAPTION", ""),
|
| 253 |
"plans": meta.get("PLANS", "๋ฌด๋ฃ โฉ0 | Pro ์ โฉ29,000 | Ultra ์ โฉ119,000~"),
|
|
@@ -787,6 +812,9 @@ def parse_agent_json_to_spec(payload: Any, default_title: str = "Presentation")
|
|
| 787 |
"media_caption": "MEDIA_CAPTION",
|
| 788 |
"plans": "PLANS",
|
| 789 |
"command": "COMMAND",
|
|
|
|
|
|
|
|
|
|
| 790 |
}
|
| 791 |
for src_k, dst_k in key_map.items():
|
| 792 |
val = s.get(src_k)
|
|
|
|
| 94 |
ARCHETYPES = [
|
| 95 |
"hero_3d_briefing",
|
| 96 |
"media_showcase_split",
|
| 97 |
+
"cinema_broll_fullscreen",
|
| 98 |
+
"dossier_stamp_card",
|
| 99 |
"changelog_vertical",
|
| 100 |
"mission_staircase",
|
| 101 |
"swarm_network",
|
|
|
|
| 127 |
return (cleaned or raw_ch.strip())[:16]
|
| 128 |
|
| 129 |
|
| 130 |
+
def _infer_archetype(
|
| 131 |
+
idx: int,
|
| 132 |
+
total: int,
|
| 133 |
+
title: str,
|
| 134 |
+
bullets: list[str],
|
| 135 |
+
notes: str,
|
| 136 |
+
has_media: bool = False,
|
| 137 |
+
has_stamp: bool = False,
|
| 138 |
+
has_broll: bool = False,
|
| 139 |
+
) -> str:
|
| 140 |
combined = f"{title} {' '.join(bullets)} {notes}".lower()
|
| 141 |
+
if has_broll:
|
| 142 |
+
return "cinema_broll_fullscreen"
|
| 143 |
if has_media:
|
| 144 |
return "media_showcase_split"
|
| 145 |
+
if has_stamp or any(k in combined for k in ["ํนํ", "๊ณต์ ํด๋ช
", "๊ณต์ ์
์ฅ", "ํ๊ฒฐ", "๊ณต๋ฌธ", "์ฑ๋ช
์", "patent", "official statement"]):
|
| 146 |
+
return "dossier_stamp_card"
|
| 147 |
if any(k in combined for k in ["์๊ธ", "ํ๋", "๊ฐ๊ฒฉํ", "ํ ๋น๋", "๋ฌด๋ฃ", "์ ๋ฃ", "pricing"]) and any("|" in b for b in bullets):
|
| 148 |
return "pricing_matrix"
|
| 149 |
date_bullets = sum(1 for b in bullets if re.match(r"^(?:\d{1,2}\.\d{1,2}|20\d{2}|v\d+\.\d+)", b.strip(), re.I))
|
|
|
|
| 235 |
|
| 236 |
bullets = item.get("bullets") or [item["title"]]
|
| 237 |
notes_lines = item.get("notes_lines", [])
|
| 238 |
+
broll_src = meta.get("BROLL") or ""
|
| 239 |
+
media_src = broll_src or meta.get("MEDIA") or item.get("media_src", "")
|
| 240 |
+
stamp_text = meta.get("STAMP") or ""
|
| 241 |
archetype = meta.get("ARCHETYPE") or _infer_archetype(
|
| 242 |
+
s_idx,
|
| 243 |
+
len(raw_slides),
|
| 244 |
+
item["title"],
|
| 245 |
+
bullets,
|
| 246 |
+
" ".join(notes_lines),
|
| 247 |
+
has_media=bool(media_src) and not bool(broll_src),
|
| 248 |
+
has_stamp=bool(stamp_text),
|
| 249 |
+
has_broll=bool(broll_src),
|
| 250 |
)
|
| 251 |
beats = _parse_notes_into_beats(item["title"], bullets, notes_lines)
|
| 252 |
|
|
|
|
| 272 |
"hero_word": meta.get("HERO_WORD", ""),
|
| 273 |
"scramble_text": meta.get("SCRAMBLE", ""),
|
| 274 |
"source_note": meta.get("SOURCE", ""),
|
| 275 |
+
"stamp_text": stamp_text,
|
| 276 |
"media_src": media_src,
|
| 277 |
"media_caption": meta.get("MEDIA_CAPTION", ""),
|
| 278 |
"plans": meta.get("PLANS", "๋ฌด๋ฃ โฉ0 | Pro ์ โฉ29,000 | Ultra ์ โฉ119,000~"),
|
|
|
|
| 812 |
"media_caption": "MEDIA_CAPTION",
|
| 813 |
"plans": "PLANS",
|
| 814 |
"command": "COMMAND",
|
| 815 |
+
"stamp": "STAMP",
|
| 816 |
+
"stamp_text": "STAMP",
|
| 817 |
+
"broll": "BROLL",
|
| 818 |
}
|
| 819 |
for src_k, dst_k in key_map.items():
|
| 820 |
val = s.get(src_k)
|
offline_renderer.py
CHANGED
|
@@ -275,10 +275,12 @@ def render_offline_via_local_browser(
|
|
| 275 |
"--mute-audio",
|
| 276 |
"--no-first-run",
|
| 277 |
"--no-default-browser-check",
|
|
|
|
|
|
|
| 278 |
"--window-size=1920,1080",
|
| 279 |
f"--user-data-dir={tmp_profile / 'profile'}",
|
| 280 |
f"--remote-debugging-port={cdp_port}",
|
| 281 |
-
|
| 282 |
])
|
| 283 |
|
| 284 |
browser_proc = subprocess.Popen(
|
|
@@ -287,12 +289,13 @@ def render_offline_via_local_browser(
|
|
| 287 |
stderr=subprocess.PIPE,
|
| 288 |
)
|
| 289 |
|
|
|
|
| 290 |
cdp: _MiniCDPClient | None = None
|
| 291 |
try:
|
| 292 |
ws_url = ""
|
| 293 |
-
for _ in range(
|
| 294 |
try:
|
| 295 |
-
with
|
| 296 |
targets = json.loads(resp.read().decode("utf-8"))
|
| 297 |
for tgt in targets:
|
| 298 |
if tgt.get("type") == "page" and "webSocketDebuggerUrl" in tgt:
|
|
@@ -312,29 +315,72 @@ def render_offline_via_local_browser(
|
|
| 312 |
"Emulation.setDeviceMetricsOverride",
|
| 313 |
{"width": 1920, "height": 1080, "deviceScaleFactor": 1, "mobile": False},
|
| 314 |
)
|
| 315 |
-
|
| 316 |
-
# Wait for fonts and timeline registration
|
| 317 |
cdp.call(
|
| 318 |
-
"
|
| 319 |
-
{
|
| 320 |
-
"expression": "document.fonts.ready.then(() => Boolean(window.__timelines && window.__timelines['main']))",
|
| 321 |
-
"awaitPromise": True,
|
| 322 |
-
},
|
| 323 |
)
|
|
|
|
| 324 |
|
| 325 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
init_js = """
|
| 327 |
-
window.__offlineSeek = function(t) {
|
| 328 |
var clips = document.querySelectorAll('.clip[data-start]');
|
|
|
|
| 329 |
for (var i = 0; i < clips.length; i++) {
|
| 330 |
var el = clips[i];
|
| 331 |
var st = parseFloat(el.getAttribute('data-start') || '0');
|
| 332 |
var dur = parseFloat(el.getAttribute('data-duration') || '999999');
|
| 333 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 334 |
}
|
| 335 |
if (window.__timelines && window.__timelines['main']) {
|
| 336 |
window.__timelines['main'].seek(t, false);
|
| 337 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
};
|
| 339 |
"""
|
| 340 |
cdp.call("Runtime.evaluate", {"expression": init_js})
|
|
@@ -363,7 +409,7 @@ def render_offline_via_local_browser(
|
|
| 363 |
|
| 364 |
for frame_idx in range(total_frames):
|
| 365 |
t_sec = frame_idx / float(fps)
|
| 366 |
-
cdp.call("Runtime.evaluate", {"expression": f"window.__offlineSeek({t_sec:.5f})
|
| 367 |
shot = cdp.call("Page.captureScreenshot", {"format": "jpeg", "quality": 94})
|
| 368 |
ff_proc.stdin.write(base64.b64decode(shot["data"]))
|
| 369 |
if frame_idx % 60 == 0 or frame_idx == total_frames - 1:
|
|
|
|
| 275 |
"--mute-audio",
|
| 276 |
"--no-first-run",
|
| 277 |
"--no-default-browser-check",
|
| 278 |
+
"--no-proxy-server",
|
| 279 |
+
"--autoplay-policy=no-user-gesture-required",
|
| 280 |
"--window-size=1920,1080",
|
| 281 |
f"--user-data-dir={tmp_profile / 'profile'}",
|
| 282 |
f"--remote-debugging-port={cdp_port}",
|
| 283 |
+
"about:blank",
|
| 284 |
])
|
| 285 |
|
| 286 |
browser_proc = subprocess.Popen(
|
|
|
|
| 289 |
stderr=subprocess.PIPE,
|
| 290 |
)
|
| 291 |
|
| 292 |
+
no_proxy_opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
|
| 293 |
cdp: _MiniCDPClient | None = None
|
| 294 |
try:
|
| 295 |
ws_url = ""
|
| 296 |
+
for _ in range(60):
|
| 297 |
try:
|
| 298 |
+
with no_proxy_opener.open(f"http://127.0.0.1:{cdp_port}/json", timeout=1) as resp:
|
| 299 |
targets = json.loads(resp.read().decode("utf-8"))
|
| 300 |
for tgt in targets:
|
| 301 |
if tgt.get("type") == "page" and "webSocketDebuggerUrl" in tgt:
|
|
|
|
| 315 |
"Emulation.setDeviceMetricsOverride",
|
| 316 |
{"width": 1920, "height": 1080, "deviceScaleFactor": 1, "mobile": False},
|
| 317 |
)
|
|
|
|
|
|
|
| 318 |
cdp.call(
|
| 319 |
+
"Page.addScriptToEvaluateOnNewDocument",
|
| 320 |
+
{"source": "window.__timelines = window.__timelines || {}; window.__offlineCapture = true;"},
|
|
|
|
|
|
|
|
|
|
| 321 |
)
|
| 322 |
+
cdp.call("Page.navigate", {"url": f"http://127.0.0.1:{http_port}/index.html"})
|
| 323 |
|
| 324 |
+
# Poll until fonts and main GSAP timeline are both initialized
|
| 325 |
+
tl_ready = False
|
| 326 |
+
for _ in range(50):
|
| 327 |
+
ev = cdp.call(
|
| 328 |
+
"Runtime.evaluate",
|
| 329 |
+
{
|
| 330 |
+
"expression": (
|
| 331 |
+
"Boolean(document.readyState === 'complete' && window.__timelines && window.__timelines['main'])"
|
| 332 |
+
),
|
| 333 |
+
"returnByValue": True,
|
| 334 |
+
},
|
| 335 |
+
)
|
| 336 |
+
if ev.get("result", {}).get("value") is True:
|
| 337 |
+
tl_ready = True
|
| 338 |
+
break
|
| 339 |
+
time.sleep(0.1)
|
| 340 |
+
|
| 341 |
+
if not tl_ready:
|
| 342 |
+
err_probe = cdp.call(
|
| 343 |
+
"Runtime.evaluate",
|
| 344 |
+
{"expression": "String(window.__lastScriptError || 'timeline not registered')", "returnByValue": True},
|
| 345 |
+
)
|
| 346 |
+
raise RuntimeError(f"GSAP main timeline failed to initialize in offline browser: {err_probe}")
|
| 347 |
+
|
| 348 |
+
cdp.call("Runtime.evaluate", {"expression": "document.fonts.ready", "awaitPromise": True})
|
| 349 |
+
|
| 350 |
+
# Inject async clip visibility + <video> seek + GSAP seek helper
|
| 351 |
init_js = """
|
| 352 |
+
window.__offlineSeek = async function(t) {
|
| 353 |
var clips = document.querySelectorAll('.clip[data-start]');
|
| 354 |
+
var seekPromises = [];
|
| 355 |
for (var i = 0; i < clips.length; i++) {
|
| 356 |
var el = clips[i];
|
| 357 |
var st = parseFloat(el.getAttribute('data-start') || '0');
|
| 358 |
var dur = parseFloat(el.getAttribute('data-duration') || '999999');
|
| 359 |
+
var active = (t >= st && t < st + dur);
|
| 360 |
+
el.style.visibility = active ? 'visible' : 'hidden';
|
| 361 |
+
if (active && el.tagName === 'VIDEO') {
|
| 362 |
+
var localT = Math.max(0, t - st);
|
| 363 |
+
if (el.duration && isFinite(el.duration) && el.duration > 0) {
|
| 364 |
+
localT = localT % el.duration;
|
| 365 |
+
}
|
| 366 |
+
if (Math.abs((el.currentTime || 0) - localT) > 0.02) {
|
| 367 |
+
seekPromises.push(new Promise(function(resolve) {
|
| 368 |
+
var done = false;
|
| 369 |
+
var finish = function() { if (!done) { done = true; resolve(); } };
|
| 370 |
+
el.addEventListener('seeked', finish, { once: true });
|
| 371 |
+
setTimeout(finish, 120);
|
| 372 |
+
try { el.currentTime = localT; } catch (e) { finish(); }
|
| 373 |
+
}));
|
| 374 |
+
}
|
| 375 |
+
}
|
| 376 |
}
|
| 377 |
if (window.__timelines && window.__timelines['main']) {
|
| 378 |
window.__timelines['main'].seek(t, false);
|
| 379 |
}
|
| 380 |
+
if (seekPromises.length) {
|
| 381 |
+
await Promise.all(seekPromises);
|
| 382 |
+
}
|
| 383 |
+
return true;
|
| 384 |
};
|
| 385 |
"""
|
| 386 |
cdp.call("Runtime.evaluate", {"expression": init_js})
|
|
|
|
| 409 |
|
| 410 |
for frame_idx in range(total_frames):
|
| 411 |
t_sec = frame_idx / float(fps)
|
| 412 |
+
cdp.call("Runtime.evaluate", {"expression": f"window.__offlineSeek({t_sec:.5f})", "awaitPromise": True})
|
| 413 |
shot = cdp.call("Page.captureScreenshot", {"format": "jpeg", "quality": 94})
|
| 414 |
ff_proc.stdin.write(base64.b64decode(shot["data"]))
|
| 415 |
if frame_idx % 60 == 0 or frame_idx == total_frames - 1:
|
pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
| 4 |
|
| 5 |
[project]
|
| 6 |
name = "deck-video-pipeline"
|
| 7 |
-
version = "3.
|
| 8 |
description = "Universal PPTX / DOCX / Markdown / HTML / Enterprise-DRM-Bridge to Code-Rendered Motion + SFX MP4 Pipeline"
|
| 9 |
readme = "README.md"
|
| 10 |
requires-python = ">=3.10"
|
|
|
|
| 4 |
|
| 5 |
[project]
|
| 6 |
name = "deck-video-pipeline"
|
| 7 |
+
version = "3.2.0"
|
| 8 |
description = "Universal PPTX / DOCX / Markdown / HTML / Enterprise-DRM-Bridge to Code-Rendered Motion + SFX MP4 Pipeline"
|
| 9 |
readme = "README.md"
|
| 10 |
requires-python = ">=3.10"
|
samples/sample_docu_patent.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ์ฌํ ๋์งํธ ๊ณ์ AI ํนํ์ ๋ช
์
|
| 2 |
+
|
| 3 |
+
## 01 ๋จ๊ฒจ์ง ํํ ์์ ์ค๋งํธํฐ๊ณผ ๊ทธ๋ฆฌ์ด ๋ชฉ์๋ฆฌ
|
| 4 |
+
[ARCHETYPE: cinema_broll_fullscreen]
|
| 5 |
+
[BADGE: DIGITAL AFTERLIFE DOCUMENTARY]
|
| 6 |
+
> ๊ณ ์ธ์ ์์ ๊ธฐ๋ก์ ํ์ตํด ์ฌํ์๋ ๋ํ๋ฅผ ์ด์ด๊ฐ๋ ์ธ๊ณต์ง๋ฅ ๊ธฐ์ ์ด ํ์ค๋ก ๋ค๊ฐ์์ต๋๋ค.
|
| 7 |
+
|
| 8 |
+
## ๋ฏธ๊ตญ ํนํ ๋ฑ๋ก์ผ๋ก ๋๋ฌ๋ ์ฌํ ๊ณ์ ์ ์ง ๊ธฐ์
|
| 9 |
+
[ARCHETYPE: dossier_stamp_card]
|
| 10 |
+
[BADGE: USPTO REGISTERED PATENT]
|
| 11 |
+
[SOURCE: US Patent 12,513,102 B2 ยท 2025.12]
|
| 12 |
+
[STAMP: PATENT 2025]
|
| 13 |
+
- 01 ๋์ ๋ฐ์ดํฐ | ์์ ์ ๋จ๊ธด ๊ฒ์๋ฌผยท๋๊ธยท๋ฉ์์ง ๊ธฐ๋ก ์ ์ ํ์ต
|
| 14 |
+
- 02 ์์ฑ ์ฌํ | ํตํ ๋ฐ ์์ฑ ๋ฉ์์ง๋ฅผ ๋ถ์ํด ๋์ผํ ์ต์ ๋ณต์
|
| 15 |
+
- 03 ์๋ ์๋ต | ์ฌ๋ง ์ดํ์๋ ๊ณ ์ธ์ฒ๋ผ ๋ฐ์ํ๋ฉฐ ๊ณ์ ํ๋ ์ง์
|
| 16 |
+
> ๋ฑ๋ก๋ ํนํ ๋ฌธ์์๋ ์์ ์ ๋ํ์ ๋ชฉ์๋ฆฌ๋ฅผ ํ์ตํด ๊ณ ์ธ์ฒ๋ผ ๋ฐ์ํ๋ ๊ตฌ์ฒด์ ์ธ ์ค๊ณ๊ฐ ๋ด๊ฒจ ์์ต๋๋ค. ๋น๋ ์ฌ๋ก ์ด ์ผ์ ๊ธฐ์
์ธก์ ๊ณง๋ฐ๋ก ํด๋ช
์ ๋์ฐ์ต๋๋ค.
|
| 17 |
+
|
| 18 |
+
## ํนํ ํ์ฅ์ ๋ํ ๊ธฐ์
์ธก ๊ณต์ ํด๋ช
๊ณผ ์์ฅ ํ์ค
|
| 19 |
+
[ARCHETYPE: dossier_stamp_card]
|
| 20 |
+
[BADGE: OFFICIAL STATEMENT ยท ๊ธฐ์
์ธก ๊ณต์ ์
์ฅ]
|
| 21 |
+
[STAMP: ๊ฐ๋ฐ ๊ณํ ์์]
|
| 22 |
+
- ์ฌ๋ก ๋ฐ์ | ์ ์กฑ์ ๊ทธ๋ฆฌ์์ ์์
์ ์ผ๋ก ์ด์ฉํ๋ค๋ ์ฐ๋ ค ํ์ฐ
|
| 23 |
+
- ํ์ฌ ๋ฐํ | ํนํ๋ง ๋ฑ๋กํ์ ๋ฟ ์ค์ ์ถ์ ๊ณํ์ ์๋ค๊ณ ์ ๊ทธ์
|
| 24 |
+
- ์์ฅ ํ์ค | ์ด๋ฏธ ํด์ธ์์๋ ์ ๋ฃ ์ถ๋ชจ AI ๊ตฌ๋
์๋น์ค๊ฐ ์ฑ์
์ค
|
| 25 |
+
> ํ์ฌ ์ธก์ ์์ฉํ ๊ณํ์ด ์๋ค๊ณ ๋ฐํ์ง๋ง ์ด๋ฏธ ๋ฐ๊นฅ ์์ฅ์์๋ ์ ๋ฃ ์ถ๋ชจ ์๋น์ค๊ฐ ๋น ๋ฅด๊ฒ ๋ฒ์ง๊ณ ์์ต๋๋ค. ๋ง์ฝ ๋งค๋ฌ ๊ตฌ๋
๋ฃ๋ฅผ ๋ด์ผ๋ง ๊ฐ์กฑ์ ๋ชฉ์๋ฆฌ๋ฅผ ๋ค์ ์ ์๋ค๋ฉด ์ด๋จ๊น์?
|
| 26 |
+
|
| 27 |
+
## ์๋ฒ ๊ตฌ๋
์์์ฆ vs ๊ฐ์ด ์ ์ง์ง ๊ธฐ์ต
|
| 28 |
+
[ARCHETYPE: vs_comparison]
|
| 29 |
+
- ๋งค๋ฌ ์๋ ๊ฒฐ์ ์ฒญ๊ตฌ | ์๋ฒ ์ ๋์งํธ ๊ทธ๋ฆผ์ ์ ์ง
|
| 30 |
+
- ๊ตฌ๋
ํด์ง ์ ์ฃ์ฑ
๊ฐ | ์ ์กฑ์ ๊ฐ์ ์ด ์๊ธ์ ์ ์ข
์๋๋ ๊ตฌ์กฐ
|
| 31 |
+
- ๋์งํธ ์๋ณ ์ ์ฐจ ํ์ | ์์ ๋์์ ์กด์ํ ๋ง๋ฌด๋ฆฌ๊ฐ ์ฐ์
|
| 32 |
+
> ์ฌ๋ํ๋ ์ฌ๋์ ๊ธฐ์ตํ๋ ์ผ๋ง์ ๋งค๋ฌ ๊ฒฐ์ ํ๋ ๊ตฌ๋
์๋น์ค์ ๋งก๊ฒจ๋ ๊ด์ฐฎ์์ง ๊น์ด ๊ณ ๋ฏผํด์ผ ํ ์์ ์
๋๋ค.
|
themes_and_presets.py
CHANGED
|
@@ -174,6 +174,7 @@ BACKGROUND_PRESETS: dict[str, dict[str, Any]] = {
|
|
| 174 |
HUD_STYLES: dict[str, str] = {
|
| 175 |
"chapter_tabs": "์๋จ ๋ค์ค ์ฑํฐ ์งํ ๊ฒ์ด์ง ํญ ๋ฐ (์ซ๋ํ์ ๋ธ๊น์ผ๊ธฐ ์คํ์ผ ยท ๊ธฐ๋ณธ)",
|
| 176 |
"tech_briefing": "์ข์๋จ ํฐ๋ฏธ๋ ๋ธ๋ฆฌํ ํค๋ + 4์ฝ๋ ๋ทฐํ์ธ๋ ๋ธ๋ํท + ํ๋จ ์ถ์ฒ ๊ฐ์ฃผ (ITํกํก ์คํ์ผ)",
|
|
|
|
| 177 |
"minimal": "์๋จ HUD ์์ด ๊น๋ํ ํ์คํฌ๋ฆฐ ์คํ
์ด์ง",
|
| 178 |
}
|
| 179 |
|
|
@@ -182,7 +183,7 @@ CAPTION_STYLES: dict[str, str] = {
|
|
| 182 |
"glass_dual": "๋ฐํฌ๋ช
๊ธ๋์ค ๋ฐ์ค + ํยท์ ์ด์ค ์๋ง (๊ธฐ๋ณธ ๋ ํผ๋ฐ์ค ์คํ์ผ)",
|
| 183 |
"briefing_clean": "ํ๋จ ๋คํฌ ์์ด๋ ๋ฐ + ์ ๋ช
ํ ๋จ์ผ/์ด์ค ์๋ง (ITํกํก ํ
ํฌ ๋ธ๋ฆฌํ ์คํ์ผ)",
|
| 184 |
"pill_karaoke": "์ค์๊ฐ ๋จ์ด๋ณ ๋ค์จ ์์ฝ(Pill) ํ์ด๋ผ์ดํธ ๋
ธ๋๋ฐฉ ์๋ง (2026 ํธ๋ ๋)",
|
| 185 |
-
"cinema_minimal": "
|
| 186 |
"neon_bar_left": "์ข์ธก ๋ค์จ ํฌ์ธํธ ๋ฐ + ๋ฐฉ์ก ๋ด์คยทํ
ํฌ ๋ธ๋ฆฌํ ๋ก์์๋ ์๋ง",
|
| 187 |
"kinetic_pop": "์คํ๋ง ํ์
+ ์ซ์ยทํต์ฌ์ด ์๋ ์ปฌ๋ฌ ๊ฐ์กฐ ๋ค์ด๋๋ฏน ์๋ง",
|
| 188 |
}
|
|
@@ -191,6 +192,8 @@ CAPTION_STYLES: dict[str, str] = {
|
|
| 191 |
SCENE_ARCHETYPES: dict[str, str] = {
|
| 192 |
"hero_3d_briefing": "3D ์์ด์ดํ๋ ์ ์คํ๋ ํ์ดํ + ์ปฌ๋ฌ ํ ํฝ ์์ฝ ํ๊ทธ (ITํกํก ์คํ๋ ์คํ์ผ)",
|
| 193 |
"media_showcase_split": "์ข์ธก ๋ํ ํค์๋ & ํ
์คํธ ์คํฌ๋จ๋ธ + ์ฐ์ธก ์ค์ ์์/์ด๋ฏธ์ง ๋ค์จ ํ๋ ์ (ITํกํก ์์ฐ ์คํ์ผ)",
|
|
|
|
|
|
|
| 194 |
"changelog_vertical": "๋ ์งยท๋ฒ์ ๋ณ ์ปฌ๋ฌ ํ์๋ผ์ธ ์คํ์ธ + ์์ฐจ ๋ณ๊ฒฝ ๋ก๊ทธ (ITํกํก ์
๋ฐ์ดํธ ์ ๋ฆฌ ์คํ์ผ)",
|
| 195 |
"mission_staircase": "5์ ๋ฏธ์
๋ฆฌ์คํธ + ์ฐ์ธก 3D ์์ด์๋ฉํธ๋ฆญ ์์น ๊ณ๋จ ๋ธ๋ก (ITํกํก ๋ฏธ์
5๋จ๊ณ ์คํ์ผ)",
|
| 196 |
"swarm_network": "์ค์ ์ฝ๋๋ค์ดํฐ ํ๋ธ & ๋ฉํฐ ์์ด์ ํธ ์์ปค ์คํฌํฌ ๋คํธ์ํฌ ๊ทธ๋ํ (/swarm ์คํ์ผ)",
|
|
|
|
| 174 |
HUD_STYLES: dict[str, str] = {
|
| 175 |
"chapter_tabs": "์๋จ ๋ค์ค ์ฑํฐ ์งํ ๊ฒ์ด์ง ํญ ๋ฐ (์ซ๋ํ์ ๋ธ๊น์ผ๊ธฐ ์คํ์ผ ยท ๊ธฐ๋ณธ)",
|
| 176 |
"tech_briefing": "์ข์๋จ ํฐ๋ฏธ๋ ๋ธ๋ฆฌํ ํค๋ + 4์ฝ๋ ๋ทฐํ์ธ๋ ๋ธ๋ํท + ํ๋จ ์ถ์ฒ ๊ฐ์ฃผ (ITํกํก ์คํ์ผ)",
|
| 177 |
+
"docu_watermark": "์๋จ ์ฌ๋ฆผ ์งํ ๋ฐ + ์ฐ์ธก ์๋จ 2์ค ์ฑ๋ ์ํฐ๋งํฌ (์ค๋ช
์ข์ํ๋์์ ์จ ๋คํ๋ฉํฐ๋ฆฌ ์คํ์ผ)",
|
| 178 |
"minimal": "์๋จ HUD ์์ด ๊น๋ํ ํ์คํฌ๋ฆฐ ์คํ
์ด์ง",
|
| 179 |
}
|
| 180 |
|
|
|
|
| 183 |
"glass_dual": "๋ฐํฌ๋ช
๊ธ๋์ค ๋ฐ์ค + ํยท์ ์ด์ค ์๋ง (๊ธฐ๋ณธ ๋ ํผ๋ฐ์ค ์คํ์ผ)",
|
| 184 |
"briefing_clean": "ํ๋จ ๋คํฌ ์์ด๋ ๋ฐ + ์ ๋ช
ํ ๋จ์ผ/์ด์ค ์๋ง (ITํกํก ํ
ํฌ ๋ธ๋ฆฌํ ์คํ์ผ)",
|
| 185 |
"pill_karaoke": "์ค์๊ฐ ๋จ์ด๋ณ ๋ค์จ ์์ฝ(Pill) ํ์ด๋ผ์ดํธ ๋
ธ๋๋ฐฉ ์๋ง (2026 ํธ๋ ๋)",
|
| 186 |
+
"cinema_minimal": "๋คํ๋ฉํฐ๋ฆฌยท์ํ ์คํ์ผ ๋ธ๋ ๋ฐํฌ๋ช
์๋ค๋ง ์๋ง (์ค๋ช
์ข์ํ๋์์ ์จ ์คํ์ผ)",
|
| 187 |
"neon_bar_left": "์ข์ธก ๋ค์จ ํฌ์ธํธ ๋ฐ + ๋ฐฉ์ก ๋ด์คยทํ
ํฌ ๋ธ๋ฆฌํ ๋ก์์๋ ์๋ง",
|
| 188 |
"kinetic_pop": "์คํ๋ง ํ์
+ ์ซ์ยทํต์ฌ์ด ์๋ ์ปฌ๋ฌ ๊ฐ์กฐ ๋ค์ด๋๋ฏน ์๋ง",
|
| 189 |
}
|
|
|
|
| 192 |
SCENE_ARCHETYPES: dict[str, str] = {
|
| 193 |
"hero_3d_briefing": "3D ์์ด์ดํ๋ ์ ์คํ๋ ํ์ดํ + ์ปฌ๋ฌ ํ ํฝ ์์ฝ ํ๊ทธ (ITํกํก ์คํ๋ ์คํ์ผ)",
|
| 194 |
"media_showcase_split": "์ข์ธก ๋ํ ํค์๋ & ํ
์คํธ ์คํฌ๋จ๋ธ + ์ฐ์ธก ์ค์ ์์/์ด๋ฏธ์ง ๋ค์จ ํ๋ ์ (ITํกํก ์์ฐ ์คํ์ผ)",
|
| 195 |
+
"cinema_broll_fullscreen": "ํ์คํฌ๋ฆฐ ์๋ค๋งํฑ ์์/์ฌ์ง B-Roll + ๋น๋คํ
& ์ผ๋ฒ์ฆ ์ค (์ค๋ช
์ข์ํ๋์์ ์จ ๊ต์ฐจํธ์ง ์คํ์ผ)",
|
| 196 |
+
"dossier_stamp_card": "ํฌ๋ํํธ ์๋ฅ์ฒ ยทํนํ ๋ฌธ์ ์นด๋ + ๊ณ ๋ฌด๋์ฅ ์คํฌํ ํ๊ฒฉ ๋ชจ์
(์ค๋ช
์ข์ํ๋์์ ์จ ๋ฌธ์ ์คํ์ผ)",
|
| 197 |
"changelog_vertical": "๋ ์งยท๋ฒ์ ๋ณ ์ปฌ๋ฌ ํ์๋ผ์ธ ์คํ์ธ + ์์ฐจ ๋ณ๊ฒฝ ๋ก๊ทธ (ITํกํก ์
๋ฐ์ดํธ ์ ๋ฆฌ ์คํ์ผ)",
|
| 198 |
"mission_staircase": "5์ ๋ฏธ์
๋ฆฌ์คํธ + ์ฐ์ธก 3D ์์ด์๋ฉํธ๋ฆญ ์์น ๊ณ๋จ ๋ธ๋ก (ITํกํก ๋ฏธ์
5๋จ๊ณ ์คํ์ผ)",
|
| 199 |
"swarm_network": "์ค์ ์ฝ๋๋ค์ดํฐ ํ๋ธ & ๋ฉํฐ ์์ด์ ํธ ์์ปค ์คํฌํฌ ๋คํธ์ํฌ ๊ทธ๋ํ (/swarm ์คํ์ผ)",
|
tts_timeline.py
CHANGED
|
@@ -5,6 +5,7 @@ Works identically on Windows, macOS, and Linux โ both ONLINE and OFFLINE.
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
from __future__ import annotations
|
|
|
|
| 8 |
import hashlib
|
| 9 |
import os
|
| 10 |
import platform
|
|
@@ -50,13 +51,35 @@ def probe_duration(media_path: Path) -> float:
|
|
| 50 |
return max(0.2, round(float(res.stdout.strip()), 3))
|
| 51 |
|
| 52 |
|
| 53 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
"""
|
| 55 |
Attempts OS-native 100% offline TTS synthesis:
|
| 56 |
- macOS: `/usr/bin/say -v Yuna` (Korean)
|
| 57 |
-
- Windows:
|
|
|
|
| 58 |
- Linux: `espeak-ng -v ko`
|
| 59 |
-
Returns True if speech
|
| 60 |
"""
|
| 61 |
system = platform.system().lower()
|
| 62 |
try:
|
|
@@ -68,42 +91,108 @@ def _synth_offline_os_tts(text: str, raw_audio_out: Path) -> bool:
|
|
| 68 |
)
|
| 69 |
if res.returncode != 0:
|
| 70 |
subprocess.run(["/usr/bin/say", "-o", str(aiff_tmp), text], check=True, capture_output=True)
|
| 71 |
-
if
|
| 72 |
aiff_tmp.replace(raw_audio_out)
|
| 73 |
return True
|
|
|
|
| 74 |
|
| 75 |
elif system == "windows":
|
| 76 |
-
wav_tmp = raw_audio_out.with_suffix(".wav")
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
)
|
| 86 |
-
|
| 87 |
-
if
|
| 88 |
wav_tmp.replace(raw_audio_out)
|
| 89 |
return True
|
|
|
|
| 90 |
|
| 91 |
else:
|
| 92 |
espeak = shutil.which("espeak-ng") or shutil.which("espeak")
|
| 93 |
if espeak:
|
| 94 |
wav_tmp = raw_audio_out.with_suffix(".wav")
|
| 95 |
subprocess.run([espeak, "-v", "ko", "-s", "165", "-w", str(wav_tmp), text], check=True, capture_output=True)
|
| 96 |
-
if
|
| 97 |
wav_tmp.replace(raw_audio_out)
|
| 98 |
return True
|
|
|
|
| 99 |
except Exception as exc:
|
| 100 |
print(f"[Offline TTS Warning] OS voice fallback error: {exc}")
|
| 101 |
return False
|
| 102 |
|
| 103 |
|
|
|
|
|
|
|
|
|
|
| 104 |
def _synth_silent_timed_wav(text: str, wav_out: Path) -> None:
|
| 105 |
-
"""Last-resort silent pacing track (approx 0.
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
sr = 48000
|
| 108 |
pcm = np.zeros((int(sr * dur), 2), dtype=np.int16)
|
| 109 |
with wave.open(str(wav_out), "wb") as wf:
|
|
@@ -126,6 +215,7 @@ def synthesize_beat_tts(
|
|
| 126 |
|
| 127 |
if not out_mp3.exists() or out_mp3.stat().st_size < 500:
|
| 128 |
used_online = False
|
|
|
|
| 129 |
if not offline:
|
| 130 |
try:
|
| 131 |
raw_mp3 = out_mp3.with_suffix(".raw.mp3")
|
|
@@ -137,31 +227,40 @@ def synthesize_beat_tts(
|
|
| 137 |
"--write-media", str(raw_mp3),
|
| 138 |
]
|
| 139 |
subprocess.run(cmd_tts, check=True, capture_output=True, timeout=20)
|
| 140 |
-
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
except Exception as exc:
|
| 143 |
print(f"[TTS Info] Online Edge-TTS unavailable ({type(exc).__name__}); switching to offline OS TTS.")
|
| 144 |
|
| 145 |
if not used_online:
|
| 146 |
-
if
|
|
|
|
|
|
|
| 147 |
_synth_silent_timed_wav(text, raw_src)
|
| 148 |
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
"
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
|
|
|
|
|
|
|
|
|
| 165 |
subprocess.run(
|
| 166 |
[ffmpeg_bin, "-y", "-i", str(raw_src), "-ar", "48000", "-ac", "2", "-c:a", "libmp3lame", "-b:a", "192k", str(out_mp3)],
|
| 167 |
check=True,
|
|
@@ -222,7 +321,7 @@ def build_audio_and_timeline(
|
|
| 222 |
})
|
| 223 |
|
| 224 |
enriched_beats = []
|
| 225 |
-
mode_tag = "
|
| 226 |
for b_idx, beat in enumerate(slide["beats"]):
|
| 227 |
text_hash = hashlib.md5(f"{mode_tag}:{rate}:{beat['narration']}".encode("utf-8")).hexdigest()[:8]
|
| 228 |
fname = f"s{s_idx + 1:02d}_b{b_idx + 1:02d}_{text_hash}.mp3"
|
|
@@ -291,6 +390,25 @@ def build_audio_and_timeline(
|
|
| 291 |
"duration": sfx_durations["pulse"],
|
| 292 |
"volume": 0.28,
|
| 293 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
elif arch in ("changelog_vertical", "mission_staircase", "pricing_matrix", "swarm_network"):
|
| 295 |
for r_i in range(min(4, max(2, len(enriched_beats)))):
|
| 296 |
sfx_events.append({
|
|
|
|
| 5 |
"""
|
| 6 |
|
| 7 |
from __future__ import annotations
|
| 8 |
+
import base64
|
| 9 |
import hashlib
|
| 10 |
import os
|
| 11 |
import platform
|
|
|
|
| 51 |
return max(0.2, round(float(res.stdout.strip()), 3))
|
| 52 |
|
| 53 |
|
| 54 |
+
def _has_audible_speech(ffmpeg_bin: str, audio_file: Path) -> bool:
|
| 55 |
+
"""Verify the synthesized audio actually contains audible voice waveform (not an empty/silent WAV)."""
|
| 56 |
+
if not audio_file.exists() or audio_file.stat().st_size < 500:
|
| 57 |
+
return False
|
| 58 |
+
try:
|
| 59 |
+
res = subprocess.run(
|
| 60 |
+
[ffmpeg_bin, "-v", "error", "-i", str(audio_file), "-f", "s16le", "-acodec", "pcm_s16le", "-ar", "16000", "-ac", "1", "-"],
|
| 61 |
+
capture_output=True,
|
| 62 |
+
check=True,
|
| 63 |
+
timeout=10,
|
| 64 |
+
)
|
| 65 |
+
samples = np.frombuffer(res.stdout, dtype=np.int16).astype(np.float32) / 32768.0
|
| 66 |
+
if len(samples) < int(16000 * 0.28):
|
| 67 |
+
return False
|
| 68 |
+
rms = float(np.sqrt(np.mean(samples * samples)))
|
| 69 |
+
peak = float(np.max(np.abs(samples)))
|
| 70 |
+
return rms >= 0.002 and peak >= 0.015
|
| 71 |
+
except Exception:
|
| 72 |
+
return False
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def _synth_offline_os_tts(text: str, raw_audio_out: Path, ffmpeg_bin: str) -> bool:
|
| 76 |
"""
|
| 77 |
Attempts OS-native 100% offline TTS synthesis:
|
| 78 |
- macOS: `/usr/bin/say -v Yuna` (Korean)
|
| 79 |
+
- Windows: 1) SAPI.SpVoice + Speech_OneCore (Windows 10/11 Korean OneCore voices like Heami)
|
| 80 |
+
2) System.Speech.Synthesis verified ko-KR voice (UTF-16LE -EncodedCommand, zero escaping bugs)
|
| 81 |
- Linux: `espeak-ng -v ko`
|
| 82 |
+
Returns True ONLY if audible speech waveform was written, False otherwise.
|
| 83 |
"""
|
| 84 |
system = platform.system().lower()
|
| 85 |
try:
|
|
|
|
| 91 |
)
|
| 92 |
if res.returncode != 0:
|
| 93 |
subprocess.run(["/usr/bin/say", "-o", str(aiff_tmp), text], check=True, capture_output=True)
|
| 94 |
+
if _has_audible_speech(ffmpeg_bin, aiff_tmp):
|
| 95 |
aiff_tmp.replace(raw_audio_out)
|
| 96 |
return True
|
| 97 |
+
aiff_tmp.unlink(missing_ok=True)
|
| 98 |
|
| 99 |
elif system == "windows":
|
| 100 |
+
wav_tmp = raw_audio_out.with_suffix(".wav").resolve()
|
| 101 |
+
txt_tmp = raw_audio_out.with_suffix(".tts.txt").resolve()
|
| 102 |
+
txt_tmp.write_text(text, encoding="utf-8")
|
| 103 |
+
ps_code = f"""
|
| 104 |
+
$ErrorActionPreference = 'Stop'
|
| 105 |
+
$txt = [System.IO.File]::ReadAllText('{str(txt_tmp).replace("'", "''")}', [System.Text.Encoding]::UTF8)
|
| 106 |
+
$outWav = '{str(wav_tmp).replace("'", "''")}'
|
| 107 |
+
$done = $false
|
| 108 |
+
|
| 109 |
+
# 1. Try Windows 10/11 Speech_OneCore COM tokens (finds Microsoft Heami OneCore even when Desktop SAPI5 lacks ko-KR!)
|
| 110 |
+
try {{
|
| 111 |
+
$voice = New-Object -ComObject SAPI.SpVoice
|
| 112 |
+
$selected = $null
|
| 113 |
+
foreach ($catPath in @('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech_OneCore\\Voices', 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Speech\\Voices')) {{
|
| 114 |
+
try {{
|
| 115 |
+
$cat = New-Object -ComObject SAPI.SpObjectTokenCategory
|
| 116 |
+
$cat.SetId($catPath, $false)
|
| 117 |
+
foreach ($tok in $cat.EnumerateTokens()) {{
|
| 118 |
+
$lang = ''
|
| 119 |
+
try {{ $lang = $tok.GetAttribute('Language') }} catch {{}}
|
| 120 |
+
$desc = $tok.GetDescription()
|
| 121 |
+
if ($lang -eq '412' -or $desc -match 'Korean|Heami|SunHi|ํ๊ตญ์ด') {{
|
| 122 |
+
$selected = $tok
|
| 123 |
+
break
|
| 124 |
+
}}
|
| 125 |
+
}}
|
| 126 |
+
}} catch {{}}
|
| 127 |
+
if ($selected -ne $null) {{ break }}
|
| 128 |
+
}}
|
| 129 |
+
if ($selected -ne $null) {{
|
| 130 |
+
$voice.Voice = $selected
|
| 131 |
+
$voice.Rate = 1
|
| 132 |
+
$stream = New-Object -ComObject SAPI.SpFileStream
|
| 133 |
+
$stream.Open($outWav, 3, $false)
|
| 134 |
+
$voice.AudioOutputStream = $stream
|
| 135 |
+
[void]$voice.Speak($txt)
|
| 136 |
+
$stream.Close()
|
| 137 |
+
$done = $true
|
| 138 |
+
}}
|
| 139 |
+
}} catch {{}}
|
| 140 |
+
|
| 141 |
+
# 2. Fallback: .NET System.Speech ONLY if an installed voice supports Korean (prevents English Zira silent skip!)
|
| 142 |
+
if (-not $done) {{
|
| 143 |
+
try {{
|
| 144 |
+
Add-Type -AssemblyName System.Speech
|
| 145 |
+
$s = New-Object System.Speech.Synthesis.SpeechSynthesizer
|
| 146 |
+
$ko = $s.GetInstalledVoices() | Where-Object {{ $_.Enabled -and ($_.VoiceInfo.Culture.Name -like 'ko*') }} | Select-Object -First 1
|
| 147 |
+
if ($ko -ne $null) {{
|
| 148 |
+
$s.SelectVoice($ko.VoiceInfo.Name)
|
| 149 |
+
$s.Rate = 1
|
| 150 |
+
$s.SetOutputToWaveFile($outWav)
|
| 151 |
+
$s.Speak($txt)
|
| 152 |
+
}}
|
| 153 |
+
$s.Dispose()
|
| 154 |
+
}} catch {{}}
|
| 155 |
+
}}
|
| 156 |
+
"""
|
| 157 |
+
encoded_cmd = base64.b64encode(ps_code.encode("utf-16le")).decode("ascii")
|
| 158 |
+
subprocess.run(
|
| 159 |
+
["powershell", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encoded_cmd],
|
| 160 |
+
capture_output=True,
|
| 161 |
+
timeout=25,
|
| 162 |
)
|
| 163 |
+
txt_tmp.unlink(missing_ok=True)
|
| 164 |
+
if _has_audible_speech(ffmpeg_bin, wav_tmp):
|
| 165 |
wav_tmp.replace(raw_audio_out)
|
| 166 |
return True
|
| 167 |
+
wav_tmp.unlink(missing_ok=True)
|
| 168 |
|
| 169 |
else:
|
| 170 |
espeak = shutil.which("espeak-ng") or shutil.which("espeak")
|
| 171 |
if espeak:
|
| 172 |
wav_tmp = raw_audio_out.with_suffix(".wav")
|
| 173 |
subprocess.run([espeak, "-v", "ko", "-s", "165", "-w", str(wav_tmp), text], check=True, capture_output=True)
|
| 174 |
+
if _has_audible_speech(ffmpeg_bin, wav_tmp):
|
| 175 |
wav_tmp.replace(raw_audio_out)
|
| 176 |
return True
|
| 177 |
+
wav_tmp.unlink(missing_ok=True)
|
| 178 |
except Exception as exc:
|
| 179 |
print(f"[Offline TTS Warning] OS voice fallback error: {exc}")
|
| 180 |
return False
|
| 181 |
|
| 182 |
|
| 183 |
+
_WARNED_SILENT_FALLBACK = False
|
| 184 |
+
|
| 185 |
+
|
| 186 |
def _synth_silent_timed_wav(text: str, wav_out: Path) -> None:
|
| 187 |
+
"""Last-resort silent pacing track (approx 0.16s per character, min 2.6s) if OS lacks Korean TTS pack."""
|
| 188 |
+
global _WARNED_SILENT_FALLBACK
|
| 189 |
+
if not _WARNED_SILENT_FALLBACK:
|
| 190 |
+
print(
|
| 191 |
+
"[Offline TTS Notice] OS์ ํ๊ตญ์ด ์คํ๋ผ์ธ ์์ฑ ํฉ(Windows ์ค์ -> ์๊ฐ ๋ฐ ์ธ์ด -> ์์ฑ -> ํ๊ตญ์ด ์ถ๊ฐ)์ด ์์ด "
|
| 192 |
+
"์์ฐ์ค๋ฌ์ด ์ฝ๊ธฐ ์๋(์ฌ๋ผ์ด๋๋น 3~7์ด) ์๋ง ํ์ด๋ฐ ํธ๋์ผ๋ก ์งํํฉ๋๋ค."
|
| 193 |
+
)
|
| 194 |
+
_WARNED_SILENT_FALLBACK = True
|
| 195 |
+
dur = max(2.6, min(8.0, len(text.strip()) * 0.16))
|
| 196 |
sr = 48000
|
| 197 |
pcm = np.zeros((int(sr * dur), 2), dtype=np.int16)
|
| 198 |
with wave.open(str(wav_out), "wb") as wf:
|
|
|
|
| 215 |
|
| 216 |
if not out_mp3.exists() or out_mp3.stat().st_size < 500:
|
| 217 |
used_online = False
|
| 218 |
+
used_audible_tts = False
|
| 219 |
if not offline:
|
| 220 |
try:
|
| 221 |
raw_mp3 = out_mp3.with_suffix(".raw.mp3")
|
|
|
|
| 227 |
"--write-media", str(raw_mp3),
|
| 228 |
]
|
| 229 |
subprocess.run(cmd_tts, check=True, capture_output=True, timeout=20)
|
| 230 |
+
if _has_audible_speech(ffmpeg_bin, raw_mp3):
|
| 231 |
+
raw_mp3.replace(raw_src)
|
| 232 |
+
used_online = True
|
| 233 |
+
used_audible_tts = True
|
| 234 |
+
else:
|
| 235 |
+
raw_mp3.unlink(missing_ok=True)
|
| 236 |
except Exception as exc:
|
| 237 |
print(f"[TTS Info] Online Edge-TTS unavailable ({type(exc).__name__}); switching to offline OS TTS.")
|
| 238 |
|
| 239 |
if not used_online:
|
| 240 |
+
if _synth_offline_os_tts(text, raw_src, ffmpeg_bin):
|
| 241 |
+
used_audible_tts = True
|
| 242 |
+
else:
|
| 243 |
_synth_silent_timed_wav(text, raw_src)
|
| 244 |
|
| 245 |
+
if used_audible_tts:
|
| 246 |
+
cmd_trim = [
|
| 247 |
+
ffmpeg_bin, "-y",
|
| 248 |
+
"-i", str(raw_src),
|
| 249 |
+
"-af", (
|
| 250 |
+
"silenceremove=start_periods=1:start_duration=0.03:start_threshold=-45dB,"
|
| 251 |
+
"areverse,silenceremove=start_periods=1:start_duration=0.05:start_threshold=-45dB,areverse"
|
| 252 |
+
),
|
| 253 |
+
"-ar", "48000",
|
| 254 |
+
"-ac", "2",
|
| 255 |
+
"-c:a", "libmp3lame",
|
| 256 |
+
"-b:a", "192k",
|
| 257 |
+
str(out_mp3),
|
| 258 |
+
]
|
| 259 |
+
res = subprocess.run(cmd_trim, capture_output=True)
|
| 260 |
+
else:
|
| 261 |
+
res = None
|
| 262 |
+
|
| 263 |
+
if res is None or res.returncode != 0 or not out_mp3.exists() or out_mp3.stat().st_size < 500:
|
| 264 |
subprocess.run(
|
| 265 |
[ffmpeg_bin, "-y", "-i", str(raw_src), "-ar", "48000", "-ac", "2", "-c:a", "libmp3lame", "-b:a", "192k", str(out_mp3)],
|
| 266 |
check=True,
|
|
|
|
| 321 |
})
|
| 322 |
|
| 323 |
enriched_beats = []
|
| 324 |
+
mode_tag = "offline_v32" if offline else voice
|
| 325 |
for b_idx, beat in enumerate(slide["beats"]):
|
| 326 |
text_hash = hashlib.md5(f"{mode_tag}:{rate}:{beat['narration']}".encode("utf-8")).hexdigest()[:8]
|
| 327 |
fname = f"s{s_idx + 1:02d}_b{b_idx + 1:02d}_{text_hash}.mp3"
|
|
|
|
| 390 |
"duration": sfx_durations["pulse"],
|
| 391 |
"volume": 0.28,
|
| 392 |
})
|
| 393 |
+
elif arch == "dossier_stamp_card":
|
| 394 |
+
if "page_flip" in sfx_map:
|
| 395 |
+
sfx_events.append({
|
| 396 |
+
"id": f"sfx-flip-dos-s{s_idx + 1}",
|
| 397 |
+
"kind": "page_flip",
|
| 398 |
+
"src": f"assets/audio/sfx/{sfx_map['page_flip'].name}",
|
| 399 |
+
"start": round(slide_start + 0.14, 3),
|
| 400 |
+
"duration": sfx_durations["page_flip"],
|
| 401 |
+
"volume": 0.30,
|
| 402 |
+
})
|
| 403 |
+
if "pulse" in sfx_map:
|
| 404 |
+
sfx_events.append({
|
| 405 |
+
"id": f"sfx-stamp-dos-s{s_idx + 1}",
|
| 406 |
+
"kind": "pulse",
|
| 407 |
+
"src": f"assets/audio/sfx/{sfx_map['pulse'].name}",
|
| 408 |
+
"start": round(slide_start + 0.65, 3),
|
| 409 |
+
"duration": sfx_durations["pulse"],
|
| 410 |
+
"volume": 0.36,
|
| 411 |
+
})
|
| 412 |
elif arch in ("changelog_vertical", "mission_staircase", "pricing_matrix", "swarm_network"):
|
| 413 |
for r_i in range(min(4, max(2, len(enriched_beats)))):
|
| 414 |
sfx_events.append({
|