@ww_nero/skills 3.4.0 → 3.4.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/index.js CHANGED
@@ -89,7 +89,6 @@ const loadText = (filename) => {
89
89
  };
90
90
 
91
91
  const PPT_PROMPT = loadText('ppt_prompt.txt');
92
- const VIDEO_PROMPT = loadText('video_prompt.txt');
93
92
 
94
93
  const buildSnippet = (title, workingDirectory) => {
95
94
  const entry = SNIPPETS[title];
@@ -146,20 +145,11 @@ const listTools = () => ({
146
145
  properties: {},
147
146
  required: []
148
147
  }
149
- },
150
- {
151
- name: 'video',
152
- description: '视频处理(如添加字幕)的指导说明和注意事项',
153
- inputSchema: {
154
- type: 'object',
155
- properties: {},
156
- required: []
157
- }
158
148
  }
159
149
  ]
160
150
  });
161
151
 
162
- const server = new Server({ name: 'skills', version: '3.4.0' }, { capabilities: { tools: {} } });
152
+ const server = new Server({ name: 'skills', version: '3.4.1' }, { capabilities: { tools: {} } });
163
153
 
164
154
  server.setRequestHandler(ListToolsRequestSchema, async () => listTools());
165
155
 
@@ -180,10 +170,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
180
170
  return { content: [{ type: 'text', text: PPT_PROMPT }] };
181
171
  }
182
172
 
183
- if (name === 'video') {
184
- return { content: [{ type: 'text', text: VIDEO_PROMPT }] };
185
- }
186
-
187
173
  return { content: [{ type: 'text', text: `未知工具: ${name}` }], isError: true };
