@guanghechen/kit-video 0.1.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 ADDED
@@ -0,0 +1,159 @@
1
+ # @guanghechen/kit-skill-video
2
+
3
+ AI-powered video generation from scenario files. This package provides a complete pipeline for generating presentation videos from text scenarios.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @guanghechen/kit-skill-video
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Full Pipeline (autogen)
14
+
15
+ ```bash
16
+ # Generate complete video from scenario
17
+ kit-skill-video autogen -s /path/to/scenario -o /path/to/output --video
18
+
19
+ # With PDF and PPTX export
20
+ kit-skill-video autogen -s /path/to/scenario -o /path/to/output --video --pdf --pptx
21
+
22
+ # Dry run (show what would be executed)
23
+ kit-skill-video autogen -s /path/to/scenario --dry-run
24
+ ```
25
+
26
+ ### Individual Commands
27
+
28
+ ```bash
29
+ # Prepare workspace
30
+ kit-skill-video prepare -s /path/to/scenario -o /path/to/output
31
+
32
+ # Generate preference
33
+ kit-skill-video preference -w /path/to/workspace
34
+
35
+ # Generate outline
36
+ kit-skill-video outline -w /path/to/workspace
37
+
38
+ # Generate transcript
39
+ kit-skill-video transcript -w /path/to/workspace
40
+
41
+ # Generate images
42
+ kit-skill-video image -w /path/to/workspace
43
+
44
+ # Run OCR
45
+ kit-skill-video ocr -w /path/to/workspace
46
+
47
+ # Generate PDF (full edition)
48
+ kit-skill-video pdf -w /path/to/workspace
49
+
50
+ # Generate PPTX (full edition)
51
+ kit-skill-video pptx -w /path/to/workspace
52
+
53
+ # Generate TTS audio
54
+ kit-skill-video tts -w /path/to/workspace
55
+
56
+ # Align TTS with slides
57
+ kit-skill-video tts-align -w /path/to/workspace
58
+
59
+ # Compose video
60
+ kit-skill-video video -w /path/to/workspace --srt --transition fade
61
+ ```
62
+
63
+ ## Pipeline Stages
64
+
65
+ The video generation pipeline consists of the following stages:
66
+
67
+ | Stage | Description | Output |
68
+ | ------------ | ------------------------------------------------ | -------------------------- |
69
+ | `prepare` | Prepare workspace from scenario directory | workspace structure |
70
+ | `preference` | Generate presentation preferences | `preference.json` |
71
+ | `outline` | Generate slide outline | `outline.json` |
72
+ | `transcript` | Generate transcript for slides | `transcript.md` |
73
+ | `image` | Generate slide images | `img/slide_N_V.png` |
74
+ | `ocr` | Extract text from slide images | `ocr_data.json` |
75
+ | `pdf` | Generate PDF from images (full edition) | `presentation.pdf` |
76
+ | `pptx` | Generate PPTX from images (full edition) | `presentation.pptx` |
77
+ | `tts` | Generate TTS audio from transcript | `voice.mp3` |
78
+ | `tts-align` | Align TTS audio with slides | `slide_durations.json` |
79
+ | `video` | Compose final video from images and audio | `video.mp4` |
80
+
81
+ ## Scenario Directory Structure
82
+
83
+ ```
84
+ scenario/
85
+ ├── query.md # Topic/query for generation
86
+ ├── material/ # (Optional) Reference materials
87
+ │ ├── doc1.pdf
88
+ │ └── ...
89
+ └── preference.json # (Optional) Pre-defined preferences
90
+ ```
91
+
92
+ ## Workspace Structure
93
+
94
+ After running the pipeline, the workspace will contain:
95
+
96
+ ```
97
+ workspace/
98
+ ├── preference.json # Presentation preferences
99
+ ├── outline.json # Slide outline
100
+ ├── transcript.md # Narration transcript
101
+ ├── img/ # Generated images
102
+ │ ├── slide_0_1.png
103
+ │ ├── slide_1_1.png
104
+ │ └── ...
105
+ ├── ocr_data.json # OCR results
106
+ ├── voice.mp3 # TTS audio
107
+ ├── slide_durations.json # Timing information
108
+ ├── subtitles.srt # (Optional) Subtitles
109
+ ├── presentation.pdf # (Optional) PDF export
110
+ ├── presentation.pptx # (Optional) PPTX export
111
+ └── video.mp4 # Final video
112
+ ```
113
+
114
+ ## Autogen Options
115
+
116
+ | Option | Type | Default | Description |
117
+ | -------------------------- | ------- | ---------- | ---------------------------------------------- |
118
+ | `-s, --scenario` | string | (required) | Path to scenario directory |
119
+ | `-o, --output` | string | auto | Output directory |
120
+ | `--pdf` | boolean | false | Enable PDF generation |
121
+ | `--pptx` | boolean | false | Enable PPTX generation |
122
+ | `--tts` | boolean | false | Enable TTS voice generation |
123
+ | `--video` | boolean | false | Enable video generation (implies --tts) |
124
+ | `--ocr` | boolean | false | Enable OCR text detection |
125
+ | `--dry-run` | boolean | false | Show what stages would run |
126
+ | `-v, --verbose` | boolean | false | Verbose output |
127
+ | `--transition` | string | wipeleft | Transition effect |
128
+ | `--transition-duration` | string | 0.8 | Transition duration in seconds |
129
+ | `--srt` | boolean | false | Generate and burn subtitles |
130
+ | `--stt` | boolean | false | Enable STT for precise timing |
131
+ | `--force-<stage>` | boolean | false | Force re-run specific stage |
132
+ | `--only-<stage>` | boolean | false | Only run specific stage |
133
+
134
+ ## Video Options
135
+
136
+ | Option | Short | Type | Default | Description |
137
+ | ------------------------ | ----- | ------- | -------- | ---------------------------------- |
138
+ | `-w, --workspace-dir` | | string | required | Workspace directory |
139
+ | `--srt` | | boolean | false | Burn subtitles into video |
140
+ | `--transition` | | string | wipeleft | Transition type between slides |
141
+ | `--transition-duration` | | string | 0.8 | Transition duration in seconds |
142
+ | `--force` | | boolean | false | Force regenerate video |
143
+ | `-v, --verbose` | | boolean | false | Verbose output |
144
+
145
+ ## Transition Types
146
+
147
+ Supported transition types:
148
+
149
+ - `none` - No transition
150
+ - `fade`, `fadeblack`, `fadewhite`
151
+ - `wipeleft`, `wiperight`, `wipeup`, `wipedown`
152
+ - `slideleft`, `slideright`, `slideup`, `slidedown`
153
+ - `circleopen`, `circleclose`
154
+ - `dissolve`, `pixelize`, `radial`
155
+
156
+ ## Requirements
157
+
158
+ - Node.js >= 24.0.0
159
+ - ffmpeg and ffprobe (must be installed and available in PATH)
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ function _0x5a34(_0x516e6f,_0x196da2){_0x516e6f=_0x516e6f-(0x1b41*-0x1+0x1*-0x1ec7+0x3b32);const _0xd958ca=_0x4b7a();let _0x479071=_0xd958ca[_0x516e6f];if(_0x5a34['ujAJaJ']===undefined){var _0x1207c9=function(_0xc81b65){const _0x5b1647='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x40e1f5='',_0x5b157c='';for(let _0x2d16a7=-0x1cfd+-0x179e*0x1+0x349b,_0x2ab407,_0x2a526b,_0x5b7340=0x1325+-0x1aec+-0x1*-0x7c7;_0x2a526b=_0xc81b65['charAt'](_0x5b7340++);~_0x2a526b&&(_0x2ab407=_0x2d16a7%(-0x13e5+-0x7*0xe+-0x144b*-0x1)?_0x2ab407*(-0x812+-0x29*0x79+0x1*0x1bb3)+_0x2a526b:_0x2a526b,_0x2d16a7++%(0x669*-0x3+0x2e5+0x105a))?_0x40e1f5+=String['fromCharCode'](0x103c*0x2+0x2127+-0x40a0&_0x2ab407>>(-(0x1*-0x582+-0x3*0x911+0x20b7)*_0x2d16a7&0xb53*0x1+0x2165+-0x1659*0x2)):-0xb0*0x11+0x1435+-0x3*0x2d7){_0x2a526b=_0x5b1647['indexOf'](_0x2a526b);}for(let _0xdf0477=-0x1f7d+0x1c27*0x1+0x356,_0x12b5fd=_0x40e1f5['length'];_0xdf0477<_0x12b5fd;_0xdf0477++){_0x5b157c+='%'+('00'+_0x40e1f5['charCodeAt'](_0xdf0477)['toString'](0x63f+-0x528*0x5+0x1399))['slice'](-(0x17b*-0x1+-0x3*0xa5e+0xadd*0x3));}return decodeURIComponent(_0x5b157c);};const _0x43071e=function(_0x308a6e,_0xc202b3){let _0x4d4c88=[],_0x42ff81=0xf4*-0x18+-0x119b*-0x2+0xc56*-0x1,_0x25397e,_0x2382cb='';_0x308a6e=_0x1207c9(_0x308a6e);let _0x47e87b;for(_0x47e87b=-0x1b4d+-0x137c+0x2ec9*0x1;_0x47e87b<0xbc6+0x213f+-0x2c05;_0x47e87b++){_0x4d4c88[_0x47e87b]=_0x47e87b;}for(_0x47e87b=0xd8b*0x1+0x1266+-0x1ff1;_0x47e87b<-0x1d*-0x32+-0x243d*-0x1+-0x28e7;_0x47e87b++){_0x42ff81=(_0x42ff81+_0x4d4c88[_0x47e87b]+_0xc202b3['charCodeAt'](_0x47e87b%_0xc202b3['length']))%(-0xf60*0x1+-0x3dc*-0x8+-0xe80),_0x25397e=_0x4d4c88[_0x47e87b],_0x4d4c88[_0x47e87b]=_0x4d4c88[_0x42ff81],_0x4d4c88[_0x42ff81]=_0x25397e;}_0x47e87b=0x61e+0x16*0x1bb+-0x2c30,_0x42ff81=0x496*-0x2+0x17c6+-0xe9a;for(let _0x2e7bd3=0x2*0xe08+-0x1370+-0x8a*0x10;_0x2e7bd3<_0x308a6e['length'];_0x2e7bd3++){_0x47e87b=(_0x47e87b+(-0x16a0+-0x13a+-0x17db*-0x1))%(-0x545*-0x5+-0x1*0x1a3e+0xe5*0x1),_0x42ff81=(_0x42ff81+_0x4d4c88[_0x47e87b])%(0x13cf+0x1d27+-0xe*0x36d),_0x25397e=_0x4d4c88[_0x47e87b],_0x4d4c88[_0x47e87b]=_0x4d4c88[_0x42ff81],_0x4d4c88[_0x42ff81]=_0x25397e,_0x2382cb+=String['fromCharCode'](_0x308a6e['charCodeAt'](_0x2e7bd3)^_0x4d4c88[(_0x4d4c88[_0x47e87b]+_0x4d4c88[_0x42ff81])%(-0xd*-0x33+0x1f5a+-0x20f1)]);}return _0x2382cb;};_0x5a34['CfewcS']=_0x43071e,_0x5a34['wCjDJr']={},_0x5a34['ujAJaJ']=!![];}const _0x52cb55=_0xd958ca[-0x142d+0x92*-0x28+0x2afd],_0x55cedc=_0x516e6f+_0x52cb55,_0x1205ec=_0x5a34['wCjDJr'][_0x55cedc];return!_0x1205ec?(_0x5a34['zVxBCn']===undefined&&(_0x5a34['zVxBCn']=!![]),_0x479071=_0x5a34['CfewcS'](_0x479071,_0x196da2),_0x5a34['wCjDJr'][_0x55cedc]=_0x479071):_0x479071=_0x1205ec,_0x479071;}(function(_0x25397e,_0x2382cb){const _0x2b4cb1={_0x5b23f2:'MyR9',_0x1cab0d:0x1d,_0x3388fe:0x14,_0x1e2d59:0x232,_0x4e33b9:0x239,_0x3618aa:0x11,_0x4be0b8:0x4,_0x5f4bfe:0x24,_0x5f0e8f:0x16,_0x11ec8d:0x2a,_0x466230:0x7,_0xe3c386:0x6,_0x15bdce:0x3,_0x1f4463:0x23b,_0x3a8fb1:'13V@',_0x5756fa:0x233,_0x2819c9:0x246,_0x32bc53:'6C0w',_0x43ddd0:0x24c,_0x47dd6b:0x24c,_0x21b105:0x254,_0x12461d:0x23f,_0x26edde:0x237,_0x3921ca:0x22f,_0x3042f7:'zvjS',_0x473f57:0x218,_0x45ce38:0x23d},_0xa583de={_0x4850d:0x140};function _0x637423(_0x7c396f,_0x528514,_0x15408b,_0x117bea){return _0x5a34(_0x15408b- -_0xa583de._0x4850d,_0x7c396f);}const _0x47e87b=_0x25397e();function _0x224198(_0x2d983b,_0x5de1d3,_0x5c76f2,_0x4abe6d){return _0x5a34(_0x2d983b- -0x389,_0x5de1d3);}while(!![]){try{const _0x2e7bd3=parseInt(_0x637423(_0x2b4cb1._0x5b23f2,_0x2b4cb1._0x1cab0d,_0x2b4cb1._0x3388fe,_0x2b4cb1._0x3388fe))/(0x11c2+0x10*-0x231+-0x114f*-0x1)+parseInt(_0x224198(-_0x2b4cb1._0x1e2d59,'MyR9',-0x23e,-_0x2b4cb1._0x4e33b9))/(-0x248+0x2*0xe08+-0x19c6)*(parseInt(_0x637423('o@!7',-_0x2b4cb1._0x3618aa,-_0x2b4cb1._0x4be0b8,-_0x2b4cb1._0x3618aa))/(0x82d+-0x1b76+0x134c))+parseInt(_0x637423('tgz!',-_0x2b4cb1._0x5f4bfe,-_0x2b4cb1._0x5f0e8f,-_0x2b4cb1._0x11ec8d))/(-0x1d0a+-0x35*-0x1d+-0x7af*-0x3)+-parseInt(_0x637423('ZaOK',-_0x2b4cb1._0x466230,-_0x2b4cb1._0xe3c386,-_0x2b4cb1._0x15bdce))/(0x181*0xe+0x69*-0x9+-0x1158)+-parseInt(_0x224198(-_0x2b4cb1._0x1f4463,_0x2b4cb1._0x3a8fb1,-0x23f,-_0x2b4cb1._0x5756fa))/(-0x10ed+0x24c*0xd+-0x5*0x295)*(-parseInt(_0x224198(-_0x2b4cb1._0x2819c9,_0x2b4cb1._0x32bc53,-0x234,-0x24c))/(-0xe8e+-0xf1b+0x1db0))+-parseInt(_0x224198(-_0x2b4cb1._0x43ddd0,'GCfm',-_0x2b4cb1._0x47dd6b,-_0x2b4cb1._0x21b105))/(0x209f+-0xe*-0x199+-0x36f5)+-parseInt(_0x224198(-0x245,'GCfm',-_0x2b4cb1._0x12461d,-_0x2b4cb1._0x26edde))/(0x4e4*0x4+-0x184d+-0x5e*-0xd)*(parseInt(_0x224198(-_0x2b4cb1._0x3921ca,_0x2b4cb1._0x3042f7,-_0x2b4cb1._0x473f57,-_0x2b4cb1._0x45ce38))/(-0x1*-0x238f+0xe16+-0x319b));if(_0x2e7bd3===_0x2382cb)break;else _0x47e87b['push'](_0x47e87b['shift']());}catch(_0x5b59a3){_0x47e87b['push'](_0x47e87b['shift']());}}}(_0x4b7a,0x130f27+-0x75973*0x2+0x15*0x496a));import{C as _0x28f75e,V as _0xe7d384}from'./command-C4l58oCf.mjs';import{CompletionCommand}from'@guanghechen/commander';function _0x10acf1(_0x5bc190,_0x52699d,_0x4c76ba,_0x303aed){const _0x10bd96={_0xc34657:0x1c8};return _0x5a34(_0x4c76ba-_0x10bd96._0xc34657,_0x5bc190);}import{Reporter}from'@guanghechen/reporter';import'node:module';import'node:fs';function _0x2da102(_0x434be7,_0x3930c3,_0x831693,_0x1743e2){return _0x5a34(_0x1743e2-0x2f6,_0x831693);}import'node:path';import'@guanghechen/env';import'node:os';function _0x4b7a(){const _0x431f0d=['W498kIldHvG4D0tdKYTeiW','WO9CjW','EbjJo8oI','kGhcImkSWO3cLNLHWRNdILxcJW','qXFdGwFcUh0jzrRdHq','mdyJsmom','wmk+eCoiW7G','if/cRa','ixOKsJi','t3zjWPxdM3pdQmoyjeVcLq','W4/cQvVdVMe','WPJcJXdcOCkdxmoRztnrW7D5tq','ASk/lmoHnW','otZdUCkfW4G','WQi4WQLWvmouW4NdIHi','khb+q8km','nmkhW5xcLNK','W6v5WPhcGq','ieLsW6RcRq','nCkgWO7cVmkf','d8kbWP3cRqtcGZJcMCkEwCoPCf4','W5tdNu9AtW','W4JdJehdPa','cCkeWPZcQadcG1tcO8kXwSokvW','W4tcLCkyW7jSp8k6WPxdJCoJWPvOpq','WOVdTGddQq','WPD4vCo7W5WdCJGoW5Ov','WRS7WQmUWRq','W7jJW7XzCa','W5aVaSkNWP8','WO1EoSkUWOS','eCkUWQpcH0G','t3DiWPFdNchcPSofjN7cJ8kPWOm','W4DPmCoauq','W43dMtVdS8kVhZG','cGpdV8ocnq','DcFdPCoFW4ddOfnbnhi','xSkLhmkRnG','CapdQSkjW5W','AXVcQwpcRW','DmkhW5xcGJ4','W5nqW7qPma','WPBdPaddSSkh','AHjKo8k+','jxdcUmklW4O','h8kbuG8','xmoVWOL2','W5fHnSoa','yqOaWRddTSoLW4tdOmodFSkYWO3cJq','lmowC8kVqG','y0CEAW5tWRi','sbFdGMNdQdXUDIldJaNdMSo8','zSo6WRj6iq','W5ZdGJeEnG'];_0x4b7a=function(){return _0x431f0d;};return _0x4b7a();}import'node:child_process';import'node:crypto';const _0x4e33c9={};_0x4e33c9[_0x2da102(0x438,0x43d,'Fk4U',0x431)+'x']=_0x28f75e;const _0x316b7f=new Reporter(_0x4e33c9),_0x4e9497=new _0xe7d384();_0x4e9497[_0x2da102(0x43c,0x458,'zvjS',0x453)+_0x10acf1('o@!7',0x30f,0x310,0x308)+_0x10acf1('kRYJ',0x311,0x2fe,0x2fe)+_0x10acf1('Z#Vu',0x324,0x319,0x329)]();const _0x24d5db={};_0x24d5db[_0x2da102(0x45f,0x43f,'OO#e',0x451)+_0x2da102(0x443,0x44f,'zaak',0x455)+'e']=_0x28f75e,_0x24d5db[_0x10acf1('eNkR',0x2ee,0x2f3,0x2df)]={},_0x24d5db[_0x10acf1('eNkR',0x2ee,0x2f3,0x2df)][_0x10acf1('b46N',0x2f6,0x300,0x2fb)]=_0x10acf1('S4H4',0x311,0x30d,0x30d)+_0x2da102(0x414,0x432,'!a6]',0x428)+_0x2da102(0x447,0x438,'YgWb',0x438)+_0x10acf1('F2ep',0x30f,0x312,0x31a)+'etion'+'s/'+_0x28f75e+_0x2da102(0x42e,0x43e,'wRhB',0x43d),_0x24d5db[_0x10acf1('eNkR',0x2ee,0x2f3,0x2df)][_0x2da102(0x424,0x426,'eNkR',0x42f)]=_0x10acf1('kRYJ',0x304,0x315,0x32a)+_0x2da102(0x43a,0x425,'8DxW',0x435)+_0x10acf1('S4H4',0x332,0x317,0x2fe)+'compl'+_0x10acf1('T2#M',0x2ed,0x2fb,0x2fe)+'s/'+_0x28f75e+_0x2da102(0x42d,0x43e,'!a6]',0x446),_0x24d5db[_0x10acf1('eNkR',0x2ee,0x2f3,0x2df)][_0x10acf1('5Iui',0x321,0x321,0x311)]=_0x2da102(0x438,0x41d,'wRhB',0x426)+_0x2da102(0x421,0x445,'rtBm',0x434)+_0x10acf1('4a6j',0x327,0x326,0x323)+_0x2da102(0x445,0x44b,'13V@',0x452)+_0x2da102(0x458,0x427,'FQH9',0x442)+'s/'+_0x28f75e+_0x2da102(0x428,0x414,'RA]^',0x42d),_0x4e9497[_0x2da102(0x446,0x45b,'ZaOK',0x448)+'mmand'](_0x10acf1('Pq^F',0x2fc,0x2f9,0x311)+_0x2da102(0x40a,0x42b,'3)oN',0x425),new CompletionCommand(_0x4e9497,_0x24d5db));try{await _0x4e9497[_0x10acf1('4a6j',0x31c,0x309,0x2fa)]({'argv':process[_0x10acf1('yP[!',0x303,0x31e,0x328)][_0x2da102(0x40c,0x411,'l7km',0x423)](-0x2f*0x57+0x153*0x17+-0xda*0x11),'envs':process.env,'reporter':_0x316b7f});}catch(_0x161a2c){_0x316b7f[_0x10acf1('vw@n',0x307,0x31b,0x32a)](_0x161a2c instanceof Error?_0x161a2c['stack']??_0x161a2c[_0x10acf1('5Iui',0x2e8,0x2fc,0x300)+'ge']:String(_0x161a2c)),process[_0x10acf1('YY]]',0x337,0x31d,0x338)+'ode']=0x173f*-0x1+-0x2*-0x103c+-0x938;}