v3.1: Add Enterprise DRM Agent Handoff Bridge (--stdin-json/--stdin-md, Exit 42 guardrail, GroupShape & logo filter)
Browse files- README.md +38 -14
- SKILL.md +85 -17
- deck2video_offline_full.zip +2 -2
- ingest_parser.py +295 -42
- produce_deck_video.py +109 -17
- pyproject.toml +2 -2
- samples/sample_v3_presentation.pptx +0 -0
README.md
CHANGED
|
@@ -7,6 +7,7 @@ tags:
|
|
| 7 |
- agent-skill
|
| 8 |
- presentation-to-video
|
| 9 |
- pptx-to-video
|
|
|
|
| 10 |
- tech-briefing
|
| 11 |
- bento-grid
|
| 12 |
- karaoke-captions
|
|
@@ -17,31 +18,54 @@ tags:
|
|
| 17 |
- offline-ready
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# π¬ Deck2Video v3.
|
| 21 |
|
| 22 |
-
νμν¬μΈνΈ(`.pptx` λ΄
|
| 23 |
|
| 24 |
---
|
| 25 |
|
| 26 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
1. **π 3D μμ΄μ΄νλ μ ꡬ체 & μ λ° λΈλ¦¬ν λͺ¨λ ν¬ν¨ μ΄ 10μ’
λ°°κ²½ ν리μ
(`--bg`)**
|
| 29 |
-
*
|
| 30 |
-
* κΈ°μ‘΄: `horizon_wave` Β· `neural_constellation` Β· `aurora_mesh` Β· `blueprint_grid` Β· `vercel_spotlight` Β· `warm_editorial` Β· `clean_paper_light` Β· `cyber_matrix` (+ `auto` / `cycle`)
|
| 31 |
2. **ποΈ μλ¨ HUD λͺ¨λ 3μ’
(`--hud-style`) & μλ§ μ€νμΌ 6μ’
(`--caption-style`)**
|
| 32 |
-
* HUD: `chapter_tabs`
|
| 33 |
-
* μλ§: `glass_dual` Β·
|
| 34 |
3. **π§© μ΄ 16μ’
λͺ¨μ
μ»΄ν¬λνΈ & μ€μ μμ° μμ(`.mp4`)/μ΄λ―Έμ§(`.png`) μ½μ
μ§μ**
|
| 35 |
-
*
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
---
|
| 41 |
|
| 42 |
-
## π€
|
| 43 |
|
| 44 |
```text
|
| 45 |
-
https://huggingface.co/VanyaJ/deck2video-skill μ΅μ λ²μ (v3.
|
| 46 |
-
SKILL.mdμ `python3 produce_deck_video.py --list-presets` κ²°κ³Όλ₯Ό νμΈν λ€, μμΌλ‘ PPTXΒ·μλΒ·λ§ν¬λ€μ΄Β·HTML μλ£λ₯Ό μ£Όλ©΄ 16μ’
λ μ΄μμκ³Ό 10μ’
λ°°κ²½,
|
| 47 |
```
|
|
|
|
| 7 |
- agent-skill
|
| 8 |
- presentation-to-video
|
| 9 |
- pptx-to-video
|
| 10 |
+
- enterprise-drm-bridge
|
| 11 |
- tech-briefing
|
| 12 |
- bento-grid
|
| 13 |
- karaoke-captions
|
|
|
|
| 18 |
- offline-ready
|
| 19 |
---
|
| 20 |
|
| 21 |
+
# π¬ Deck2Video v3.1 Agent Skill (`PPTX Β· DOCX Β· MD Β· HTML Β· μ¬λ΄ DRM λΈλ¦Ώμ§ β 16μ’
λͺ¨μ
λ μ΄μμ + 10μ’
λ°°κ²½ + 6μ’
μλ§ + 10μ’
ν¨κ³Όμ β 1080p MP4`)
|
| 22 |
|
| 23 |
+
νμν¬μΈνΈ(`.pptx` β **μ¬λ΄ DRM μ°λ λΈλ¦Ώμ§**, κ·Έλ£Ή λν μ¬κ· μΆμΆ, νμ¬ λ‘κ³ μλ μ μΈ λ° λν μ΄λ―Έμ§ μΆμΆ ν¬ν¨), μλ(`.docx`), λ§ν¬λ€μ΄(`.md`), HTML λ¬Έμλ₯Ό μ
λ ₯λ°μ **μ νλΈ μΈκΈ° ν
ν¬ μ±λ(*μ«λνμ λΈκΉμΌκΈ°*, *ITν‘ν‘* λ±) λ° Linear / Apple ν€λ
ΈνΈ μ€νμΌ**μ `1920Γ1080` μ½λ λ λλ§ νλ μ ν
μ΄μ
μμμ μλ μμ±νλ **μ¨Β·μ€νλΌμΈ κ²Έμ© AI μμ΄μ νΈ μ€ν¬(v3.1)**μ
λλ€.
|
| 24 |
|
| 25 |
---
|
| 26 |
|
| 27 |
+
## π‘οΈ v3.1 μ κ· μ
λ°μ΄νΈ: μ¬λ΄ λ¬Έμ 보μ(DRM) νκ²½ μλ²½ μ°λ!
|
| 28 |
+
|
| 29 |
+
μ¬λ΄ PC(Fasoo, MarkAny, Softcamp, MS Purview λ±)μμ `.pptx`/`.docx`κ° DRMμΌλ‘ μνΈνλμ΄ μμ΄ νμ΄μ¬(`python-pptx`)μ΄ μ§μ μ΄μ§ λͺ»ν λ, AI μμ΄μ νΈκ° μμλ‘ μ μ μ¬λΌμ΄λ μΊ‘μ² μ¬λΌμ΄λμΌλ‘ μ°ννμ§ μλλ‘ **2λ¨κ³ μμ΄μ νΈ DRM λΈλ¦Ώμ§(`--stdin-json` / `--stdin-md` / Exit Code `42` κ°λλ μΌ)**κ° λ΄μ₯λμμ΅λλ€.
|
| 30 |
+
|
| 31 |
+
1. **μλ DRM λ°μ΄λ리 κ°μ§ (`check_openxml_drm` & Exit Code `42`)**
|
| 32 |
+
* DRMμ΄ κ±Έλ¦° `.pptx`/`.docx`κ° μ§μ μ
λ ₯λλ©΄ `[AGENT_ACTION_REQUIRED: DRM_DOCUMENT_DETECTED]` κ°μ΄λμ ν¨κ» **μ μ μ¬λΌμ΄λ μΊ‘μ² κΈμ§ κ·μΉ** λ° JSON/Markdown μ λ¬ μ€ν€λ§λ₯Ό μ¦μ μΆλ ₯ν©λλ€.
|
| 33 |
+
2. **μμ΄μ νΈ DRM μ΄λ μ€ν¬ β νμ΄μ¬ λͺ¨μ
μμ§ μ§κ²° (`--stdin-json` / `--stdin-md` / `.json`)**
|
| 34 |
+
* μμ΄μ νΈκ° **μ¬λ΄ DRM λ¬Έμ μ΄λ μ€ν¬**λ‘ μ¬λΌμ΄λ μ λͺ©Β·ν΅μ¬ λΆλ¦ΏΒ·ν(`table`)Β·λ°νμ λ
ΈνΈ(`notes`)λ₯Ό μ½μ λ€, λμ€ν¬ μμ νμΌ μμ΄ λ©λͺ¨λ¦¬ νμ΄ν(`--stdin-json`)λ UTF-8 `.json`/`.md`λ‘ λκΈ°λ©΄ **16μ’
HTML λͺ¨μ
κ·Έλν½ + ν¨κ³Όμ(SFX) + λ΄λ μ΄μ
MP4**κ° κ·Έλλ‘ μμ±λ©λλ€.
|
| 35 |
+
3. **μ¬λ΄ PPT μμ μ΅μ ν (`GroupShape` μ¬κ· νμ & νμ¬ λ‘κ³ μλ νν°λ§)**
|
| 36 |
+
* μ¬λ΄ λ³΄κ³ μμ νν μ€μ²© κ·Έλ£Ή λν(`Ctrl+G`) λ΄λΆμ ν
μ€νΈΒ·νκΉμ§ λΉ μ§μμ΄ μΆμΆνλ©°, λ§€ μ¬λΌμ΄λ ꡬμμ λ°ν μμ νμ¬ λ‘κ³ μμ΄μ½μ΄ μ΄λ―Έμ§ λ μ΄μμμ λ
μ νμ§ μλλ‘ μλ νν°λ§ν©λλ€ (`--ignore-ppt-images` μ΅μ
μΆκ° μ§μ).
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## π μ£Όμ κΈ°λ₯ νμ΄λΌμ΄νΈ (v3.0 ~ v3.1)
|
| 41 |
|
| 42 |
1. **π 3D μμ΄μ΄νλ μ ꡬ체 & μ λ° λΈλ¦¬ν λͺ¨λ ν¬ν¨ μ΄ 10μ’
λ°°κ²½ ν리μ
(`--bg`)**
|
| 43 |
+
* `wireframe_globe` Β· `isometric_hud_grid` Β· `horizon_wave` Β· `neural_constellation` Β· `aurora_mesh` Β· `blueprint_grid` Β· `vercel_spotlight` Β· `warm_editorial` Β· `clean_paper_light` Β· `cyber_matrix` (+ `auto` / `cycle`)
|
|
|
|
| 44 |
2. **ποΈ μλ¨ HUD λͺ¨λ 3μ’
(`--hud-style`) & μλ§ μ€νμΌ 6μ’
(`--caption-style`)**
|
| 45 |
+
* HUD: `chapter_tabs` Β· `tech_briefing` Β· `minimal`
|
| 46 |
+
* μλ§: `glass_dual` Β· `briefing_clean` Β· `pill_karaoke` (μ€μκ° λ¨μ΄λ³ μμ½ νμ΄λΌμ΄νΈ) Β· `cinema_minimal` Β· `neon_bar_left` Β· `kinetic_pop`
|
| 47 |
3. **π§© μ΄ 16μ’
λͺ¨μ
μ»΄ν¬λνΈ & μ€μ μμ° μμ(`.mp4`)/μ΄λ―Έμ§(`.png`) μ½μ
μ§μ**
|
| 48 |
+
* `hero_3d_briefing`, `media_showcase_split`, `changelog_vertical`, `mission_staircase`, `swarm_network`, `pricing_matrix`, `arc_cards`, `bento_grid`, `mockup_steps`, `book_quote`, `notebook_flip`, `vs_comparison`, `data_bars`, `process_timeline`, `terminal_flow`, `metric_summary`
|
| 49 |
+
4. **π μ체 ν©μ± λΈλ‘λμΊμ€νΈ ν¨κ³Όμ 10μ’
(`sfx_engine.py`) & 100% νμλ§ μ€νλΌμΈ λͺ¨λ (`--offline`)**
|
| 50 |
+
* `deck2video_offline_full.zip` νλλ‘ μΈν°λ· μ°κ²° λ° NPM μ€μΉ μμ΄ Windows / macOS / Linux μ¬λ΄ νμλ§μμ μ¦μ ꡬλ!
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## π’ μ¬λ΄ PC (DRM + νμλ§ νκ²½) μμ΄μ νΈ μ§μ ν둬ννΈ (볡λΆμ©)
|
| 55 |
+
|
| 56 |
+
μ¬λ΄ PCμμ μμΆμ νΌ λ€ AI μμ΄μ νΈμκ² μλμ κ°μ΄ μ§μνλ©΄ μ¬λΌμ΄λ μΊ‘μ²κ° μλ **μ§μ§ λͺ¨μ
κ·Έλν½ μμ**μΌλ‘ λ§λ€μ΄ μ€λλ€:
|
| 57 |
+
|
| 58 |
+
```text
|
| 59 |
+
λ΄κ° μμΆ νμ΄λ `deck_video_pipeline/SKILL.md` νμΌμ λ¨Όμ μ½κ³ μ€ν¬ κ·μΉμ μμ§ν΄ μ€.
|
| 60 |
+
첨λΆν μ¬λ΄ νμν¬μΈνΈ νμΌ(`λ°νμλ£.pptx`)μ μμμΌλ‘ λ§λ€ 건λ°, μ¬λ΄ DRMμ΄ κ±Έλ € μμΌλ©΄ μ λλ‘ μ¬λΌμ΄λλ₯Ό μ΄λ―Έμ§λ‘ μΊ‘μ²ν΄μ μ΄μ΄ λΆμ΄μ§ λ§!
|
| 61 |
+
λ€κ° κ°μ§ DRM λ¬Έμ μ΄λ μ€ν¬λ‘ κ° μ¬λΌμ΄λμ μ λͺ©(title), ν΅μ¬ λ΄μ©(bullets), ν(table), λ°νμ λ
ΈνΈ(notes β μμΌλ©΄ λ³Έλ¬Έ κΈ°λ° μμ°μ€λ¬μ΄ μ€λͺ
λλ³Έ 2~3λ¬Έμ₯ μμ±)λ₯Ό μ½μ λ€μ, `SKILL.md`μ Enterprise DRM Bridge κ·κ²©μ λ§μΆ° JSON(`--stdin-json` λλ UTF-8 `.json` νμΌ)μΌλ‘ `produce_deck_video.py --bg cycle --caption-style pill_karaoke --offline`μ μ λ¬ν΄μ 1080p λͺ¨μ
κ·Έλν½ MP4 μμμΌλ‘ λ λλ§ν΄ μ€.
|
| 62 |
+
```
|
| 63 |
|
| 64 |
---
|
| 65 |
|
| 66 |
+
## π€ μ¨λΌμΈ PCμ© μν΄λ¦ μ€μΉ / μ
λ°μ΄νΈ ν둬ννΈ
|
| 67 |
|
| 68 |
```text
|
| 69 |
+
https://huggingface.co/VanyaJ/deck2video-skill μ΅μ λ²μ (v3.1)μ λ΄ AI μμ΄μ νΈ μ μ μ€ν¬ ν΄λ(Antigravityλ ~/.gemini/config/skills/deck-video-pipeline, Claude Codeλ ~/.claude/skills/deck-video-pipeline)μ ν΄λ‘ (μ΄λ―Έ μμΌλ©΄ git pull μ
λ°μ΄νΈ)ν΄μ μ€μΉν΄ μ€.
|
| 70 |
+
SKILL.mdμ `python3 produce_deck_video.py --list-presets` λ° `--schema` κ²°κ³Όλ₯Ό νμΈν λ€, μμΌλ‘ PPTX(DRM λ¬Έμ ν¬ν¨)Β·μλΒ·λ§ν¬λ€μ΄Β·HTML μλ£λ₯Ό μ£Όλ©΄ 16μ’
λ μ΄μμκ³Ό 10μ’
λ°°κ²½, 10μ’
ν¨κ³Όμμ νμ©ν΄ κ³ νμ§ 1080p MP4 λ°ν μμμΌλ‘ λ§λ€μ΄ μ€.
|
| 71 |
```
|
SKILL.md
CHANGED
|
@@ -1,31 +1,97 @@
|
|
| 1 |
---
|
| 2 |
name: deck-video-pipeline
|
| 3 |
description: >
|
| 4 |
-
Convert PowerPoint (.pptx, incl.
|
| 5 |
-
Markdown (.md/.txt),
|
| 6 |
-
1920x1080 MP4 presentation & tech-briefing videos. Includes 10 procedural
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
Text Scramble, Vertical Changelog, /swarm Network Graph, 3D Mission Staircase,
|
| 11 |
-
Pricing Matrix, Bento Grid, 3D Open-Book Flip, Spiral Notebook, VS Comparison,
|
| 12 |
-
Data Bars, Roadmap, 3D Card Arc, Terminal Flow, etc.), and 10 procedural SFX.
|
| 13 |
-
Works both Online and 100% Air-Gapped Offline (--offline).
|
| 14 |
---
|
| 15 |
|
| 16 |
-
# Deck-to-Video v3.
|
| 17 |
|
| 18 |
Use this skill whenever the user asks to:
|
| 19 |
-
- Convert **PowerPoint (`.pptx`)**, **Word (`.docx`)**, **Markdown/text (`.md`/`.txt`)**,
|
| 20 |
- Embed **real demo videos (`.mp4`/`.webm`) or screenshots (`.png`/`.jpg`)** inside neon showcase frames alongside text-scramble typography, changelogs, pricing tables, `/swarm` diagrams, 3D staircases, Bento grids, or 3D open books.
|
| 21 |
-
- Produce videos in **100% air-gapped offline environments** (`--offline`).
|
| 22 |
|
| 23 |
---
|
| 24 |
|
| 25 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
```bash
|
| 28 |
python3 "<SKILL_DIR>/produce_deck_video.py" --list-presets
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
---
|
|
@@ -47,7 +113,7 @@ python3 "<SKILL_DIR>/produce_deck_video.py" \
|
|
| 47 |
```bash
|
| 48 |
python3 "<SKILL_DIR>/produce_deck_video.py" \
|
| 49 |
--input "/path/to/slides.pptx" \
|
| 50 |
-
--bg
|
| 51 |
--hud-style chapter_tabs \
|
| 52 |
--caption-style pill_karaoke \
|
| 53 |
--output "./output/presentation.mp4"
|
|
@@ -67,17 +133,19 @@ python3 "<SKILL_DIR>/produce_deck_video.py" \
|
|
| 67 |
python3 "<SKILL_DIR>/produce_deck_video.py" \
|
| 68 |
--input "/path/to/slides.pptx" \
|
| 69 |
--offline \
|
|
|
|
| 70 |
--output "./output/offline_video.mp4"
|
| 71 |
```
|
|
|
|
| 72 |
|
| 73 |
---
|
| 74 |
|
| 75 |
-
## 3. Complete v3.
|
| 76 |
|
| 77 |
- **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`
|
| 78 |
- **3 Top HUD Modes (`--hud-style`)**: `chapter_tabs`, `tech_briefing` (with `--brand "..."`), `minimal`
|
| 79 |
- **6 Caption Styles (`--caption-style`)**: `glass_dual`, `briefing_clean`, `pill_karaoke`, `cinema_minimal`, `neon_bar_left`, `kinetic_pop`
|
| 80 |
-
- **16 Scene Archetypes (`[ARCHETYPE: ...]`)**:
|
| 81 |
1. `hero_3d_briefing` β 3D rotating wireframe sphere + giant glowing title + rainbow topic pills
|
| 82 |
2. `media_showcase_split` β Giant keyword + Korean/ASCII text scramble + right neon `.mp4`/`.png` frame (`[MEDIA: path]`, `[MEDIA_CAPTION: ...]`, `[HERO_WORD: ...]`, `[SCRAMBLE: ...]`)
|
| 83 |
3. `changelog_vertical` β Color-coded dates (`11.03 | v2.29 | λ΄μ©`) + glowing spine + `[SOURCE: ...]`
|
|
|
|
| 1 |
---
|
| 2 |
name: deck-video-pipeline
|
| 3 |
description: >
|
| 4 |
+
Convert PowerPoint (.pptx, incl. corporate DRM bridge, GroupShape recursion & slide image extraction),
|
| 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), 16 scene archetypes, and 10 procedural SFX.
|
| 9 |
+
Works both Online and 100% Air-Gapped Offline (--offline) and seamlessly bridges enterprise DRM documents.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Deck-to-Video v3.1 Motion Presentation & 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.
|
| 16 |
- Embed **real demo videos (`.mp4`/`.webm`) or screenshots (`.png`/`.jpg`)** inside neon showcase frames alongside text-scramble typography, changelogs, pricing tables, `/swarm` diagrams, 3D staircases, Bento grids, or 3D open books.
|
| 17 |
+
- Produce videos in **100% air-gapped offline / corporate intranet environments** (`--offline`).
|
| 18 |
|
| 19 |
---
|
| 20 |
|
| 21 |
+
## π‘οΈ CRITICAL: μ¬λ΄ DRM μνΈν λ¬Έμ μ°λ κ·μΉ (Enterprise DRM Bridge Protocol)
|
| 22 |
+
|
| 23 |
+
μ¬λ΄ νκ²½(Fasoo, MarkAny, Softcamp, MS Purview λ±)μμ `.pptx` / `.docx` νμΌμ λ¬Έμ 보μ(DRM)μ΄ κ±Έλ € μμΌλ©΄ νμ΄μ¬(`python-pptx` / `python-docx`)μ μνΈνλ λ°μ΄λ리λ₯Ό μ§μ μ΄ μ μμΌλ©° `produce_deck_video.py`κ° **Exit Code `42` (`[AGENT_ACTION_REQUIRED: DRM_DOCUMENT_DETECTED]`)**λ₯Ό λ°νν©λλ€.
|
| 24 |
+
|
| 25 |
+
### π« μ λ κΈμ§ μ¬ν (STRICTLY PROHIBITED)
|
| 26 |
+
- **μ λλ‘ νμν¬μΈνΈ/μ€νΌμ€/LibreOfficeλ₯Ό λμ μ¬λΌμ΄λλ₯Ό μ μ μ΄λ―Έμ§(PNG/JPG)λ‘ ν΅μΊ‘μ²ν λ€ FFmpeg μ¬λΌμ΄λμΌλ‘ μ΄μ΄ λΆμ΄λ μ°ν μ€ν¬λ¦½νΈλ₯Ό μμ±νμ§ λ§μΈμ!**
|
| 27 |
+
- μ¬μ©μκ° μνλ κ²°κ³Όλ¬Όμ μ μ μ¬λΌμ΄λ μΊ‘μ² λμ΄μ΄ μλλΌ, λ³Έ νμ΄νλΌμΈμ΄ μμ±νλ **16μ’
λ€μ΄λλ―Ή HTML λͺ¨μ
κ·Έλν½ + μ€μκ° μλ§ + UI ν¨κ³Όμ(SFX) μμ**μ
λλ€.
|
| 28 |
+
|
| 29 |
+
### β
νμ 2λ¨κ³ DRM λΈλ¦Ώμ§ μ μ°¨ (Agent Reads DRM β Pipes JSON/MD to Python)
|
| 30 |
+
1. **Step 1 β μμ΄μ νΈμ DRM μ΄λ μ€ν¬/λκ΅¬λ‘ λ¬Έμ λ΄μ© μ½κΈ°**:
|
| 31 |
+
- μμ΄μ νΈκ° 보μ ν **μ¬λ΄ DRM λ¬Έμ μ΄λ μ€ν¬(λλ Office/λ¬Έμ μ½κΈ° λꡬ)**μ μ¬μ©ν΄ μλ³Έ `.pptx` / `.docx`λ₯Ό μ΄μ΄ μ¬λΌμ΄λλ³ **`μ λͺ©(title)`**, **`ν΅μ¬ μμ 리μ€νΈ(bullets)`**, **`ν ν λ°μ΄ν°(table)`**, **`λ°νμ λ
ΈνΈ(notes)`**λ₯Ό μΆμΆν©λλ€.
|
| 32 |
+
- μλ³Έ μ¬λΌμ΄λμ λ°νμ λ
ΈνΈκ° λΉμ΄ μλ€λ©΄, μ¬λΌμ΄λ λ³Έλ¬Έμ λ°νμΌλ‘ **μμ°μ€λ¬μ΄ ꡬμ΄μ²΄ μ€λͺ
λλ³Έ 2~3λ¬Έμ₯**μ μμ±ν΄ `notes`μ μ±μ λ£μ΅λλ€.
|
| 33 |
+
2. **Step 2 β ꡬ쑰νλ JSON λλ MarkdownμΌλ‘ `produce_deck_video.py` μ€ν**:
|
| 34 |
+
- μΆμΆν λ°μ΄ν°λ₯Ό μλ **λ°©μ A(`--stdin-json` νμ΄ν β λμ€ν¬ μμνμΌ λ―Έμμ±μΌλ‘ DRM μ¬μνΈν 100% ννΌ)** λλ **λ°©μ B(UTF-8 `.json` / `.md` νμΌ μ λ¬)**λ‘ λ겨 λͺ¨μ
MP4λ₯Ό λ λλ§ν©λλ€.
|
| 35 |
+
|
| 36 |
+
#### λ°©μ A-1: UTF-8 `.json` νμΌ μμ± ν μ λ¬ (κ°μ₯ μ§κ΄μ Β· κΆμ₯)
|
| 37 |
+
μΌλ°μ μΌλ‘ `.json` / `.md` νμΌμ μ€νΌμ€ λ¬Έμ DRM μνΈν λμμ΄ μλλ―λ‘ UTF-8λ‘ μ μ₯ν λ€ `-i`λ‘ μ λ¬ν©λλ€:
|
| 38 |
+
```json
|
| 39 |
+
{
|
| 40 |
+
"title": "2026 μ¬λ΄ AI λμ
μ λ΅ λ³΄κ³ μ",
|
| 41 |
+
"slides": [
|
| 42 |
+
{
|
| 43 |
+
"title": "μΆμ§ λ°°κ²½ λ° ν΅μ¬ κ³Όμ 5κ°μ§",
|
| 44 |
+
"chapter": "01 μΆμ§ λ°°κ²½",
|
| 45 |
+
"bullets": [
|
| 46 |
+
"보μ κ·μ μ€μ | μ¬λ΄ DRM μ΄λ μ€ν¬κ³Ό λͺ¨μ
μμ§ μμ κ²°ν©",
|
| 47 |
+
"μ
무 ν¨μ¨ κ·Ήλν | λ°ν μμ μ μ μκ° 90% λ¨μΆ",
|
| 48 |
+
"μκ° νμ§ νμ€ν | 16μ’
λ€μ΄λλ―Ή λͺ¨μ
μ»΄ν¬λνΈ μλ λ§€ν"
|
| 49 |
+
],
|
| 50 |
+
"notes": "μ¬λ΄ DRM μ€ν¬λ‘ μΆμΆν ν΅μ¬ λ΄μ©μ λ°νμΌλ‘ 첫 λ²μ§Έ μ₯νλ₯Ό μ΄ν΄λ³΄κ² μ΅λλ€. 보μ κ·μ μ μ² μ ν μ€μνλ©΄μλ μμ€ λμ λͺ¨μ
λΈλ¦¬ν μμμ μλμΌλ‘ μ μν μ μμ΅λλ€."
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"title": "κΈ°μ‘΄ μ¬λΌμ΄λμΌ vs λͺ¨μ
νμ΄νλΌμΈ λΉκ΅",
|
| 54 |
+
"chapter": "02 λμ
ν¨κ³Ό",
|
| 55 |
+
"table": [
|
| 56 |
+
["λΉκ΅ νλͺ©", "λ¨μ μΊ‘μ² μ¬λΌμ΄λμΌ", "Deck2Video λͺ¨μ
μμ§"],
|
| 57 |
+
["λ€μ΄λλ―Ή UI λͺ¨μ
", "β", "β"],
|
| 58 |
+
["λ¨μ΄ νμ΄λΌμ΄νΈ μλ§", "β", "β"],
|
| 59 |
+
["μ¬λ΄ νμλ§ λ λλ§", "β³", "β"]
|
| 60 |
+
],
|
| 61 |
+
"notes": "λ¨μν μ₯ν κ·Έλ¦Όλ§ λκΈ°λ μμκ³Ό λΉκ΅νλ©΄ μ λ¬λ ₯κ³Ό λͺ°μ
λμμ ν° μ°¨μ΄κ° λ©λλ€."
|
| 62 |
+
}
|
| 63 |
+
]
|
| 64 |
+
}
|
| 65 |
+
```
|
| 66 |
+
```bash
|
| 67 |
+
python "<SKILL_DIR>/produce_deck_video.py" \
|
| 68 |
+
-i "./extracted_slides.json" \
|
| 69 |
+
--bg cycle \
|
| 70 |
+
--caption-style pill_karaoke \
|
| 71 |
+
--offline \
|
| 72 |
+
-o "./output/corporate_briefing.mp4"
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
#### λ°©μ A-2: λμ€ν¬ νμΌ μ μ₯ μμ΄ νμ€ μ
λ ₯ νμ΄ν(`--stdin-json` / `--stdin-md`)λ‘ μ§μ μ£Όμ
|
| 76 |
+
λμ€ν¬μ μ΄λ€ νμΌλ λ¨κΈ°μ§ μκ³ λ©λͺ¨λ¦¬ νμ΄νλ‘ κ³§λ°λ‘ μ λ¬ν μ μμ΅λλ€:
|
| 77 |
+
- **macOS / Linux / Git Bash**:
|
| 78 |
+
```bash
|
| 79 |
+
python3 "<SKILL_DIR>/produce_deck_video.py" --stdin-json --project-name "corp_deck" --bg cycle --offline -o "./output/corp_deck.mp4" << 'EOF'
|
| 80 |
+
{"title": "λ³΄κ³ μ μ λͺ©", "slides": [{"title": "ν΅μ¬ μμ½ 3κ°μ§", "bullets": ["νλͺ©1 | μ€λͺ
1", "νλͺ©2 | μ€λͺ
2", "νλͺ©3 | μ€λͺ
3"], "notes": "첫 λ²μ§Έ μ¬λΌμ΄λ μ€λͺ
μ
λλ€."}]}
|
| 81 |
+
EOF
|
| 82 |
+
```
|
| 83 |
+
- **Windows (Python μΌνμ± νμ΄ν ν¬νΌ β νκΈ μΈμ½λ© κΉ¨μ§ 0%)**:
|
| 84 |
+
```powershell
|
| 85 |
+
python -c "import json, subprocess; payload={'title': 'λ³΄κ³ μ μ λͺ©', 'slides': [{'title': 'ν΅μ¬ μμ½ 3κ°μ§', 'bullets': ['νλͺ©1 | μ€λͺ
1', 'νλͺ©2 | μ€λͺ
2'], 'notes': 'μ¬λΌμ΄λ λ΄λ μ΄μ
λλ³Έμ
λλ€.'}]}; subprocess.run(['python', r'<SKILL_DIR>\produce_deck_video.py', '--stdin-json', '--bg', 'cycle', '--caption-style', 'pill_karaoke', '--offline', '-o', r'.\output\corp_deck.mp4'], input=json.dumps(payload, ensure_ascii=False).encode('utf-8'), check=True)"
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## 1. Skill Entrypoint & Schema / Preset Discovery
|
| 91 |
|
| 92 |
```bash
|
| 93 |
python3 "<SKILL_DIR>/produce_deck_video.py" --list-presets
|
| 94 |
+
python3 "<SKILL_DIR>/produce_deck_video.py" --schema
|
| 95 |
```
|
| 96 |
|
| 97 |
---
|
|
|
|
| 113 |
```bash
|
| 114 |
python3 "<SKILL_DIR>/produce_deck_video.py" \
|
| 115 |
--input "/path/to/slides.pptx" \
|
| 116 |
+
--bg cycle \
|
| 117 |
--hud-style chapter_tabs \
|
| 118 |
--caption-style pill_karaoke \
|
| 119 |
--output "./output/presentation.mp4"
|
|
|
|
| 133 |
python3 "<SKILL_DIR>/produce_deck_video.py" \
|
| 134 |
--input "/path/to/slides.pptx" \
|
| 135 |
--offline \
|
| 136 |
+
--bg cycle \
|
| 137 |
--output "./output/offline_video.mp4"
|
| 138 |
```
|
| 139 |
+
*(μ¬λ΄ PPT μμμ μ₯μμ© κ·Έλ¦Όμ΄ λ§μ ν
μ€νΈ/μΉ΄λ μμ£Όλ‘λ§ κ΅¬μ±νκ³ μΆλ€λ©΄ `--ignore-ppt-images` μ΅μ
μ μΆκ°νμΈμ. ꡬμμ λ°ν μμ νμ¬ λ‘κ³ μμ΄μ½μ κΈ°λ³ΈμΌλ‘ μλ μ μΈλ©λλ€.)*
|
| 140 |
|
| 141 |
---
|
| 142 |
|
| 143 |
+
## 3. Complete v3.1 Presets & Slide Tags
|
| 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 |
- **3 Top HUD Modes (`--hud-style`)**: `chapter_tabs`, `tech_briefing` (with `--brand "..."`), `minimal`
|
| 147 |
- **6 Caption Styles (`--caption-style`)**: `glass_dual`, `briefing_clean`, `pill_karaoke`, `cinema_minimal`, `neon_bar_left`, `kinetic_pop`
|
| 148 |
+
- **16 Scene Archetypes (`[ARCHETYPE: ...]` or JSON `"archetype"`)**:
|
| 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. `changelog_vertical` β Color-coded dates (`11.03 | v2.29 | λ΄μ©`) + glowing spine + `[SOURCE: ...]`
|
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:62275f72cb58d5c392c5424561882059f48726854c305763bbb525260a3a9042
|
| 3 |
+
size 92071295
|
ingest_parser.py
CHANGED
|
@@ -18,10 +18,79 @@ Maps every extracted slide into one of 5 visual motion archetypes:
|
|
| 18 |
from __future__ import annotations
|
| 19 |
import json
|
| 20 |
import re
|
|
|
|
| 21 |
from pathlib import Path
|
| 22 |
from typing import Any
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
ARCHETYPES = [
|
| 26 |
"hero_3d_briefing",
|
| 27 |
"media_showcase_split",
|
|
@@ -206,53 +275,93 @@ def _compile_raw_slides_to_spec(deck_title: str, raw_slides: list[dict[str, Any]
|
|
| 206 |
|
| 207 |
|
| 208 |
# ---------------------------------------------------------------------------
|
| 209 |
-
# 1. PowerPoint (.pptx) Parser
|
| 210 |
# ---------------------------------------------------------------------------
|
| 211 |
-
def parse_pptx_to_spec(pptx_path: Path) -> dict[str, Any]:
|
|
|
|
| 212 |
from pptx import Presentation
|
| 213 |
from pptx.enum.shapes import MSO_SHAPE_TYPE
|
| 214 |
|
| 215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
raw_slides: list[dict[str, Any]] = []
|
| 217 |
extracted_dir = pptx_path.parent / f".{pptx_path.stem}_extracted_media"
|
| 218 |
|
| 219 |
for s_idx, slide in enumerate(prs.slides):
|
| 220 |
title = ""
|
| 221 |
-
|
| 222 |
-
|
|
|
|
| 223 |
|
| 224 |
bullets: list[str] = []
|
| 225 |
meta_tags: dict[str, str] = {}
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
bullets.append(" | ".join(cells))
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
if not title and bullets:
|
| 257 |
title = bullets.pop(0)
|
| 258 |
if not title:
|
|
@@ -279,13 +388,17 @@ def parse_pptx_to_spec(pptx_path: Path) -> dict[str, Any]:
|
|
| 279 |
# 2. Microsoft Word (.docx) Parser
|
| 280 |
# ---------------------------------------------------------------------------
|
| 281 |
def parse_docx_to_spec(docx_path: Path) -> dict[str, Any]:
|
|
|
|
| 282 |
from docx import Document
|
| 283 |
from docx.oxml.table import CT_Tbl
|
| 284 |
from docx.oxml.text.paragraph import CT_P
|
| 285 |
from docx.table import Table
|
| 286 |
from docx.text.paragraph import Paragraph
|
| 287 |
|
| 288 |
-
|
|
|
|
|
|
|
|
|
|
| 289 |
deck_title = docx_path.stem
|
| 290 |
current_chapter = ""
|
| 291 |
raw_slides: list[dict[str, Any]] = []
|
|
@@ -398,13 +511,12 @@ def parse_docx_to_spec(docx_path: Path) -> dict[str, Any]:
|
|
| 398 |
|
| 399 |
|
| 400 |
# ---------------------------------------------------------------------------
|
| 401 |
-
# 3. Markdown / Plain Text (.md / .txt) Parser
|
| 402 |
# ---------------------------------------------------------------------------
|
| 403 |
-
def
|
| 404 |
-
text = md_path.read_text(encoding="utf-8")
|
| 405 |
lines = text.splitlines()
|
| 406 |
h1_count = sum(1 for l in lines if l.strip().startswith("# ") and not l.strip().startswith("## "))
|
| 407 |
-
deck_title =
|
| 408 |
current_chapter = ""
|
| 409 |
raw_slides: list[dict[str, Any]] = []
|
| 410 |
cur_slide: dict[str, Any] | None = None
|
|
@@ -422,7 +534,7 @@ def parse_markdown_to_spec(md_path: Path) -> dict[str, Any]:
|
|
| 422 |
|
| 423 |
if ln.startswith("# ") and not ln.startswith("## "):
|
| 424 |
h1 = ln[2:].strip()
|
| 425 |
-
if not raw_slides and cur_slide is None and deck_title ==
|
| 426 |
deck_title = h1
|
| 427 |
if h1_count > 1:
|
| 428 |
current_chapter = h1
|
|
@@ -465,6 +577,8 @@ def parse_markdown_to_spec(md_path: Path) -> dict[str, Any]:
|
|
| 465 |
cells = [c.strip() for c in ln.strip("|").split("|") if c.strip()]
|
| 466 |
if cells and cells[0].lower() not in ("ꡬλΆ", "νλͺ©", "μ΅μ
", "λ°©μ", "κΈ°λ₯"):
|
| 467 |
cur_slide["bullets"].append(" | ".join(cells))
|
|
|
|
|
|
|
| 468 |
else:
|
| 469 |
if len(ln) > 50 and ln.endswith(("λ€.", "μ.", "μ£ .", "!", "?")):
|
| 470 |
cur_slide["notes_lines"].append(ln)
|
|
@@ -475,6 +589,10 @@ def parse_markdown_to_spec(md_path: Path) -> dict[str, Any]:
|
|
| 475 |
return _compile_raw_slides_to_spec(deck_title, raw_slides)
|
| 476 |
|
| 477 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
# ---------------------------------------------------------------------------
|
| 479 |
# 4. HTML Presentation / Web Article (.html / .htm) Parser
|
| 480 |
# ---------------------------------------------------------------------------
|
|
@@ -614,15 +732,150 @@ def parse_html_to_spec(html_path: Path) -> dict[str, Any]:
|
|
| 614 |
return _compile_raw_slides_to_spec(deck_title, raw_slides)
|
| 615 |
|
| 616 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 617 |
# ---------------------------------------------------------------------------
|
| 618 |
# Unified Dispatcher
|
| 619 |
# ---------------------------------------------------------------------------
|
| 620 |
-
def load_input_to_spec(input_path: Path) -> dict[str, Any]:
|
| 621 |
suffix = input_path.suffix.lower()
|
| 622 |
if suffix == ".json":
|
| 623 |
-
|
|
|
|
| 624 |
if suffix == ".pptx":
|
| 625 |
-
return parse_pptx_to_spec(input_path)
|
| 626 |
if suffix == ".docx":
|
| 627 |
return parse_docx_to_spec(input_path)
|
| 628 |
if suffix in (".md", ".markdown", ".txt"):
|
|
|
|
| 18 |
from __future__ import annotations
|
| 19 |
import json
|
| 20 |
import re
|
| 21 |
+
import zipfile
|
| 22 |
from pathlib import Path
|
| 23 |
from typing import Any
|
| 24 |
|
| 25 |
|
| 26 |
+
class DRMProtectedFileError(RuntimeError):
|
| 27 |
+
"""Raised when an OpenXML (.pptx/.docx) file is encrypted by enterprise DRM or Office protection."""
|
| 28 |
+
|
| 29 |
+
def __init__(self, file_path: Path, reason: str = "") -> None:
|
| 30 |
+
self.file_path = file_path
|
| 31 |
+
self.reason = reason
|
| 32 |
+
super().__init__(f"DRM or encrypted document detected: {file_path} ({reason})")
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
AGENT_HANDOFF_JSON_SCHEMA_EXAMPLE = """{
|
| 36 |
+
"title": "2026 μ¬λ΄ AI λμ
μ λ΅ λ³΄κ³ μ",
|
| 37 |
+
"slides": [
|
| 38 |
+
{
|
| 39 |
+
"title": "μΆμ§ λ°°κ²½ λ° ν΅μ¬ κ³Όμ 5κ°μ§",
|
| 40 |
+
"chapter": "01 μΆμ§ λ°°κ²½",
|
| 41 |
+
"bullets": [
|
| 42 |
+
"λ¬Έμ 보μ μ€μ | μ¬λ΄ DRM μ΄λ μ€ν¬κ³Ό νμ΄νλΌμΈ μμ μ°λ",
|
| 43 |
+
"μμ°μ± ν₯μ | λ³΄κ³ μ λΈλ¦¬ν μμ μ μ μκ° 90% λ¨μΆ",
|
| 44 |
+
"νμ€ν | 16μ’
λͺ¨μ
κ·Έλν½ λ μ΄μμ μλ λ§€ν"
|
| 45 |
+
],
|
| 46 |
+
"notes": "μ¬λ΄ DRM μ€ν¬λ‘ μ½μ λ°νμ λ
ΈνΈ λλ μ¬λΌμ΄λ ν΅μ¬ μ€λͺ
λλ³Έμ
λλ€. λ°νμ λ
ΈνΈκ° μλ μ₯νλ μμ΄μ νΈκ° μ¬λΌμ΄λ λ΄μ©μ λ°νμΌλ‘ μμ°μ€λ¬μ΄ 2~3λ¬Έμ₯ ꡬμ΄μ²΄ λ΄λ μ΄μ
μ μμ±ν΄ λ£μΌμΈμ."
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"title": "κΈ°μ‘΄ λ°©μ vs λͺ¨μ
νμ΄νλΌμΈ λΉκ΅",
|
| 50 |
+
"chapter": "02 λμ
ν¨κ³Ό",
|
| 51 |
+
"table": [
|
| 52 |
+
["λΉκ΅ νλͺ©", "λ¨μ μ¬λΌμ΄λ μΊ‘μ²", "Deck2Video λͺ¨μ
μμ§"],
|
| 53 |
+
["μκ° λͺ°μ
λ", "β", "β"],
|
| 54 |
+
["λ¨μ΄ νμ΄λΌμ΄νΈ μλ§", "β", "β"],
|
| 55 |
+
["μ¬λ΄ νμλ§ μ§μ", "β³", "β"]
|
| 56 |
+
],
|
| 57 |
+
"notes": "ν λ°μ΄ν°λ table λ°°μ΄λ‘ μ λ¬νλ©΄ λ€μ¨ λΉκ΅ λ§€νΈλ¦μ€λ λ°μ΄ν° μ°¨νΈ λͺ¨μ
μΌλ‘ μλ λ³νλ©λλ€."
|
| 58 |
+
}
|
| 59 |
+
]
|
| 60 |
+
}"""
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def check_openxml_drm(file_path: Path) -> None:
|
| 64 |
+
"""Verify whether a .pptx/.docx file is a valid OpenXML ZIP or encrypted by corporate DRM."""
|
| 65 |
+
try:
|
| 66 |
+
header = file_path.read_bytes()[:64]
|
| 67 |
+
except Exception as exc:
|
| 68 |
+
raise DRMProtectedFileError(file_path, f"file read blocked: {exc}") from exc
|
| 69 |
+
|
| 70 |
+
if not header:
|
| 71 |
+
raise DRMProtectedFileError(file_path, "empty file (0 bytes)")
|
| 72 |
+
|
| 73 |
+
# Standard OpenXML (.pptx, .docx, .xlsx) starts with ZIP magic bytes PK\x03\x04 (or PK\x05\x06 / PK\x07\x08)
|
| 74 |
+
if header[:2] == b"PK" and zipfile.is_zipfile(file_path):
|
| 75 |
+
return
|
| 76 |
+
|
| 77 |
+
upper_hdr = header.upper()
|
| 78 |
+
vendor = "Corporate DRM / Encrypted Container"
|
| 79 |
+
if b"FASOO" in upper_hdr or b"FSN" in upper_hdr:
|
| 80 |
+
vendor = "Fasoo DRM (νμλ·μ»΄ λ¬Έμ보μ)"
|
| 81 |
+
elif b"MARKANY" in upper_hdr or b"DOCUMENT SAFER" in upper_hdr:
|
| 82 |
+
vendor = "MarkAny DRM (λ§ν¬μ λ λ¬Έμ보μ)"
|
| 83 |
+
elif b"SOFTCAMP" in upper_hdr or b"SCDSA" in upper_hdr:
|
| 84 |
+
vendor = "Softcamp DRM (μννΈμΊ ν λ¬Έμ보μ)"
|
| 85 |
+
elif header[:8] == b"\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1":
|
| 86 |
+
vendor = "OLE2 Encrypted Package (MS Purview AIP / Office μνΈν λλ ꡬν .ppt/.doc λ°μ΄λ리)"
|
| 87 |
+
|
| 88 |
+
raise DRMProtectedFileError(
|
| 89 |
+
file_path,
|
| 90 |
+
f"{vendor} β magic={header[:12]!r} (python-pptx/python-docx cannot open encrypted binary directly)",
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
ARCHETYPES = [
|
| 95 |
"hero_3d_briefing",
|
| 96 |
"media_showcase_split",
|
|
|
|
| 275 |
|
| 276 |
|
| 277 |
# ---------------------------------------------------------------------------
|
| 278 |
+
# 1. PowerPoint (.pptx) Parser (with GroupShape recursion & Logo Filter)
|
| 279 |
# ---------------------------------------------------------------------------
|
| 280 |
+
def parse_pptx_to_spec(pptx_path: Path, extract_images: bool = True) -> dict[str, Any]:
|
| 281 |
+
check_openxml_drm(pptx_path)
|
| 282 |
from pptx import Presentation
|
| 283 |
from pptx.enum.shapes import MSO_SHAPE_TYPE
|
| 284 |
|
| 285 |
+
try:
|
| 286 |
+
prs = Presentation(str(pptx_path))
|
| 287 |
+
except Exception as exc:
|
| 288 |
+
raise DRMProtectedFileError(pptx_path, f"python-pptx open failed: {exc}") from exc
|
| 289 |
+
|
| 290 |
+
slide_w = float(prs.slide_width or 9144000)
|
| 291 |
+
slide_h = float(prs.slide_height or 5143500)
|
| 292 |
raw_slides: list[dict[str, Any]] = []
|
| 293 |
extracted_dir = pptx_path.parent / f".{pptx_path.stem}_extracted_media"
|
| 294 |
|
| 295 |
for s_idx, slide in enumerate(prs.slides):
|
| 296 |
title = ""
|
| 297 |
+
title_shape = slide.shapes.title
|
| 298 |
+
if title_shape and title_shape.text.strip():
|
| 299 |
+
title = title_shape.text.strip().replace("\n", " ")
|
| 300 |
|
| 301 |
bullets: list[str] = []
|
| 302 |
meta_tags: dict[str, str] = {}
|
| 303 |
+
candidate_images: list[tuple[float, bool, Any, int]] = []
|
| 304 |
+
shape_counter = 0
|
| 305 |
+
|
| 306 |
+
def _walk_shapes(shapes_iter: Any) -> None:
|
| 307 |
+
nonlocal shape_counter
|
| 308 |
+
for shape in shapes_iter:
|
| 309 |
+
shape_counter += 1
|
| 310 |
+
if shape == title_shape:
|
| 311 |
+
continue
|
| 312 |
+
if shape.shape_type == MSO_SHAPE_TYPE.GROUP and hasattr(shape, "shapes"):
|
| 313 |
+
_walk_shapes(shape.shapes)
|
| 314 |
+
continue
|
| 315 |
+
if extract_images and shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
|
| 316 |
+
w_ratio = float(getattr(shape, "width", 0) or 0) / slide_w
|
| 317 |
+
h_ratio = float(getattr(shape, "height", 0) or 0) / slide_h
|
| 318 |
+
area_ratio = w_ratio * h_ratio
|
| 319 |
+
is_full_wallpaper = (w_ratio >= 0.96 and h_ratio >= 0.96)
|
| 320 |
+
# Ignore tiny corner corporate logos / header icons (< 16% width or height)
|
| 321 |
+
if w_ratio >= 0.16 and h_ratio >= 0.16 and area_ratio >= 0.04:
|
| 322 |
+
candidate_images.append((area_ratio, is_full_wallpaper, shape, shape_counter))
|
| 323 |
+
if getattr(shape, "has_text_frame", False):
|
| 324 |
+
for para in shape.text_frame.paragraphs:
|
| 325 |
+
line = para.text.strip()
|
| 326 |
+
if not line:
|
| 327 |
+
continue
|
| 328 |
+
m_tag = re.match(r"^\[([A-Z_]+):\s*(.+)\]$", line)
|
| 329 |
+
if m_tag:
|
| 330 |
+
meta_tags[m_tag.group(1).upper()] = m_tag.group(2).strip()
|
| 331 |
+
else:
|
| 332 |
+
bullets.append(line)
|
| 333 |
+
elif getattr(shape, "has_table", False):
|
| 334 |
+
for r_idx, row in enumerate(shape.table.rows):
|
| 335 |
+
cells = [c.text.strip().replace("\n", " ") for c in row.cells if c.text.strip()]
|
| 336 |
+
if not cells:
|
| 337 |
+
continue
|
| 338 |
+
if r_idx == 0 and len(cells) >= 3 and "PLANS" not in meta_tags and any(
|
| 339 |
+
k in " ".join(cells).lower() for k in ["무λ£", "μ λ£", "pro", "λͺ¨λ", "λ°©μ", "ꡬλΆ", "μ΅μ
", "λΉκ΅"]
|
| 340 |
+
):
|
| 341 |
+
meta_tags["PLANS"] = " | ".join(cells[1:4])
|
| 342 |
+
continue
|
| 343 |
bullets.append(" | ".join(cells))
|
| 344 |
|
| 345 |
+
_walk_shapes(slide.shapes)
|
| 346 |
+
|
| 347 |
+
extracted_img_path = ""
|
| 348 |
+
# Pick the most prominent content chart/screenshot while ignoring full-slide template wallpaper if text exists
|
| 349 |
+
filtered_imgs = [
|
| 350 |
+
item for item in candidate_images
|
| 351 |
+
if not (item[1] and len(bullets) >= 2)
|
| 352 |
+
]
|
| 353 |
+
if filtered_imgs:
|
| 354 |
+
filtered_imgs.sort(key=lambda x: x[0], reverse=True)
|
| 355 |
+
_, _, best_shape, best_idx = filtered_imgs[0]
|
| 356 |
+
try:
|
| 357 |
+
extracted_dir.mkdir(parents=True, exist_ok=True)
|
| 358 |
+
ext = best_shape.image.ext or "png"
|
| 359 |
+
img_file = extracted_dir / f"slide_{s_idx + 1:02d}_img_{best_idx}.{ext}"
|
| 360 |
+
img_file.write_bytes(best_shape.image.blob)
|
| 361 |
+
extracted_img_path = str(img_file.resolve())
|
| 362 |
+
except Exception:
|
| 363 |
+
pass
|
| 364 |
+
|
| 365 |
if not title and bullets:
|
| 366 |
title = bullets.pop(0)
|
| 367 |
if not title:
|
|
|
|
| 388 |
# 2. Microsoft Word (.docx) Parser
|
| 389 |
# ---------------------------------------------------------------------------
|
| 390 |
def parse_docx_to_spec(docx_path: Path) -> dict[str, Any]:
|
| 391 |
+
check_openxml_drm(docx_path)
|
| 392 |
from docx import Document
|
| 393 |
from docx.oxml.table import CT_Tbl
|
| 394 |
from docx.oxml.text.paragraph import CT_P
|
| 395 |
from docx.table import Table
|
| 396 |
from docx.text.paragraph import Paragraph
|
| 397 |
|
| 398 |
+
try:
|
| 399 |
+
doc = Document(str(docx_path))
|
| 400 |
+
except Exception as exc:
|
| 401 |
+
raise DRMProtectedFileError(docx_path, f"python-docx open failed: {exc}") from exc
|
| 402 |
deck_title = docx_path.stem
|
| 403 |
current_chapter = ""
|
| 404 |
raw_slides: list[dict[str, Any]] = []
|
|
|
|
| 511 |
|
| 512 |
|
| 513 |
# ---------------------------------------------------------------------------
|
| 514 |
+
# 3. Markdown / Plain Text (.md / .txt / stdin) Parser
|
| 515 |
# ---------------------------------------------------------------------------
|
| 516 |
+
def parse_markdown_text_to_spec(text: str, default_title: str = "Presentation") -> dict[str, Any]:
|
|
|
|
| 517 |
lines = text.splitlines()
|
| 518 |
h1_count = sum(1 for l in lines if l.strip().startswith("# ") and not l.strip().startswith("## "))
|
| 519 |
+
deck_title = default_title
|
| 520 |
current_chapter = ""
|
| 521 |
raw_slides: list[dict[str, Any]] = []
|
| 522 |
cur_slide: dict[str, Any] | None = None
|
|
|
|
| 534 |
|
| 535 |
if ln.startswith("# ") and not ln.startswith("## "):
|
| 536 |
h1 = ln[2:].strip()
|
| 537 |
+
if not raw_slides and cur_slide is None and deck_title == default_title:
|
| 538 |
deck_title = h1
|
| 539 |
if h1_count > 1:
|
| 540 |
current_chapter = h1
|
|
|
|
| 577 |
cells = [c.strip() for c in ln.strip("|").split("|") if c.strip()]
|
| 578 |
if cells and cells[0].lower() not in ("ꡬλΆ", "νλͺ©", "μ΅μ
", "λ°©μ", "κΈ°λ₯"):
|
| 579 |
cur_slide["bullets"].append(" | ".join(cells))
|
| 580 |
+
elif len(cells) >= 3 and "PLANS" not in cur_slide["meta"]:
|
| 581 |
+
cur_slide["meta"]["PLANS"] = " | ".join(cells[1:4])
|
| 582 |
else:
|
| 583 |
if len(ln) > 50 and ln.endswith(("λ€.", "μ.", "μ£ .", "!", "?")):
|
| 584 |
cur_slide["notes_lines"].append(ln)
|
|
|
|
| 589 |
return _compile_raw_slides_to_spec(deck_title, raw_slides)
|
| 590 |
|
| 591 |
|
| 592 |
+
def parse_markdown_to_spec(md_path: Path) -> dict[str, Any]:
|
| 593 |
+
return parse_markdown_text_to_spec(md_path.read_text(encoding="utf-8-sig"), default_title=md_path.stem)
|
| 594 |
+
|
| 595 |
+
|
| 596 |
# ---------------------------------------------------------------------------
|
| 597 |
# 4. HTML Presentation / Web Article (.html / .htm) Parser
|
| 598 |
# ---------------------------------------------------------------------------
|
|
|
|
| 732 |
return _compile_raw_slides_to_spec(deck_title, raw_slides)
|
| 733 |
|
| 734 |
|
| 735 |
+
# ---------------------------------------------------------------------------
|
| 736 |
+
# 5. Agent Handoff / DRM Bridge JSON Parser (.json / --stdin-json)
|
| 737 |
+
# ---------------------------------------------------------------------------
|
| 738 |
+
def parse_agent_json_to_spec(payload: Any, default_title: str = "Presentation") -> dict[str, Any]:
|
| 739 |
+
"""
|
| 740 |
+
Accepts EITHER:
|
| 741 |
+
1. Already-compiled DeckSpec JSON (contains 'chapters' + slides with 'beats' & 'archetype')
|
| 742 |
+
2. Simplified Agent-Extracted DRM JSON:
|
| 743 |
+
{"title": "...", "slides": [{"title": "...", "bullets": [...], "table": [[...]], "notes": "..."}]}
|
| 744 |
+
or even a bare list of slide dicts: [{"title": "...", "bullets": [...], "notes": "..."}]
|
| 745 |
+
"""
|
| 746 |
+
if isinstance(payload, dict) and "chapters" in payload and isinstance(payload.get("slides"), list):
|
| 747 |
+
slides_check = payload["slides"]
|
| 748 |
+
if slides_check and all(isinstance(s, dict) and "beats" in s and "archetype" in s for s in slides_check):
|
| 749 |
+
return payload
|
| 750 |
+
|
| 751 |
+
if isinstance(payload, list):
|
| 752 |
+
deck_title = default_title
|
| 753 |
+
slides_in = payload
|
| 754 |
+
top_voice = ""
|
| 755 |
+
top_rate = ""
|
| 756 |
+
elif isinstance(payload, dict):
|
| 757 |
+
deck_title = str(payload.get("title") or payload.get("deck_title") or default_title).strip()
|
| 758 |
+
slides_in = payload.get("slides") or payload.get("pages") or payload.get("sections") or []
|
| 759 |
+
top_voice = str(payload.get("voice") or "").strip()
|
| 760 |
+
top_rate = str(payload.get("voice_rate") or payload.get("rate") or "").strip()
|
| 761 |
+
else:
|
| 762 |
+
raise ValueError("JSON input must be a JSON object {'title': ..., 'slides': [...]} or a list of slide objects.")
|
| 763 |
+
|
| 764 |
+
raw_slides: list[dict[str, Any]] = []
|
| 765 |
+
for idx, s in enumerate(slides_in):
|
| 766 |
+
if not isinstance(s, dict):
|
| 767 |
+
continue
|
| 768 |
+
title = str(s.get("title") or s.get("heading") or s.get("name") or f"μ¬λΌμ΄λ {idx + 1}").strip()
|
| 769 |
+
chapter = str(s.get("chapter") or s.get("section") or title).strip()
|
| 770 |
+
meta: dict[str, str] = {}
|
| 771 |
+
if isinstance(s.get("meta"), dict):
|
| 772 |
+
for mk, mv in s["meta"].items():
|
| 773 |
+
if mv is not None and str(mv).strip():
|
| 774 |
+
meta[str(mk).upper()] = str(mv).strip()
|
| 775 |
+
|
| 776 |
+
key_map = {
|
| 777 |
+
"archetype": "ARCHETYPE",
|
| 778 |
+
"bg": "BG",
|
| 779 |
+
"bg_preset": "BG",
|
| 780 |
+
"badge": "BADGE",
|
| 781 |
+
"subtitle": "SUBTITLE",
|
| 782 |
+
"hero_word": "HERO_WORD",
|
| 783 |
+
"scramble": "SCRAMBLE",
|
| 784 |
+
"scramble_text": "SCRAMBLE",
|
| 785 |
+
"source": "SOURCE",
|
| 786 |
+
"source_note": "SOURCE",
|
| 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)
|
| 793 |
+
if val and str(val).strip() and str(val).strip().lower() != "auto":
|
| 794 |
+
meta[dst_k] = str(val).strip()
|
| 795 |
+
|
| 796 |
+
raw_bullets = s.get("bullets") or s.get("items") or s.get("points") or s.get("body") or []
|
| 797 |
+
if isinstance(raw_bullets, str):
|
| 798 |
+
bullets = [re.sub(r"^[-β’*βͺ]\s*", "", ln.strip()) for ln in raw_bullets.splitlines() if ln.strip()]
|
| 799 |
+
elif isinstance(raw_bullets, list):
|
| 800 |
+
bullets = [str(b).strip() for b in raw_bullets if str(b).strip()]
|
| 801 |
+
else:
|
| 802 |
+
bullets = []
|
| 803 |
+
|
| 804 |
+
tbl = s.get("table") or s.get("rows")
|
| 805 |
+
if isinstance(tbl, list) and tbl:
|
| 806 |
+
for r_i, row in enumerate(tbl):
|
| 807 |
+
if isinstance(row, list):
|
| 808 |
+
cells = [str(c).strip().replace("\n", " ") for c in row if str(c).strip()]
|
| 809 |
+
elif isinstance(row, str):
|
| 810 |
+
cells = [c.strip() for c in row.strip("|").split("|") if c.strip()]
|
| 811 |
+
else:
|
| 812 |
+
cells = []
|
| 813 |
+
if not cells:
|
| 814 |
+
continue
|
| 815 |
+
if r_i == 0 and len(cells) >= 3 and "PLANS" not in meta and any(
|
| 816 |
+
h in cells[0].lower() for h in ["ꡬλΆ", "νλͺ©", "λΉκ΅", "κΈ°λ₯", "μ΅μ
", "λ°©μ", "category", "feature"]
|
| 817 |
+
):
|
| 818 |
+
meta["PLANS"] = " | ".join(cells[1:4])
|
| 819 |
+
continue
|
| 820 |
+
bullets.append(" | ".join(cells))
|
| 821 |
+
|
| 822 |
+
raw_notes = (
|
| 823 |
+
s.get("notes")
|
| 824 |
+
or s.get("notes_lines")
|
| 825 |
+
or s.get("narration")
|
| 826 |
+
or s.get("speaker_notes")
|
| 827 |
+
or s.get("script")
|
| 828 |
+
or []
|
| 829 |
+
)
|
| 830 |
+
if isinstance(raw_notes, str):
|
| 831 |
+
notes_lines = [ln.strip() for ln in raw_notes.splitlines() if ln.strip()]
|
| 832 |
+
elif isinstance(raw_notes, list):
|
| 833 |
+
notes_lines = [str(n).strip() for n in raw_notes if str(n).strip()]
|
| 834 |
+
else:
|
| 835 |
+
notes_lines = []
|
| 836 |
+
|
| 837 |
+
# Also support pre-structured beats [{"narration": "...", "sub_ko": "...", "sub_en": "..."}]
|
| 838 |
+
if not notes_lines and isinstance(s.get("beats"), list):
|
| 839 |
+
for b_obj in s["beats"]:
|
| 840 |
+
if isinstance(b_obj, dict) and b_obj.get("narration"):
|
| 841 |
+
narr = str(b_obj["narration"]).strip()
|
| 842 |
+
en = str(b_obj.get("sub_en") or "").strip()
|
| 843 |
+
notes_lines.append(f"{narr} || {en}" if en else narr)
|
| 844 |
+
|
| 845 |
+
media_src = str(s.get("media_src") or s.get("media") or s.get("image") or "").strip()
|
| 846 |
+
quote = str(s.get("quote") or s.get("highlight_quote") or "").strip()
|
| 847 |
+
|
| 848 |
+
raw_slides.append({
|
| 849 |
+
"title": title,
|
| 850 |
+
"chapter": chapter,
|
| 851 |
+
"bullets": bullets,
|
| 852 |
+
"notes_lines": notes_lines,
|
| 853 |
+
"media_src": media_src,
|
| 854 |
+
"quote": quote,
|
| 855 |
+
"meta": meta,
|
| 856 |
+
})
|
| 857 |
+
|
| 858 |
+
if raw_slides and deck_title == default_title and isinstance(payload, list):
|
| 859 |
+
deck_title = raw_slides[0]["title"]
|
| 860 |
+
|
| 861 |
+
compiled = _compile_raw_slides_to_spec(deck_title, raw_slides)
|
| 862 |
+
if top_voice:
|
| 863 |
+
compiled["voice"] = top_voice
|
| 864 |
+
if top_rate:
|
| 865 |
+
compiled["voice_rate"] = top_rate
|
| 866 |
+
return compiled
|
| 867 |
+
|
| 868 |
+
|
| 869 |
# ---------------------------------------------------------------------------
|
| 870 |
# Unified Dispatcher
|
| 871 |
# ---------------------------------------------------------------------------
|
| 872 |
+
def load_input_to_spec(input_path: Path, extract_ppt_images: bool = True) -> dict[str, Any]:
|
| 873 |
suffix = input_path.suffix.lower()
|
| 874 |
if suffix == ".json":
|
| 875 |
+
raw_text = input_path.read_text(encoding="utf-8-sig")
|
| 876 |
+
return parse_agent_json_to_spec(json.loads(raw_text), default_title=input_path.stem)
|
| 877 |
if suffix == ".pptx":
|
| 878 |
+
return parse_pptx_to_spec(input_path, extract_images=extract_ppt_images)
|
| 879 |
if suffix == ".docx":
|
| 880 |
return parse_docx_to_spec(input_path)
|
| 881 |
if suffix in (".md", ".markdown", ".txt"):
|
produce_deck_video.py
CHANGED
|
@@ -35,10 +35,14 @@ if str(PIPELINE_DIR.parent) not in sys.path:
|
|
| 35 |
sys.path.insert(0, str(PIPELINE_DIR.parent))
|
| 36 |
|
| 37 |
from deck_video_pipeline.ingest_parser import (
|
|
|
|
|
|
|
| 38 |
create_sample_docx,
|
| 39 |
create_sample_html_slides,
|
| 40 |
create_sample_pptx,
|
| 41 |
load_input_to_spec,
|
|
|
|
|
|
|
| 42 |
)
|
| 43 |
from deck_video_pipeline.themes_and_presets import (
|
| 44 |
BACKGROUND_PRESETS,
|
|
@@ -129,15 +133,80 @@ def print_presets_catalog() -> None:
|
|
| 129 |
print(f" - {k:21s}: {desc}")
|
| 130 |
|
| 131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
def main() -> int:
|
| 133 |
bg_choices = ["auto", "cycle"] + list(BACKGROUND_PRESETS.keys())
|
| 134 |
cap_choices = list(CAPTION_STYLES.keys())
|
| 135 |
hud_choices = list(HUD_STYLES.keys())
|
| 136 |
|
| 137 |
parser = argparse.ArgumentParser(
|
| 138 |
-
description="Deck2Video v3.
|
| 139 |
)
|
| 140 |
parser.add_argument("--input", "-i", type=str, help="Input file (.pptx, .docx, .md, .txt, .html, .htm, or .json)")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
parser.add_argument("--demo", action="store_true", help="Generate sample PPTX and run full HTML + MP4 demo")
|
| 142 |
parser.add_argument("--generate-samples", action="store_true", help="Generate sample .pptx, .docx, and .html files in samples/")
|
| 143 |
parser.add_argument("--list-presets", action="store_true", help="List all built-in backgrounds, HUDs, caption styles, and 16 scene archetypes")
|
|
@@ -160,6 +229,9 @@ def main() -> int:
|
|
| 160 |
if args.list_presets:
|
| 161 |
print_presets_catalog()
|
| 162 |
return 0
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
use_offline = args.offline or (args.renderer == "offline")
|
| 165 |
|
|
@@ -171,23 +243,43 @@ def main() -> int:
|
|
| 171 |
print(f"Generated samples:\n - {p_pptx}\n - {p_docx}\n - {p_html}")
|
| 172 |
return 0
|
| 173 |
|
| 174 |
-
if args.
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
input_path = sample_pptx
|
| 179 |
-
else:
|
| 180 |
-
input_path = Path(args.input).expanduser().resolve()
|
| 181 |
-
if not input_path.exists():
|
| 182 |
-
print(f"[Error] Input file not found: {input_path}", file=sys.stderr)
|
| 183 |
return 1
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
if args.voice:
|
| 192 |
spec["voice"] = args.voice
|
| 193 |
if args.rate:
|
|
|
|
| 35 |
sys.path.insert(0, str(PIPELINE_DIR.parent))
|
| 36 |
|
| 37 |
from deck_video_pipeline.ingest_parser import (
|
| 38 |
+
AGENT_HANDOFF_JSON_SCHEMA_EXAMPLE,
|
| 39 |
+
DRMProtectedFileError,
|
| 40 |
create_sample_docx,
|
| 41 |
create_sample_html_slides,
|
| 42 |
create_sample_pptx,
|
| 43 |
load_input_to_spec,
|
| 44 |
+
parse_agent_json_to_spec,
|
| 45 |
+
parse_markdown_text_to_spec,
|
| 46 |
)
|
| 47 |
from deck_video_pipeline.themes_and_presets import (
|
| 48 |
BACKGROUND_PRESETS,
|
|
|
|
| 133 |
print(f" - {k:21s}: {desc}")
|
| 134 |
|
| 135 |
|
| 136 |
+
def _read_stdin_text() -> str:
|
| 137 |
+
raw = sys.stdin.buffer.read()
|
| 138 |
+
for enc in ("utf-8-sig", "utf-8", "cp949"):
|
| 139 |
+
try:
|
| 140 |
+
return raw.decode(enc)
|
| 141 |
+
except UnicodeDecodeError:
|
| 142 |
+
continue
|
| 143 |
+
return raw.decode("utf-8", errors="replace")
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
def print_agent_schema() -> None:
|
| 147 |
+
print("=== Agent DRM Handoff JSON Schema (--stdin-json or -i extracted.json) ===")
|
| 148 |
+
print(AGENT_HANDOFF_JSON_SCHEMA_EXAMPLE)
|
| 149 |
+
print("\n=== Agent DRM Handoff Markdown Format (--stdin-md or -i extracted.md) ===")
|
| 150 |
+
print(
|
| 151 |
+
"# νλ μ ν
μ΄μ
μ 체 μ λͺ©\n\n"
|
| 152 |
+
"## μ¬λΌμ΄λ 1 μ λͺ©\n"
|
| 153 |
+
"[CHAPTER: 01 μΉμ
λͺ
]\n"
|
| 154 |
+
"- ν΅μ¬ νλͺ© 1 | λΆμ° μ€λͺ
\n"
|
| 155 |
+
"- ν΅μ¬ νλͺ© 2 | λΆμ° μ€λͺ
\n"
|
| 156 |
+
"> λ°νμ λ
ΈνΈ λλ μμ΄μ νΈκ° μμ±ν μμ°μ€λ¬μ΄ ꡬμ΄μ²΄ λ΄λ μ΄μ
λλ³Έμ
λλ€.\n"
|
| 157 |
+
)
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
def print_drm_agent_handoff_guide(err: DRMProtectedFileError) -> None:
|
| 161 |
+
script_path = Path(__file__).resolve()
|
| 162 |
+
msg = f"""
|
| 163 |
+
================================================================================
|
| 164 |
+
[AGENT_ACTION_REQUIRED: DRM_DOCUMENT_DETECTED]
|
| 165 |
+
Target File : {err.file_path}
|
| 166 |
+
Diagnostic : {err.reason}
|
| 167 |
+
================================================================================
|
| 168 |
+
νμ΄μ¬ λΌμ΄λΈλ¬λ¦¬(python-pptx / python-docx)λ μ¬λ΄ DRM μνΈν λ°μ΄λ리λ₯Ό μ§μ μ΄ μ μμ΅λλ€.
|
| 169 |
+
|
| 170 |
+
π« [μ λ κΈμ§ / STRICTLY PROHIBITED]
|
| 171 |
+
- νμν¬μΈνΈ/μ€νΌμ€λ‘ μ¬λΌμ΄λλ₯Ό PNG/JPG μ μ μ΄λ―Έμ§λ‘ μΊ‘μ²ν΄μ FFmpeg μ¬λΌμ΄λμΌλ‘ μ΄μ΄ λΆμ΄λ μ°ν μ€ν¬λ¦½νΈλ₯Ό μ λ μμ±νμ§ λ§μΈμ!
|
| 172 |
+
|
| 173 |
+
β
[νμ νμ€ μ μ°¨ / REQUIRED 2-STEP AGENT DRM BRIDGE]
|
| 174 |
+
1. μμ΄μ νΈκ° 보μ ν **μ¬λ΄ DRM λ¬Έμ μ΄λ μ€ν¬/λꡬ**λ₯Ό μ¬μ©ν΄ `{err.file_path.name}`μ μ¬λΌμ΄λλ³ `μ λͺ©(title)`, `ν΅μ¬ λΆλ¦Ώ(bullets)`, `ν(table)`, `λ°νμ λ
ΈνΈ(notes)`λ₯Ό μ½μΌμΈμ.
|
| 175 |
+
(λ°νμ λ
ΈνΈκ° μλ μ¬λΌμ΄λλ λ³Έλ¬Έ λ΄μ©μ λ°νμΌλ‘ 2~3λ¬Έμ₯μ ꡬμ΄μ²΄ μ€λͺ
λλ³Έμ `notes`μ μ±μ λ£μΌμΈμ.)
|
| 176 |
+
2. μ½μ λ΄μ©μ μλ λ°©μ μ€ νλλ‘ `produce_deck_video.py`μ μ λ¬νλ©΄ 16μ’
λ€μ΄λλ―Ή HTML λͺ¨μ
κ·Έλν½ + ν¨κ³Όμ(SFX) MP4λ‘ μ¦μ λ λλ§λ©λλ€:
|
| 177 |
+
|
| 178 |
+
[λ°©λ² A β νμ€ μ
λ ₯ JSON νμ΄ν (λμ€ν¬ μμνμΌ μμ± μμ, μ¬λ΄ DRM μ¬μνΈν μλ²½ ννΌ)]
|
| 179 |
+
python "{script_path}" --stdin-json --project-name "{slugify(err.file_path.stem)}" --bg cycle --offline -o "./output/{slugify(err.file_path.stem)}.mp4" << 'EOF'
|
| 180 |
+
{AGENT_HANDOFF_JSON_SCHEMA_EXAMPLE}
|
| 181 |
+
EOF
|
| 182 |
+
|
| 183 |
+
*(Windows PowerShell μμ)*:
|
| 184 |
+
$json = @'
|
| 185 |
+
{{"title": "λ³΄κ³ μ μ λͺ©", "slides": [{{"title": "μ₯ν1", "bullets": ["ν΅μ¬1 | μ€λͺ
1"], "notes": "λ΄λ μ΄μ
λλ³Έμ
λλ€."}}]}}
|
| 186 |
+
'@
|
| 187 |
+
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
|
| 188 |
+
$utf8Bytes = [System.Text.Encoding]::UTF8.GetBytes($json)
|
| 189 |
+
$proc = Start-Process -FilePath python -ArgumentList '"{script_path}" --stdin-json --offline --bg cycle -o output.mp4' -NoNewWindow -PassThru -RedirectStandardInput ...
|
| 190 |
+
π λλ λ κ°λ¨ν UTF-8 `.json` / `.md` νμΌλ‘ μ μ₯ ν `-i extracted_deck.json` μΌλ‘ μ€ννμΈμ!
|
| 191 |
+
(μΌλ°μ μΌλ‘ `.json` / `.md` νμΌμ μ€νΌμ€ DRM μνΈν λμμ΄ μλλλ€.)
|
| 192 |
+
================================================================================
|
| 193 |
+
"""
|
| 194 |
+
print(msg.strip(), file=sys.stderr)
|
| 195 |
+
|
| 196 |
+
|
| 197 |
def main() -> int:
|
| 198 |
bg_choices = ["auto", "cycle"] + list(BACKGROUND_PRESETS.keys())
|
| 199 |
cap_choices = list(CAPTION_STYLES.keys())
|
| 200 |
hud_choices = list(HUD_STYLES.keys())
|
| 201 |
|
| 202 |
parser = argparse.ArgumentParser(
|
| 203 |
+
description="Deck2Video v3.1: Convert PPTX / DOCX / Markdown / HTML / Agent-DRM-JSON into code-rendered HTML + SFX MP4 videos."
|
| 204 |
)
|
| 205 |
parser.add_argument("--input", "-i", type=str, help="Input file (.pptx, .docx, .md, .txt, .html, .htm, or .json)")
|
| 206 |
+
parser.add_argument("--stdin-json", action="store_true", help="Read Agent-extracted slide JSON from stdin (Enterprise DRM Bridge)")
|
| 207 |
+
parser.add_argument("--stdin-md", action="store_true", help="Read Agent-extracted Markdown slides from stdin (Enterprise DRM Bridge)")
|
| 208 |
+
parser.add_argument("--schema", action="store_true", help="Print the Agent DRM Handoff JSON & Markdown schema template")
|
| 209 |
+
parser.add_argument("--ignore-ppt-images", action="store_true", help="Ignore embedded pictures inside PPTX slides (pure motion cards/typography)")
|
| 210 |
parser.add_argument("--demo", action="store_true", help="Generate sample PPTX and run full HTML + MP4 demo")
|
| 211 |
parser.add_argument("--generate-samples", action="store_true", help="Generate sample .pptx, .docx, and .html files in samples/")
|
| 212 |
parser.add_argument("--list-presets", action="store_true", help="List all built-in backgrounds, HUDs, caption styles, and 16 scene archetypes")
|
|
|
|
| 229 |
if args.list_presets:
|
| 230 |
print_presets_catalog()
|
| 231 |
return 0
|
| 232 |
+
if args.schema:
|
| 233 |
+
print_agent_schema()
|
| 234 |
+
return 0
|
| 235 |
|
| 236 |
use_offline = args.offline or (args.renderer == "offline")
|
| 237 |
|
|
|
|
| 243 |
print(f"Generated samples:\n - {p_pptx}\n - {p_docx}\n - {p_html}")
|
| 244 |
return 0
|
| 245 |
|
| 246 |
+
if args.stdin_json or args.stdin_md:
|
| 247 |
+
stdin_text = _read_stdin_text().strip()
|
| 248 |
+
if not stdin_text:
|
| 249 |
+
print("[Error] --stdin-json / --stdin-md specified, but stdin was empty.", file=sys.stderr)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
return 1
|
| 251 |
+
default_name = args.project_name or (Path(args.output).stem if args.output else "drm_agent_deck")
|
| 252 |
+
proj_slug = slugify(default_name)
|
| 253 |
+
project_dir = PIPELINE_DIR / "projects" / proj_slug
|
| 254 |
+
ensure_project_scaffold(project_dir, proj_slug, offline=use_offline)
|
| 255 |
+
if args.stdin_json:
|
| 256 |
+
print("[2/5] Parsing Agent-extracted DRM JSON from stdin into 16 motion archetypes...")
|
| 257 |
+
spec = parse_agent_json_to_spec(json.loads(stdin_text), default_title=default_name)
|
| 258 |
+
else:
|
| 259 |
+
print("[2/5] Parsing Agent-extracted DRM Markdown from stdin into 16 motion archetypes...")
|
| 260 |
+
spec = parse_markdown_text_to_spec(stdin_text, default_title=default_name)
|
| 261 |
+
else:
|
| 262 |
+
if args.demo or not args.input:
|
| 263 |
+
sample_pptx = samples_dir / "sample_ai_sync_lecture.pptx"
|
| 264 |
+
print(f"[1/5] Generating sample PowerPoint deck: {sample_pptx}")
|
| 265 |
+
create_sample_pptx(sample_pptx)
|
| 266 |
+
input_path = sample_pptx
|
| 267 |
+
else:
|
| 268 |
+
input_path = Path(args.input).expanduser().resolve()
|
| 269 |
+
if not input_path.exists():
|
| 270 |
+
print(f"[Error] Input file not found: {input_path}", file=sys.stderr)
|
| 271 |
+
return 1
|
| 272 |
+
|
| 273 |
+
proj_slug = slugify(args.project_name or input_path.stem)
|
| 274 |
+
project_dir = PIPELINE_DIR / "projects" / proj_slug
|
| 275 |
+
ensure_project_scaffold(project_dir, proj_slug, offline=use_offline)
|
| 276 |
+
|
| 277 |
+
print(f"[2/5] Parsing '{input_path.name}' ({input_path.suffix.lower()}) into motion scene archetypes...")
|
| 278 |
+
try:
|
| 279 |
+
spec = load_input_to_spec(input_path, extract_ppt_images=not args.ignore_ppt_images)
|
| 280 |
+
except DRMProtectedFileError as drm_err:
|
| 281 |
+
print_drm_agent_handoff_guide(drm_err)
|
| 282 |
+
return 42
|
| 283 |
if args.voice:
|
| 284 |
spec["voice"] = args.voice
|
| 285 |
if args.rate:
|
pyproject.toml
CHANGED
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
| 4 |
|
| 5 |
[project]
|
| 6 |
name = "deck-video-pipeline"
|
| 7 |
-
version = "1.0
|
| 8 |
-
description = "Universal PPTX / DOCX / Markdown / HTML to Code-Rendered Motion + SFX MP4 Pipeline"
|
| 9 |
readme = "README.md"
|
| 10 |
requires-python = ">=3.10"
|
| 11 |
dependencies = [
|
|
|
|
| 4 |
|
| 5 |
[project]
|
| 6 |
name = "deck-video-pipeline"
|
| 7 |
+
version = "3.1.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"
|
| 11 |
dependencies = [
|
samples/sample_v3_presentation.pptx
ADDED
|
Binary file (52.2 kB). View file
|
|
|