@guanghechen/kit-video 0.4.0 → 0.5.1
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-DEMuYjQ6.mjs +1 -0
- package/lib/esm/index.d.ts +2 -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(_0x5b9641,_0x3b05d5){const _0x1091e5={_0x5f0c15:0xa,_0x4bdbcc:'l5Mj',_0x387d0d:0xb,_0x3299f7:'rUBu',_0xf31561:0x7,_0x16dd09:0x19,_0x1f9040:'Ke)T',_0x4ff95d:0x438,_0x2e7a79:0x44b,_0x28a2c3:0x426,_0x319fc1:0x442,_0x307e4a:0x41b,_0xc74b54:'7NjF',_0x107857:0x5,_0x195053:0x13,_0x2d770f:'&Hbu',_0x6ace66:0x409,_0x43e58d:'XI]I',_0x4a73fd:0x34,_0x274720:0x5,_0x3a56bd:0x43e,_0x156001:0x439,_0x5c6b3c:'8Ghj'},_0x21f84b={_0x7ee752:0xc6},_0x296e2b={_0x5de930:0x368};function _0x47cdcc(_0x5964f1,_0x1ba5e8,_0x357e0c,_0x5aa8e5){return _0x33d3(_0x5964f1-_0x296e2b._0x5de930,_0x5aa8e5);}const _0x4d92b2=_0x5b9641();function _0x4ee65d(_0x6fb41f,_0x2ae775,_0x108ce8,_0x15bd60){return _0x33d3(_0x6fb41f- -_0x21f84b._0x7ee752,_0x15bd60);}while(!![]){try{const _0x2ea6df=-parseInt(_0x4ee65d(-0x9,-0x23,_0x1091e5._0x5f0c15,_0x1091e5._0x4bdbcc))/(-0x15ee+-0x24f1+0x3ae0)+parseInt(_0x4ee65d(_0x1091e5._0x387d0d,0x14,0xf,_0x1091e5._0x3299f7))/(-0x1*0x8bd+-0x134e+0x1c0d)*(parseInt(_0x4ee65d(_0x1091e5._0xf31561,_0x1091e5._0x16dd09,0xe,_0x1091e5._0x1f9040))/(0xe36+0x20f8+-0x4b*0xa1))+parseInt(_0x47cdcc(_0x1091e5._0x4ff95d,_0x1091e5._0x2e7a79,_0x1091e5._0x28a2c3,'OnLE'))/(0x163*0xd+0x45*-0x1+-0x11be)+-parseInt(_0x47cdcc(0x42e,_0x1091e5._0x319fc1,_0x1091e5._0x307e4a,_0x1091e5._0xc74b54))/(0x91a+0xd4c+0x11*-0x151)*(parseInt(_0x4ee65d(0x1,-_0x1091e5._0x107857,_0x1091e5._0x195053,_0x1091e5._0x2d770f))/(-0x419*0x4+0x21b5*0x1+-0x114b))+parseInt(_0x4ee65d(-_0x1091e5._0xf31561,0x1,-0x1,'jB]&'))/(0x416+0x2422+-0x2831)+-parseInt(_0x47cdcc(0x421,0x40d,_0x1091e5._0x6ace66,'qlg!'))/(-0x1369+0x1359+0x18)*(parseInt(_0x4ee65d(-0x1a,-_0x1091e5._0x107857,-0x32,_0x1091e5._0x43e58d))/(-0x1*-0x737+0x36*-0xa3+0x1b34))+parseInt(_0x4ee65d(-0x1d,-_0x1091e5._0x4a73fd,-_0x1091e5._0x274720,'XI]I'))/(-0x37a*-0xb+-0x3d8*-0x8+-0x44f4)*(parseInt(_0x47cdcc(_0x1091e5._0x3a56bd,_0x1091e5._0x3a56bd,_0x1091e5._0x156001,_0x1091e5._0x5c6b3c))/(0x2678+0xf1d+-0x358a));if(_0x2ea6df===_0x3b05d5)break;else _0x4d92b2['push'](_0x4d92b2['shift']());}catch(_0x41b263){_0x4d92b2['push'](_0x4d92b2['shift']());}}}(_0x4b6e,-0xee74d+0x8f219+-0xb*-0x166f9));import{C as _0x3e9ae0,V as _0x362d68}from'./command-DEMuYjQ6.mjs';import{CompletionCommand}from'@guanghechen/commander/node';import{Reporter}from'@guanghechen/reporter';import'node:fs';import'node:path';function _0x53e640(_0x553274,_0x5d4b01,_0x422f12,_0x5c009e){const _0x5f446d={_0x425117:0x350};return _0x33d3(_0x5c009e- -_0x5f446d._0x425117,_0x422f12);}import'@guanghechen/string';function _0x4b6e(){const _0x36b470=['WRJdTSoiiha','W6RdH8ktW4RcRa','WQFdG8kgwZq','W7VcNCoS','axpcUNCO','cKmtnmoS','eh7cHaBcN8ksW7/dO8kwva','W4RdUCoOjCoPvZStWRddUG','zSkuW7ZdRCon','WRrun8kv','nqZcHcdcLW','WQqHW5BdVCoY','WQFcIrtcPCom','W60pWQVcO8k9bSoM','WQDEEd/cRG','WP4jWQnY','W7PtW4jnWO87cSo2WRFcJSoJWOiy','W7ldT2ddMCkWzSkNaJq1xb4','WO/cTSkIDCkE','A8kKg8kkWOi','WQi6W5ldOSoW','cbBcOIFdNW','W6ZcTCotpviPW75s','W6HtWQtcPmk0','WRRcTdZcImoQ','vYJdLL/cIG','j8kJaCkr','W7JdTd8LWR/dVqFdKfddSCo4la','W47cJYVcKgNdRdpcK8k/WP/dRMJdRbS','g1ZdVZFdKq','lrBdKYNcQa','W4ZcIIZdKrVcSvpdRSkR','WOqRW47dK8obW4/dMCk4WR9sWQ/dSa','WQfxlCksWOC','dCkxoCo4W4a','FbpcQ8k/ma','WQNdQSk2xSkz','WRiiWR/cNCoA','WQNcQ8olW5ddS8kCoSkD','F8kSdSkE','W7SjWQpcVeC','n8k2fq','W6DwoSkNggPRs2fXWPRcTh9j','WQPxFcJdRq','WRSmW5RdSmoRqSoUo8oEl8o3xW','BX3cSSkNlW','W6ldRSkSaa','CSkdomoUlq','wCoxu8kLWPZcQJBcUqOHW4pdUq','WOWMW4FdKSocW4ldLCkjWOPvWR3dLa','bmoYW77cLZtcVmoajKldHYm9'];_0x4b6e=function(){return _0x36b470;};return _0x4b6e();}import'@guanghechen/env';import'node:os';import'node:crypto';import'node:child_process';const _0x128f6a={};_0x128f6a[_0x3b6147(0x213,0x220,0x218,'rUBu')+'x']=_0x3e9ae0;const _0x657806=new Reporter(_0x128f6a);_0x362d68['ensur'+'ePres'+_0x3b6147(0x234,0x22a,0x23c,'l5Mj')+'t']();function _0x33d3(_0x17ff70,_0x474db4){_0x17ff70=_0x17ff70-(0x1*0x1fa7+-0x1087*-0x2+-0x4011);const _0x2448c6=_0x4b6e();let _0xb56f81=_0x2448c6[_0x17ff70];if(_0x33d3['lTTTPg']===undefined){var _0x27a806=function(_0x385e17){const _0x44de90='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2b2302='',_0x5e5d4b='';for(let _0x5538bb=-0xb3b*-0x1+0xfce*-0x2+0x1461,_0x4ed8b1,_0xd913d8,_0x33a63e=0x1b4+0x3*-0x516+0x2*0x6c7;_0xd913d8=_0x385e17['charAt'](_0x33a63e++);~_0xd913d8&&(_0x4ed8b1=_0x5538bb%(0x2b2+0x245b+-0x3*0xd03)?_0x4ed8b1*(-0x703*-0x3+-0x1dfc+-0x9d*-0xf)+_0xd913d8:_0xd913d8,_0x5538bb++%(0x17ac+0x158*-0x18+0x113*0x8))?_0x2b2302+=String['fromCharCode'](0xa79+0x1*-0x1d5d+0x13e3&_0x4ed8b1>>(-(0x10*-0x21e+-0x5*-0x5f0+0x3*0x166)*_0x5538bb&-0x211d+0x475+0xe57*0x2)):-0x133a+0xdc1+-0x579*-0x1){_0xd913d8=_0x44de90['indexOf'](_0xd913d8);}for(let _0x8b490d=-0x59*-0x10+0x21f1+-0x2781,_0x242da0=_0x2b2302['length'];_0x8b490d<_0x242da0;_0x8b490d++){_0x5e5d4b+='%'+('00'+_0x2b2302['charCodeAt'](_0x8b490d)['toString'](-0x2c7*0xc+0x1*-0xd55+0x2eb9))['slice'](-(0x211e+0x11*-0x11c+-0x1c8*0x8));}return decodeURIComponent(_0x5e5d4b);};const _0x247a4f=function(_0x5ea464,_0x4221ed){let _0x106940=[],_0x10a96d=-0xbab*-0x1+-0x96*0x1e+0x5e9,_0xcd6ce3,_0xa2878d='';_0x5ea464=_0x27a806(_0x5ea464);let _0x463739;for(_0x463739=0xc*0x7+-0x599+-0x13*-0x47;_0x463739<-0x88+-0xd4+0x25c*0x1;_0x463739++){_0x106940[_0x463739]=_0x463739;}for(_0x463739=0x1c45+-0x53*0x52+0x1af*-0x1;_0x463739<-0x1*-0x1143+-0xeb*0x24+0x1*0x10c9;_0x463739++){_0x10a96d=(_0x10a96d+_0x106940[_0x463739]+_0x4221ed['charCodeAt'](_0x463739%_0x4221ed['length']))%(-0x7c*-0x13+0xe19*0x2+-0x2466),_0xcd6ce3=_0x106940[_0x463739],_0x106940[_0x463739]=_0x106940[_0x10a96d],_0x106940[_0x10a96d]=_0xcd6ce3;}_0x463739=-0x223*0xc+-0xcae+0x2652,_0x10a96d=-0x15ee+-0x24f1+0x3adf;for(let _0x2f0f48=-0x1*0x8bd+-0x134e+0x1c0b;_0x2f0f48<_0x5ea464['length'];_0x2f0f48++){_0x463739=(_0x463739+(0xe36+0x20f8+-0xd*0x3a1))%(0x163*0xd+0x45*-0x1+-0x10c2),_0x10a96d=(_0x10a96d+_0x106940[_0x463739])%(0x91a+0xd4c+0x16*-0xf9),_0xcd6ce3=_0x106940[_0x463739],_0x106940[_0x463739]=_0x106940[_0x10a96d],_0x106940[_0x10a96d]=_0xcd6ce3,_0xa2878d+=String['fromCharCode'](_0x5ea464['charCodeAt'](_0x2f0f48)^_0x106940[(_0x106940[_0x463739]+_0x106940[_0x10a96d])%(-0x419*0x4+0x21b5*0x1+-0x1051)]);}return _0xa2878d;};_0x33d3['uMZQBw']=_0x247a4f,_0x33d3['GCslSX']={},_0x33d3['lTTTPg']=!![];}const _0x387e25=_0x2448c6[0x416+0x2422+-0x2838],_0x5b9c79=_0x17ff70+_0x387e25,_0x47feaa=_0x33d3['GCslSX'][_0x5b9c79];return!_0x47feaa?(_0x33d3['kfQhvY']===undefined&&(_0x33d3['kfQhvY']=!![]),_0xb56f81=_0x33d3['uMZQBw'](_0xb56f81,_0x474db4),_0x33d3['GCslSX'][_0x5b9c79]=_0xb56f81):_0xb56f81=_0x47feaa,_0xb56f81;}const _0x53ec54=new _0x362d68();_0x53ec54[_0x53e640(-0x29b,-0x2b7,'7NjF',-0x2aa)+'terSu'+_0x3b6147(0x246,0x23d,0x23b,'VBT(')+'ands']();const _0x5dbe87={};_0x5dbe87[_0x3b6147(0x251,0x23c,0x24e,'2O^H')+_0x53e640(-0x2c5,-0x2bd,'qlg!',-0x2ac)+'e']=_0x3e9ae0,_0x5dbe87[_0x53e640(-0x2a2,-0x29a,'WbP#',-0x296)]={},_0x5dbe87[_0x53e640(-0x2a2,-0x29a,'WbP#',-0x296)][_0x53e640(-0x2b7,-0x2a3,'emVw',-0x2a9)]=_0x3b6147(0x239,0x250,0x25a,'24S3')+_0x53e640(-0x2b4,-0x28a,'4MiW',-0x29b)+'bash/'+_0x3b6147(0x230,0x245,0x23d,'Y7[j')+_0x53e640(-0x2ab,-0x2b1,'Q&(7',-0x2a2)+'s/'+_0x3e9ae0+_0x53e640(-0x2a7,-0x2aa,'Mrj*',-0x29a),_0x5dbe87[_0x53e640(-0x2a2,-0x29a,'WbP#',-0x296)][_0x3b6147(0x230,0x22f,0x218,'Mrj*')]='~/.co'+_0x3b6147(0x260,0x249,0x242,'&[tC')+_0x3b6147(0x218,0x22d,0x245,'Ke)T')+_0x3b6147(0x245,0x233,0x23b,'&[tC')+_0x53e640(-0x287,-0x282,'*cSp',-0x27c)+'s/'+_0x3e9ae0+_0x3b6147(0x254,0x24e,0x252,'emVw'),_0x5dbe87[_0x53e640(-0x2a2,-0x29a,'WbP#',-0x296)][_0x53e640(-0x295,-0x294,'Q&(7',-0x287)]='~/.co'+_0x3b6147(0x23c,0x243,0x231,'@&6M')+_0x3b6147(0x264,0x24d,0x25c,'&Hbu')+_0x53e640(-0x2a6,-0x28e,'WbP#',-0x2a0)+_0x3b6147(0x217,0x22c,0x23d,'eeb1')+'s/'+_0x3e9ae0+_0x53e640(-0x2a4,-0x2a2,'eeb1',-0x295);function _0x3b6147(_0x2dd4e7,_0x37203d,_0x3488cb,_0x1b3028){return _0x33d3(_0x37203d-0x17b,_0x1b3028);}_0x53ec54['subco'+_0x3b6147(0x248,0x247,0x23b,'N8sg')](_0x53e640(-0x26f,-0x274,'*cSp',-0x285)+_0x3b6147(0x239,0x237,0x231,'9PMJ'),new CompletionCommand(_0x53ec54,_0x5dbe87));try{await _0x53ec54[_0x53e640(-0x290,-0x28a,'S1o3',-0x28d)]({'argv':process[_0x3b6147(0x263,0x24a,0x24f,'EQ2L')][_0x53e640(-0x289,-0x29c,'Bhbz',-0x28c)](-0x6b*0x4e+-0x1c27*0x1+0x3cc3),'envs':process.env,'reporter':_0x657806});}catch(_0x42239c){_0x657806[_0x3b6147(0x228,0x23b,0x225,'8Ghj')](_0x42239c instanceof Error?_0x42239c[_0x3b6147(0x244,0x240,0x244,'60!*')]??_0x42239c[_0x53e640(-0x28d,-0x290,'24S3',-0x2a6)+'ge']:String(_0x42239c)),process['exitC'+'ode']=0x1ff6*0x1+-0x1bdb*-0x1+-0x3bd0;}
|