VanyaJ commited on
Commit
d6f4c1f
Β·
verified Β·
1 Parent(s): 135f2e5

v3.1: Add Enterprise DRM Agent Handoff Bridge (--stdin-json/--stdin-md, Exit 42 guardrail, GroupShape & logo filter)

Browse files
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.0 Agent Skill (`PPTX Β· DOCX Β· MD Β· HTML βž” 16μ’… λͺ¨μ…˜ λ ˆμ΄μ•„μ›ƒ + 10μ’… λ°°κ²½ + 6μ’… μžλ§‰ + 10μ’… 효과음 + 싀사 μ˜μƒ/이미지 PiP βž” 1080p MP4`)
21
 
22
- νŒŒμ›Œν¬μΈνŠΈ(`.pptx` λ‚΄μž₯ 이미지 μžλ™ μΆ”μΆœ 포함), μ›Œλ“œ(`.docx`), λ§ˆν¬λ‹€μš΄(`.md`), HTML λ¬Έμ„œλ₯Ό μž…λ ₯λ°›μ•„ **유튜브 인기 ν…Œν¬ 채널(*μ«‘λŒ€ν‘œμ˜ 딸깍일기*, *IT톑톑* λ“±) 및 Linear / Apple ν‚€λ…ΈνŠΈ μŠ€νƒ€μΌ**의 `1920Γ—1080` μ½”λ“œ λ Œλ”λ§ ν”„λ ˆμ  ν…Œμ΄μ…˜ μ˜μƒμ„ μžλ™ μƒμ„±ν•˜λŠ” **μ˜¨Β·μ˜€ν”„λΌμΈ 겸용 AI μ—μ΄μ „νŠΈ μŠ€ν‚¬(v3.0)**μž…λ‹ˆλ‹€.
23
 
24
  ---
25
 
