@guanghechen/kit-video 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -11
- package/lib/esm/cli.mjs +1 -1
- package/lib/esm/command-DM6c375A.mjs +1 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.mjs +1 -1
- package/package.json +3 -3
- package/lib/esm/command-BBJNCMLk.mjs +0 -1
package/README.md
CHANGED
|
@@ -23,7 +23,9 @@ kit-video autogen -s /path/to/scenario -o /path/to/output --video --pdf --pptx
|
|
|
23
23
|
kit-video autogen -s /path/to/scenario --dry-run
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
Note:
|
|
26
|
+
Note:
|
|
27
|
+
- `preference` / `outline` / `transcript` stages currently validate existing files in workspace. They do not generate these files automatically.
|
|
28
|
+
- `autogen` requires scenario to contain `material.md` or `material/`.
|
|
27
29
|
|
|
28
30
|
### Individual Commands
|
|
29
31
|
|
|
@@ -72,7 +74,7 @@ The video generation pipeline consists of the following stages:
|
|
|
72
74
|
| `preference` | Validate existing presentation preferences | `preference.json` |
|
|
73
75
|
| `outline` | Validate existing slide outline | `outline.json` |
|
|
74
76
|
| `transcript` | Validate existing transcript for slides | `transcript.md` |
|
|
75
|
-
| `image` | Generate slide images | `img/
|
|
77
|
+
| `image` | Generate slide images | `img/slide_001.png` |
|
|
76
78
|
| `ocr` | Extract text from slide images | `ocr_data.json` |
|
|
77
79
|
| `pdf` | Generate PDF from images (full edition) | `presentation.pdf` |
|
|
78
80
|
| `pptx` | Generate PPTX from images (full edition) | `presentation.pptx` |
|
|
@@ -85,7 +87,7 @@ The video generation pipeline consists of the following stages:
|
|
|
85
87
|
```
|
|
86
88
|
scenario/
|
|
87
89
|
├── query.md # Topic/query for generation
|
|
88
|
-
├── material/ # (
|
|
90
|
+
├── material/ # (Alternative to material.md) Reference materials
|
|
89
91
|
│ ├── doc1.pdf
|
|
90
92
|
│ └── ...
|
|
91
93
|
├── preference.json # (Optional) Pre-defined preferences
|
|
@@ -93,6 +95,8 @@ scenario/
|
|
|
93
95
|
└── transcript.md # (Optional) Pre-generated transcript
|
|
94
96
|
```
|
|
95
97
|
|
|
98
|
+
`material.md` or `material/` is required for `prepare` / `autogen`.
|
|
99
|
+
|
|
96
100
|
## Workspace Structure
|
|
97
101
|
|
|
98
102
|
After running the pipeline, the workspace will contain:
|
|
@@ -106,8 +110,8 @@ workspace/
|
|
|
106
110
|
├── outline.json # Slide outline
|
|
107
111
|
├── transcript.md # Narration transcript
|
|
108
112
|
├── img/ # Generated images
|
|
109
|
-
│ ├──
|
|
110
|
-
│ ├──
|
|
113
|
+
│ ├── slide_001.png
|
|
114
|
+
│ ├── slide_002.png
|
|
111
115
|
│ └── ...
|
|
112
116
|
├── ocr_data.json # OCR results
|
|
113
117
|
├── voice.mp3 # TTS audio
|
|
@@ -137,9 +141,9 @@ workspace/
|
|
|
137
141
|
| `--tts-source` | string | speech | TTS source (speech/llmapi) |
|
|
138
142
|
| `--speech-voice` | string | - | Azure Speech voice name |
|
|
139
143
|
| `--transition` | string | wipeleft | Transition effect |
|
|
140
|
-
| `--transition-duration` |
|
|
141
|
-
| `--stage-image-parallel` |
|
|
142
|
-
| `--stage-ocr-parallel` |
|
|
144
|
+
| `--transition-duration` | number | 0.8 | Transition duration in seconds |
|
|
145
|
+
| `--stage-image-parallel` | number | 1 | Image stage parallelism |
|
|
146
|
+
| `--stage-ocr-parallel` | number | 2 | OCR stage parallelism |
|
|
143
147
|
| `--srt` | boolean | false | Generate and burn subtitles |
|
|
144
148
|
| `--stt` | boolean | false | Enable STT for precise timing |
|
|
145
149
|
| `--query` | string | - | Inline query text |
|
|
@@ -154,8 +158,8 @@ workspace/
|
|
|
154
158
|
| `-w, --workspace-dir` | | string | required | Workspace directory |
|
|
155
159
|
| `--srt` | | boolean | false | Burn subtitles into video |
|
|
156
160
|
| `--transition` | | string | wipeleft | Transition type between slides |
|
|
157
|
-
| `--transition-duration` | |
|
|
158
|
-
| `--force` | | boolean | false |
|
|
161
|
+
| `--transition-duration` | | number | 0.8 | Transition duration in seconds |
|
|
162
|
+
| `--force` | | boolean | false | Reserved; currently no extra effect |
|
|
159
163
|
|
|
160
164
|
## Transition Types
|
|
161
165
|
|
|
@@ -168,7 +172,19 @@ Supported transition types:
|
|
|
168
172
|
- `circleopen`, `circleclose`
|
|
169
173
|
- `dissolve`, `pixelize`, `radial`
|
|
170
174
|
|
|
175
|
+
## Environment Resolution
|
|
176
|
+
|
|
177
|
+
`kit-video` runtime env chain:
|
|
178
|
+
|
|
179
|
+
1. CLI entry preloads missing keys from `<config-root>/.env.local` into `process.env` via `src/env.ts`.
|
|
180
|
+
2. CLI entry passes `process.env` into `command.run({ envs })`.
|
|
181
|
+
3. commander merges user env with preset env (`<preset-root>/.env.local`).
|
|
182
|
+
4. CLI actions (including `checkhealth`) consume effective `ctx.envs`.
|
|
183
|
+
|
|
184
|
+
For duplicated keys, preset env overrides user env.
|
|
185
|
+
|
|
171
186
|
## Requirements
|
|
172
187
|
|
|
173
|
-
- Node.js >=
|
|
188
|
+
- Node.js >= 20.0.0
|
|
174
189
|
- ffmpeg and ffprobe (must be installed and available in PATH)
|
|
190
|
+
- ImageMagick `magick` command (required when using `pdf` stage)
|
package/lib/esm/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(function(
|
|
2
|
+
(function(_0x1f9ccc,_0x1767b6){const _0x3563ee={_0x45d189:0x318,_0x3c4715:0x310,_0x40eb1f:'!5gV',_0x103e85:0x326,_0x52bae4:0x31c,_0x1ebfb9:'$R2y',_0x2d5832:0x32d,_0x3b8c60:0x31f,_0x3536b7:0x32c,_0x4e9c96:0xd6,_0x492b62:0x33a,_0x318f42:0x337,_0x1aa339:0x346,_0x1b5579:0x321,_0x323066:'PZAD',_0x305f8e:0x310,_0x3f0973:0x311,_0x1a2dd0:0x342,_0x259dfe:0x356,_0x10822d:0x324,_0x3a4ffc:0x31b,_0x5f48d9:0x336,_0x587c14:0xd7,_0x5260f5:0xd5,_0x21a794:0xae,_0x51908d:0xc4,_0x54d9e5:0xb9,_0x20eb0f:0xa8},_0x4aff82={_0x4fb512:0x287},_0x1fe058={_0x2c6f60:0x1c};function _0x34b782(_0x5cbc41,_0x559ec8,_0x4cb5ff,_0x4761d4){return _0x321d(_0x4cb5ff-_0x1fe058._0x2c6f60,_0x4761d4);}const _0x266c58=_0x1f9ccc();function _0x173be6(_0x527ecf,_0x55089e,_0x281c06,_0x3c61c8){return _0x321d(_0x527ecf-_0x4aff82._0x4fb512,_0x281c06);}while(!![]){try{const _0x2c7321=parseInt(_0x173be6(_0x3563ee._0x45d189,_0x3563ee._0x3c4715,_0x3563ee._0x40eb1f,_0x3563ee._0x103e85))/(0x23*-0xf1+-0x2d9+0x23cd)*(parseInt(_0x173be6(0x322,_0x3563ee._0x52bae4,_0x3563ee._0x1ebfb9,_0x3563ee._0x2d5832))/(0x1007+-0x4a7+0x123*-0xa))+-parseInt(_0x173be6(0x313,_0x3563ee._0x3b8c60,'W(wQ',_0x3563ee._0x3536b7))/(-0x78*0x4f+0x17ca+0xd41)*(-parseInt(_0x34b782(0xdd,0xbd,_0x3563ee._0x4e9c96,'P#De'))/(-0x2*-0xcf+0x5d1*-0x4+0x2*0xad5))+parseInt(_0x173be6(_0x3563ee._0x492b62,_0x3563ee._0x318f42,'XINp',_0x3563ee._0x1aa339))/(-0x2237+-0x1*-0xf07+0x1335)*(parseInt(_0x173be6(_0x3563ee._0x3b8c60,_0x3563ee._0x1b5579,_0x3563ee._0x323066,0x30d))/(0x2396+0x1f89+-0x1*0x4319))+parseInt(_0x173be6(_0x3563ee._0x305f8e,_0x3563ee._0x3f0973,'PZAD',0x2f6))/(-0x5*-0x7cf+0x115f+0x5*-0xb47)*(-parseInt(_0x173be6(_0x3563ee._0x1a2dd0,_0x3563ee._0x259dfe,'69Xr',0x35e))/(-0x202d+-0x1c*0x108+0x3d15))+-parseInt(_0x173be6(_0x3563ee._0x10822d,_0x3563ee._0x3a4ffc,'ow(D',_0x3563ee._0x5f48d9))/(0x145a+0xf*0xcf+-0x1039*0x2)+-parseInt(_0x34b782(_0x3563ee._0x587c14,0xe7,_0x3563ee._0x5260f5,'AT6t'))/(-0x1c9d+-0x463+0x210a)*(-parseInt(_0x34b782(_0x3563ee._0x21a794,_0x3563ee._0x51908d,0xca,'punJ'))/(0xd99*-0x2+0x40*-0x75+0x1*0x387d))+parseInt(_0x34b782(_0x3563ee._0x54d9e5,_0x3563ee._0x20eb0f,0xb5,_0x3563ee._0x323066))/(-0x2*0xa57+-0x7*0x213+0x233f)*(-parseInt(_0x173be6(_0x3563ee._0x103e85,_0x3563ee._0x103e85,'P#De',0x31e))/(0x1749*0x1+0x1a47+-0x1fb*0x19));if(_0x2c7321===_0x1767b6)break;else _0x266c58['push'](_0x266c58['shift']());}catch(_0x3690df){_0x266c58['push'](_0x266c58['shift']());}}}(_0x121c,0x6eaef*0x1+0x51367*0x1+-0x80e42));import{C as _0x1c551a,V as _0x22d4b4}from'./command-DM6c375A.mjs';import{CompletionCommand}from'@guanghechen/commander/node';import{Reporter}from'@guanghechen/reporter';import'node:module';import'node:path';function _0x121c(){const _0x2d350c=['k8oXz2jB','omoYd8k5qW','WQCgW5ZdSgG','W43cRSkbW7lcUvxcTComWRLVdsm','FCo1lCkKW58','uSkQeSoGW70','W4aUgfxdTa','W7/dLeLbW5a','WRPgWP/dO2S','itazW6JcKvpcT8otWQNdUuK','WObRtWpcOZlcQNLzWOlcOq','WOjTtGldQbZcQ197WO0','cwdcHfJcMa','WRtdSmk9WPmkWPTT','zMJdL8oUjW','pSkJEmo5WPRdN1VcSSoZWOWuW7ddUW','e2/cVSo6lIKEW70dWO1ytau','Eq/cK8oZgghdQw4DWQ7cRG','WOZcTqlcHmkL','kvBdH8k0rG','ytxdTqpcLq','xSoYW4tcLW','W4ZdGCkIt0O','WPtdQ35Ejq','kmkTrCo2W7u','WOjOqWFcRIxcPuf1WQJcIG','rSkDWOzkwq','lmkLrCo2','x8kqW6i','WRRdPuClW6e','W4RdJvdcRCkq','oKVdJ8kIqW','sdldIqhdNSo/tSkuA8oZWQS','WOJdU3O','ESk8pM9lWRfeW4/dVG','aSkpW6pcGYK','WOOTWPbGkw8btSoFW7q','egpcUSkky3DiW4uI','FZldQaZdIq','BCo2rmo8WQW','WO/cNHBdISkwW4fxv8kweG','W45bxXr8','W47cJsyvW7yzWRHpWQaAumo1','uSo4WR7cHCkRjwpdI8oo','EWJcMmoWzhRdPwCFWP4','iZirW6ZcLYVdOCoKWOJdK2FdQae','WRtcLJ3dVN9fpa','a8k5W6FcK8kw','m0W6W4G','EWRcMmoWhb/cVK0rWP7cKmoKWR0','WOZcKbFcVCkCW6zEDCkM','h2JcG1G','WPpcPSoyca','WOq5p1pdSZBcVa','W67dRYldHa','lmoQyxT1','r3XzW4VdH0tcQKLgW7S','WO/cQbddT8o6'];_0x121c=function(){return _0x2d350c;};return _0x121c();}function _0x321d(_0x33125d,_0x38187e){_0x33125d=_0x33125d-(0x7e4+0xa*0x377+-0x2a05);const _0x5ee201=_0x121c();let _0x4207c4=_0x5ee201[_0x33125d];if(_0x321d['KBQtkp']===undefined){var _0x2b2195=function(_0x562de3){const _0x737329='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2c126d='',_0x5a5bf2='';for(let _0x26379f=0x23d0+-0x103d+-0x1393,_0x5f5700,_0x44e47c,_0x462df5=0x1294+-0xc3*0x2b+0xe2d;_0x44e47c=_0x562de3['charAt'](_0x462df5++);~_0x44e47c&&(_0x5f5700=_0x26379f%(-0x1*-0x327+-0x3*-0xbb3+-0x263c*0x1)?_0x5f5700*(-0x226c+0x6f*-0x4a+0x42c2)+_0x44e47c:_0x44e47c,_0x26379f++%(0xb7a*0x3+-0x1*0x2005+-0x265))?_0x2c126d+=String['fromCharCode'](0x2*0x10f2+0x176c+-0x3851&_0x5f5700>>(-(0x3a*-0x46+-0xa89+0x1a67)*_0x26379f&0x107*0x21+-0x4*0x656+-0x889)):0x44f*0x1+0x1786+0x19*-0x11d){_0x44e47c=_0x737329['indexOf'](_0x44e47c);}for(let _0x1eb40a=0x1188+-0xa*-0x66+0x12*-0x132,_0x2c0d83=_0x2c126d['length'];_0x1eb40a<_0x2c0d83;_0x1eb40a++){_0x5a5bf2+='%'+('00'+_0x2c126d['charCodeAt'](_0x1eb40a)['toString'](0xd31+0x208c+-0x2dad))['slice'](-(-0x18a7*0x1+0x38b*0x2+-0x1193*-0x1));}return decodeURIComponent(_0x5a5bf2);};const _0x5b1f9c=function(_0x3cd761,_0x478170){let _0x86af99=[],_0xc72513=0x13a1+-0x18d1*-0x1+0x2c72*-0x1,_0x2ef006,_0x5e6d15='';_0x3cd761=_0x2b2195(_0x3cd761);let _0x211fa6;for(_0x211fa6=-0x24f8+0x2*0xde4+0x930;_0x211fa6<-0x42b*0x6+-0x1279+0x2c7b;_0x211fa6++){_0x86af99[_0x211fa6]=_0x211fa6;}for(_0x211fa6=0x18bd+-0x9ba+-0xf03;_0x211fa6<0x611+-0x1fb2+0x1aa1;_0x211fa6++){_0xc72513=(_0xc72513+_0x86af99[_0x211fa6]+_0x478170['charCodeAt'](_0x211fa6%_0x478170['length']))%(0x6da*-0x3+-0x53*-0x20+0xb2e),_0x2ef006=_0x86af99[_0x211fa6],_0x86af99[_0x211fa6]=_0x86af99[_0xc72513],_0x86af99[_0xc72513]=_0x2ef006;}_0x211fa6=0x1*-0x188a+-0x1*-0x1e2d+0x1*-0x5a3,_0xc72513=-0x1f2c+0xc0d+0x131f;for(let _0x164f07=0x2*-0xd79+0x23c3+-0x3d*0x25;_0x164f07<_0x3cd761['length'];_0x164f07++){_0x211fa6=(_0x211fa6+(-0x54e+-0x7*-0x493+-0xd5b*0x2))%(-0x1ffa+-0xc0+0x6*0x59f),_0xc72513=(_0xc72513+_0x86af99[_0x211fa6])%(-0x1*0xd0d+-0x850+0x165d),_0x2ef006=_0x86af99[_0x211fa6],_0x86af99[_0x211fa6]=_0x86af99[_0xc72513],_0x86af99[_0xc72513]=_0x2ef006,_0x5e6d15+=String['fromCharCode'](_0x3cd761['charCodeAt'](_0x164f07)^_0x86af99[(_0x86af99[_0x211fa6]+_0x86af99[_0xc72513])%(0x247d+0x1*0x195d+-0x3cda)]);}return _0x5e6d15;};_0x321d['jBZixf']=_0x5b1f9c,_0x321d['gzPevL']={},_0x321d['KBQtkp']=!![];}const _0x4237f3=_0x5ee201[-0x18e*0x16+-0x1*0x12eb+0x5e7*0x9],_0x2cdda7=_0x33125d+_0x4237f3,_0x19b386=_0x321d['gzPevL'][_0x2cdda7];return!_0x19b386?(_0x321d['UpLvpM']===undefined&&(_0x321d['UpLvpM']=!![]),_0x4207c4=_0x321d['jBZixf'](_0x4207c4,_0x38187e),_0x321d['gzPevL'][_0x2cdda7]=_0x4207c4):_0x4207c4=_0x19b386,_0x4207c4;}import'@guanghechen/string';import'node:fs';import'@guanghechen/env';import'node:os';import'node:crypto';import'node:child_process';const _0x3631b7={};_0x3631b7[_0x4f7fd4(0x6b,0x6d,'P#De',0x56)+'x']=_0x1c551a;const _0x46d2f4=new Reporter(_0x3631b7),_0x1df936=new _0x22d4b4();_0x1df936[_0x4f7fd4(0x69,0x52,'ow(D',0x40)+_0x1d038e(-0x16f,-0x178,'U5ov',-0x189)+_0x4f7fd4(0x40,0x4b,'EGwk',0x65)+_0x1d038e(-0x1a0,-0x19c,'z3(k',-0x1a9)]();const _0x144d5b={};_0x144d5b['progr'+_0x1d038e(-0x15f,-0x16f,'G(BO',-0x184)+'e']=_0x1c551a;function _0x4f7fd4(_0x39bc5d,_0x3bf8b7,_0x312ccf,_0x383bcb){return _0x321d(_0x3bf8b7- -0x40,_0x312ccf);}_0x144d5b[_0x4f7fd4(0x7f,0x74,'z1ZQ',0x8a)]={},_0x144d5b[_0x4f7fd4(0x7f,0x74,'z1ZQ',0x8a)][_0x1d038e(-0x180,-0x17b,'h6th',-0x197)]=_0x4f7fd4(0x36,0x50,'xQ)1',0x4d)+_0x1d038e(-0x168,-0x182,'z1ZQ',-0x18c)+_0x1d038e(-0x197,-0x17c,'Ads3',-0x184)+_0x4f7fd4(0x5e,0x4f,'jpJR',0x4a)+_0x1d038e(-0x191,-0x197,'HbP0',-0x182)+'s/'+_0x1c551a+_0x1d038e(-0x18d,-0x17a,'C[Ll',-0x166),_0x144d5b[_0x4f7fd4(0x7f,0x74,'z1ZQ',0x8a)][_0x1d038e(-0x184,-0x19d,'punJ',-0x1b3)]='~/.co'+_0x4f7fd4(0x7e,0x6b,'LApA',0x70)+_0x4f7fd4(0x51,0x66,'h6th',0x72)+_0x1d038e(-0x167,-0x183,'P#De',-0x180)+'etion'+'s/'+_0x1c551a+'.fish',_0x144d5b[_0x4f7fd4(0x7f,0x74,'z1ZQ',0x8a)][_0x1d038e(-0x191,-0x181,'$77H',-0x165)]='~/.co'+_0x4f7fd4(0x83,0x77,'JG@R',0x86)+_0x1d038e(-0x16b,-0x184,'&(v8',-0x182)+_0x1d038e(-0x195,-0x18e,'xQ)1',-0x197)+_0x4f7fd4(0x79,0x7d,'AT6t',0x74)+'s/'+_0x1c551a+_0x4f7fd4(0x94,0x7e,'m166',0x9a),_0x1df936[_0x1d038e(-0x19f,-0x190,'PZAD',-0x17d)+_0x1d038e(-0x180,-0x18f,'WtS1',-0x17f)]('compl'+_0x4f7fd4(0x3a,0x53,'z)kR',0x6b),new CompletionCommand(_0x1df936,_0x144d5b));function _0x1d038e(_0x4f4682,_0x58a3e4,_0x693089,_0x474116){const _0x30c50e={_0x45347e:0x224};return _0x321d(_0x58a3e4- -_0x30c50e._0x45347e,_0x693089);}try{await _0x1df936['run']({'argv':process[_0x4f7fd4(0x5c,0x4a,'I80U',0x45)][_0x4f7fd4(0x80,0x71,'C[Ll',0x7e)](-0x1f1e+0xb7a*0x3+-0x1*0x34e),'envs':process.env,'reporter':_0x46d2f4});}catch(_0x5911b5){_0x46d2f4[_0x4f7fd4(0x47,0x64,'Nv#C',0x49)](_0x5911b5 instanceof Error?_0x5911b5[_0x1d038e(-0x16f,-0x17f,'!LeW',-0x179)]??_0x5911b5[_0x4f7fd4(0x78,0x5c,']UhL',0x58)+'ge']:String(_0x5911b5)),process[_0x4f7fd4(0x4d,0x4e,'EGwk',0x6a)+_0x4f7fd4(0x7e,0x6f,'!LeW',0x54)]=0x2*-0x1181+-0xf1*-0x24+0x11f;}
|