188
174
  } catch (error) {
189
175
  const message = error?.message || '未知错误';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ww_nero/skills",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "MCP server that returns Python reference snippets and skill guides",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,174 +0,0 @@
1
- 视频处理的技巧指导
2
-
3
- 本指南涵盖常见的视频处理场景,所有操作均基于 ffmpeg 命令行工具实现。
4
-
5
- ---
6
-
7
- ## 1. 添加字幕
8
-
9
- 完整流程如下:
10
-
11
- **步骤 1:提取音频**
12
- ```bash
13
- ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 2 audio.mp3
14
- ```
15
-
16
- **步骤 2:语音转字幕**
17
- 使用 ASR 工具(如 mcp__media__asr)将音频转换为 SRT 字幕文件。
18
-
19
- **步骤 3:翻译字幕(可选)**
20
- 如需翻译字幕,可在此步骤对 SRT 文件内容进行语言转换。
21
-
22
- **步骤 4:移除原有字幕(如有)**
23
- ```bash
24
- # 查看视频流信息
25
- ffprobe -i input.mp4
26
-
27
- # 移除内嵌字幕流(保留视频和音频)
28
- ffmpeg -i input.mp4 -map 0:v -map 0:a -c copy output_no_sub.mp4
29
- ```
30
-
31
- **步骤 5:烧录字幕到视频**
32
- ```bash
33
- # 软字幕(可关闭)
34
- ffmpeg -i input.mp4 -i subtitle.srt -c copy -c:s mov_text output.mp4
35
-
36
- # 硬字幕(烧录到画面)
37
- ffmpeg -i input.mp4 -vf "subtitles=subtitle.srt:force_style='FontSize=24,FontName=Microsoft YaHei'" -c:a copy output.mp4
38
- ```
39
-
40
- ---
41
-
42
- ## 2. 视频剪辑
43
-
44
- **截取片段**
45
- ```bash
46
- # 从第 10 秒开始,截取 30 秒
47
- ffmpeg -i input.mp4 -ss 00:00:10 -t 00:00:30 -c copy output.mp4
48
-
49
- # 精确截取(需重新编码)
50
- ffmpeg -i input.mp4 -ss 00:00:10 -to 00:00:40 -c:v libx264 -c:a aac output.mp4
51
- ```
52
-
53
- **移除片段**
54
- ```bash
55
- # 保留 0-10s 和 20s-结尾,移除中间 10-20s
56
- ffmpeg -i input.mp4 -vf "select='not(between(t,10,20))',setpts=N/FRAME_RATE/TB" -af "aselect='not(between(t,10,20))',asetpts=N/SR/TB" output.mp4
57
- ```
58
-
59
- **合并视频**
60
- ```bash
61
- # 创建文件列表 files.txt:
62
- # file 'part1.mp4'
63
- # file 'part2.mp4'
64
- ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4
65
- ```
66
-
67
- **调整速度**
68
- ```bash
69
- # 2 倍速
70
- ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" -filter:a "atempo=2.0" output.mp4
71
- ```
72
-
73
- ---
74
-
75
- ## 3. 视频理解
76
-
77
- 对于视频内容理解,推荐采用 **抽帧 + 图像理解** 的方式:
78
-
79
- **适用范围**
80
- - 仅适用于短视频(小于 1 分钟)
81
- - 建议每 5 秒抽取 1 帧
82
-
83
- **抽帧命令**
84
- ```bash
85
- # 每 5 秒抽取 1 帧
86
- ffmpeg -i input.mp4 -vf "fps=1/5" frame_%03d.png
87
-
88
- # 指定起止时间抽帧
89
- ffmpeg -i input.mp4 -ss 00:00:00 -to 00:01:00 -vf "fps=1/5" frame_%03d.png
90
- ```
91
-
92
- **理解流程**
93
- 1. 使用上述命令抽取关键帧
94
- 2. 使用图像理解工具(如视觉模型)逐帧分析
95
- 3. 综合各帧信息得出视频内容理解
96
-
97
- ---
98
-
99
- ## 4. 视频生成
100
-
101
- 视频生成需要专业的 AI 视频生成工具,建议使用:
102
-
103
- - **可灵 (Kling)** - 快手旗下视频生成工具
104
- - **Sora** - OpenAI 视频生成模型
105
- - **通义万相** - 阿里云视频生成工具
106
- - **Runway Gen-3** - 专业视频生成平台
107
-
108
- 当前工具链不支持视频生成功能。
109
-
110
- ---
111
-
112
- ## 5. 视频内容编辑
113
-
114
- **重要提示:不支持逐帧编辑**
115
-
116
- 如果需要对视频内容进行逐帧编辑(如使用图像编辑工具修改每一帧),成本极高,不建议执行。原因:
117
- - 一分钟 30fps 视频有 1800 帧
118
- - 逐帧编辑耗时耗力,效果难以保证一致性
119
-
120
- **替代方案**
121
- - 使用专业视频编辑软件:Adobe Premiere、DaVinci Resolve、Final Cut Pro
122
- - 使用 AI 视频编辑工具:Runway、Pika Labs
123
-
124
- ---
125
-
126
- ## 6. 其他常用操作
127
-
128
- **格式转换**
129
- ```bash
130
- ffmpeg -i input.avi -c:v libx264 -c:a aac output.mp4
131
- ```
132
-
133
- **调整分辨率**
134
- ```bash
135
- ffmpeg -i input.mp4 -vf "scale=1920:1080" -c:a copy output.mp4
136
- ```
137
-
138
- **提取视频(无音频)**
139
- ```bash
140
- ffmpeg -i input.mp4 -an -c:v copy output.mp4
141
- ```
142
-
143
- **添加/替换音频**
144
- ```bash
145
- ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4
146
- ```
147
-
148
- **生成 GIF**
149
- ```bash
150
- ffmpeg -i input.mp4 -vf "fps=10,scale=480:-1:flags=lanczos" -t 5 output.gif
151
- ```
152
-
153
- **旋转视频**
154
- ```bash
155
- # 顺时针旋转 90 度
156
- ffmpeg -i input.mp4 -vf "transpose=1" output.mp4
157
- ```
158
-
159
- ---
160
-
161
- ## 能力边界说明
162
-
163
- **可以执行的操作**
164
- - 所有基于 ffmpeg 的视频处理操作
165
- - 结合 ASR 实现字幕生成
166
- - 抽帧后进行图像分析
167
-
168
- **无法执行的操作**
169
- - 视频生成(建议使用专业工具)
170
- - 逐帧内容编辑(成本过高)
171
- - 复杂特效制作(建议使用 After Effects 等)
172
- - 实时视频处理
173
-
174
- 如遇到无法实现的需求,建议使用更专业的视频处理工具。