26
- ## πŸ†• v3.0 μ—…λ°μ΄νŠΈ ν•˜μ΄λΌμ΄νŠΈ (*IT톑톑* μŠ€νƒ€μΌ 심측 λΈŒλ¦¬ν•‘ μ™„λ²½ 지원!)
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  1. **🌌 3D μ™€μ΄μ–΄ν”„λ ˆμž„ ꡬ체 & μ •λ°€ λΈŒλ¦¬ν•‘ λͺ¨λˆˆ 포함 총 10μ’… λ°°κ²½ 프리셋 (`--bg`)**
29
- * μ‹ κ·œ: **`wireframe_globe`** (우주 μŠ€νƒ€ν•„λ“œ + 3D νšŒμ „ μΈ‘μ§€μ„  μ™€μ΄μ–΄ν”„λ ˆμž„ ꡬ체 & 이쀑 ꢀ도 링 + 폴라 λ ˆμ΄λ” ν”Œλ‘œμ–΄) Β· **`isometric_hud_grid`** (닀크 μ •λ°€ λΈŒλ¦¬ν•‘ λͺ¨λˆˆ κ·Έλ¦¬λ“œ)
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` (상단 닀쀑 챕터 μ§„ν–‰λ°”) Β· **`tech_briefing`** (μ’Œμƒλ‹¨ λΈŒλ¦¬ν•‘ 타이틀 + 점멸 μ»€μ„œ `|` + 4μ½”λ„ˆ λ·°νŒŒμΈλ” λΈŒλž˜ν‚· + ν•˜λ‹¨ `좜처:` 각주) Β· `minimal`
33
- * μžλ§‰: `glass_dual` Β· **`briefing_clean`** (ν•˜λ‹¨ 닀크 μ™€μ΄λ“œ λΈŒλ¦¬ν•‘ λ°”) Β· `pill_karaoke` (μ‹€μ‹œκ°„ 단어별 μ•Œμ•½ ν•˜μ΄λΌμ΄νŠΈ) Β· `cinema_minimal` Β· `neon_bar_left` Β· `kinetic_pop`
34
  3. **🧩 총 16μ’… λͺ¨μ…˜ μ»΄ν¬λ„ŒνŠΈ & μ‹€μ œ μ‹œμ—° μ˜μƒ(`.mp4`)/이미지(`.png`) μ‚½μž… 지원**
35
- * μ‹ κ·œ 6μ’…: **`hero_3d_briefing`** (3D ꡬ체 μ˜€ν”„λ‹ + 레인보우 ν† ν”½ μ•Œμ•½) Β· **`media_showcase_split`** (λŒ€ν˜• ν‚€μ›Œλ“œ + **ν•œκΈ€/영문 ν…μŠ€νŠΈ μŠ€ν¬λž¨λΈ” οΏ½οΏ½μ½”λ”©** + 우츑 λ„€μ˜¨ μ˜μƒ/이미지 μ‹œμ—° ν”„λ ˆμž„ `[MEDIA: 파일경둜]`, PPTX μŠ¬λΌμ΄λ“œ λ‚΄ 이미지 μžλ™ μΆ”μΆœ 지원!) Β· **`changelog_vertical`** (λ‚ μ§œΒ·λ²„μ „λ³„ λ©€ν‹°μ»¬λŸ¬ 수직 νƒ€μž„λΌμΈ) Β· **`mission_staircase`** (5색 λ―Έμ…˜ 리슀트 + 우츑 3D μƒμŠΉ 계단 블둝) Β· **`swarm_network`** (쀑앙 코디넀이터 + λ©€ν‹° μ›Œμ»€ ν—ˆλΈŒ-슀포크 κ·Έλž˜ν”„) Β· **`pricing_matrix`** (`βœ“ / β–³ / βœ•` μš”κΈˆΒ·κΈ°λŠ₯ λΉ„κ΅ν‘œ)
36
- * κΈ°μ‘΄ 10μ’…: `arc_cards`, `bento_grid`, `mockup_steps`, `book_quote`, `notebook_flip`, `vs_comparison`, `data_bars`, `process_timeline`, `terminal_flow`, `metric_summary`
37
- 4. **πŸ”Š 자체 ν•©μ„± λΈŒλ‘œλ“œμΊμŠ€νŠΈ 효과음 10μ’… (`sfx_engine.py`)**
38
- * μ‹ κ·œ **`scramble`** (ν…μŠ€νŠΈ λ””μ½”λ”© ν…”λ ˆλ©”νŠΈλ¦¬ μ‚¬μš΄λ“œ), **`sonar`** (3D ꡬ체/μŠ€μ›œ μ†Œλ‚˜ ν•‘) 포함 총 10μ’… WAV κΈ°λ³Έ λ‚΄μž₯!
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  ---
41
 
42
- ## πŸ€– AI μ—μ΄μ „νŠΈμš© 원클릭 μ„€μΉ˜ / μ—…λ°μ΄νŠΈ ν”„λ‘¬ν”„νŠΈ
43
 
44
  ```text
45
- https://huggingface.co/VanyaJ/deck2video-skill μ΅œμ‹  버전(v3.0)을 λ‚΄ AI μ—μ΄μ „νŠΈ μ „μ—­ μŠ€ν‚¬ 폴더(AntigravityλŠ” ~/.gemini/config/skills/deck-video-pipeline, Claude CodeλŠ” ~/.claude/skills/deck-video-pipeline)에 클둠(이미 있으면 git pull μ—…λ°μ΄νŠΈ)ν•΄μ„œ μ„€μΉ˜ν•΄ 쀘.
46
- SKILL.md와 `python3 produce_deck_video.py --list-presets` κ²°κ³Όλ₯Ό ν™•μΈν•œ λ’€, μ•žμœΌλ‘œ PPTXΒ·μ›Œλ“œΒ·λ§ˆν¬λ‹€μš΄Β·HTML 자료λ₯Ό μ£Όλ©΄ 16μ’… λ ˆμ΄μ•„μ›ƒκ³Ό 10μ’… λ°°κ²½, μ˜μƒ/이미지 μ‚½μž…([MEDIA: ...]), 10μ’… νš¨κ³ΌμŒμ„ ν™œμš©ν•΄ κ³ ν™”μ§ˆ 1080p MP4 λ°œν‘œ μ˜μƒμœΌλ‘œ λ§Œλ“€μ–΄ 쀘.
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. auto slide image extraction), Word (.docx),
5
- Markdown (.md/.txt), or HTML (.html) materials into sleek code-rendered
6
- 1920x1080 MP4 presentation & tech-briefing videos. Includes 10 procedural
7
- background presets (incl. 3D Wireframe Globe & Briefing Grid), 3 HUD modes
8
- (Chapter Tabs & IT톑톑 Tech Briefing), 6 caption styles (incl. Pill Karaoke &
9
- Briefing Bar), 16 scene archetypes (3D Hero Briefing, Video/Image PiP Split +
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.0 Motion Presentation & Tech-Briefing Skill (`deck-video-pipeline`)
17
 
18
  Use this skill whenever the user asks to:
19
- - Convert **PowerPoint (`.pptx`)**, **Word (`.docx`)**, **Markdown/text (`.md`/`.txt`)**, or **HTML (`.html`)** into a sleek presentation video, deep-dive tech briefing (like *IT톑톑* or *μ«‘λŒ€ν‘œμ˜ 딸깍일기*), lecture video, or SaaS explainer.
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
- ## 1. Skill Entrypoint & Preset Discovery
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 horizon_wave \
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.0 Presets & Slide Tags
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:ac04f3ced97cbac371365450981f4c71cd033ce8c8293082e020df6b18c080db
3
- size 92013137
 
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
- prs = Presentation(str(pptx_path))
 
 
 
 
 
 
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
- if slide.shapes.title and slide.shapes.title.text.strip():
222
- title = slide.shapes.title.text.strip().replace("\n", " ")
 
223
 
224
  bullets: list[str] = []
225
  meta_tags: dict[str, str] = {}
226
- extracted_img_path = ""
227
-
228
- for sh_i, shape in enumerate(slide.shapes):
229
- if shape == slide.shapes.title:
230
- continue
231
- if shape.shape_type == MSO_SHAPE_TYPE.PICTURE and not extracted_img_path:
232
- try:
233
- extracted_dir.mkdir(parents=True, exist_ok=True)
234
- ext = shape.image.ext or "png"
235
- img_file = extracted_dir / f"slide_{s_idx + 1:02d}_img_{sh_i}.{ext}"
236
- img_file.write_bytes(shape.image.blob)
237
- extracted_img_path = str(img_file.resolve())
238
- except Exception:
239
- pass
240
- if getattr(shape, "has_text_frame", False):
241
- for para in shape.text_frame.paragraphs:
242
- line = para.text.strip()
243
- if not line:
244
- continue
245
- m_tag = re.match(r"^\[([A-Z_]+):\s*(.+)\]$", line)
246
- if m_tag:
247
- meta_tags[m_tag.group(1).upper()] = m_tag.group(2).strip()
248
- else:
249
- bullets.append(line)
250
- elif getattr(shape, "has_table", False):
251
- for row in shape.table.rows:
252
- cells = [c.text.strip().replace("\n", " ") for c in row.cells if c.text.strip()]
253
- if cells:
 
 
 
 
 
 
 
 
 
 
 
 
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
- doc = Document(str(docx_path))
 
 
 
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 parse_markdown_to_spec(md_path: Path) -> dict[str, Any]:
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 = md_path.stem
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 == md_path.stem:
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
- return json.loads(input_path.read_text(encoding="utf-8"))
 
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.0: Convert PPTX / DOCX / Markdown / HTML into code-rendered HTML + SFX MP4 videos."
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.demo or not args.input:
175
- sample_pptx = samples_dir / "sample_ai_sync_lecture.pptx"
176
- print(f"[1/5] Generating sample PowerPoint deck: {sample_pptx}")
177
- create_sample_pptx(sample_pptx)
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
- proj_slug = slugify(args.project_name or input_path.stem)
186
- project_dir = PIPELINE_DIR / "projects" / proj_slug
187
- ensure_project_scaffold(project_dir, proj_slug, offline=use_offline)
188
-
189
- print(f"[2/5] Parsing '{input_path.name}' ({input_path.suffix.lower()}) into motion scene archetypes...")
190
- spec = load_input_to_spec(input_path)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.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