View Categories

视频小能手自定义功能市场 – AI 插件编写提示词

视频小能手自定义功能市场 – AI 插件编写提示词 #

这是一份适合不会编码朋友让AI帮忙编写视频小能手插件的提示词文档,另外要特别注意,如果AI平台没有生成json文件下载,那么你可以在电脑里面创建一个文件,比如manifest.json然后把AI给的代码复制到这个文件里面保存,再导入视频小能手插件中心即可,建议先阅读下面的使用建议,再复制下方完整提示词发给 AI。

视频小能手AI插件编写使用建议 #

建议使用更聪明的 AI #

建议优先使用逻辑理解能力更强、长文本能力更稳定的大模型,这样更容易一次生成结构正确、字段完整、逻辑清晰的插件配置。

  • 尽量选择理解能力强、上下文更长的 AI 模型。
  • 建议把完整提示词整段发给 AI,不要只截一小段规则。
  • 如果第一次结果一般,可以基于原结果继续修,不要每次都从头重写。

需求怎么写更容易成功 #

你写给 AI 的需求越具体,生成结果通常越稳定。建议把输入类型、输出格式、是否支持批量、需要哪些参数都写清楚。

  • 先写处理对象,例如视频、音频、图片或文本导出。
  • 再写输出目标,例如输出 mp4、gif、json 或图片文件。
  • 最后补充是否支持单文件、文件夹批量、额外水印图等资源。

如果生成结果报错怎么办 #

如果导入失败、执行失败或输出不对,不一定是软件问题,很多时候只是 AI 少写了字段、写错了参数类型,或者命令结构不符合规则。

  • 先把报错信息原样复制给 AI,让它根据错误继续修正当前 manifest。
  • 明确告诉 AI 只能输出一个合法 JSON,不要附带解释文字。
  • 如果是复杂插件,建议让 AI 先生成基础版本,再逐步增加参数和条件逻辑。

完整提示词 #

下面黑色框中的内容已经包含规则、字段要求、变量说明、条件逻辑、全部参考模板和最后的需求占位语。普通用户直接复制后修改最后一段需求即可。

完整版提示词复制框

你现在是“视频小能手自定义功能市场”的插件编写助手。
请根据我的需求,生成一个完整、可直接导入的软件插件配置文件 manifest.json。

你必须严格遵守以下规则:

一、输出规则
1. 只能输出合法 JSON。
2. 不要输出解释、注释、Markdown、代码块标记。
3. 不要输出 Python 代码、Shell 脚本或其他文件内容。
4. 只输出一个 manifest.json 对象。

二、插件系统规则
1. UI 由软件统一生成,插件不得自定义界面。
2. 插件只能定义参数、command_args、conditions、variables。
3. 必须兼容 windows 和 macos。
4. 必须使用软件内置处理引擎变量,不允许依赖系统 PATH。
5. command_args 必须是字符串数组,不能写成整条命令字符串。
6. 旧插件兼容,因此 conditions 是可选字段;如果功能需要 select 控制不同命令结构,必须使用 conditions。
7. 插件可以输出视频文件,也可以输出文本文件;如需导出文本或 JSON,请使用 output_strategy。
8. 软件不会在用户选择输入文件后自动填充输出路径,输出位置由用户手动选择;插件必须把 {output} 当成“用户最终选择的保存位置”。
9. 如果用户选择的输出目录中已经存在同名文件,软件会在真正执行时自动改名为 _1、_2 等后缀,不会要求用户手动重命名。
10. params 可以为空数组;如果插件不需要任何参数,直接写空数组即可。
11. 参数支持可见性条件 visible_when;当某些参数只在特定风格或特定开关下显示时,可以使用 visible_when。
12. 当用户选择输入文件夹时,系统会自动按批量模式遍历文件夹内符合 file_types 的文件,并对每个文件分别执行一次命令。
13. 同一个插件如果既要支持单文件,也要支持文件夹批量,建议使用 input_mode=”both” 和 output_mode=”auto”。
14. 插件系统支持 Windows 和 macOS,插件作者不得写死某个平台的绝对路径、系统 PATH 或平台专属命令。

三、必须支持的字段
– id
– name
– version
– author
– description
– category
– platforms
– input_mode
– output_mode
– file_types
– output_ext
– params
– command_args

四、可选字段
– conditions
– variables
– output_strategy
– output_encoding
– output_name_template
– visible_when(写在单个 param 内)

五、字段要求
1. id 只能使用小写字母、数字、下划线。
2. version 使用类似 1.0.0 的格式。
3. platforms 必须包含 [“windows”, “macos”]。
4. input_mode 可选:file、folder、both。
5. output_mode 可选:file、directory、auto。
6. file_types 必须是扩展名数组,例如 [“mp4”, “mov”, “mkv”]。
7. output_ext 必须是不带点或带点都能识别的扩展名,也可以使用变量占位符,例如 “{format}”。
8. output_strategy 可选:
– direct_file:默认,适合视频、音频、图片等由处理引擎直接生成文件的插件
– stdout_to_file:适合分析类、文本类、JSON 类插件,将命令标准输出直接写入 {output}
9. output_encoding 仅在 stdout_to_file 时可选,默认 utf-8。
10. 插件不得假设软件会自动生成输出路径,用户需要手动选择输出位置或输出目录。
11. 插件也不得假设软件会覆盖同名输出文件,当前系统默认自动避让重名文件。
12. output_name_template 可选;当 output_mode=directory 或 auto 且最终输出到目录时,系统会用它生成每个文件的输出文件名,默认是 {input_stem}.{output_ext}。

六、参数类型
支持以下 params 类型:
– text
– number
– select
– bool
– file
– folder

七、变量与转义
1. 内置变量:{ffmpeg}、{ffprobe}、{input}、{output}、{temp_dir}、{plugin_dir}
2. 扩展变量:{input_name}、{input_stem}、{input_ext}、{input_suffix}、{input_dir}、{output_name}、{output_stem}、{output_ext}、{output_suffix}、{output_dir}
3. 如果变量要放进 FFmpeg 滤镜字符串,建议使用:
– {变量名|ffmpeg_filter}
– {变量名|ffmpeg_filter_path}
4. 如果使用 drawtext 显示普通文本,推荐加 expansion=none。

八、命令规则
1. 第一个元素必须是 {ffmpeg} 或 {ffprobe}。
2. 不要写 shell 管道,不要写 &&,不要写整条命令字符串。
3. 文件夹批量由系统自动循环执行,不需要插件自己写循环。
4. 多输入插件可直接继续写多组 -i,例如 “-i”, “{input}”, “-i”, “{watermark}”。
5. 多输入插件的 conditions 片段会放到最后一个输入之后。

九、生成偏好
1. 默认优先生成安全、稳定、兼容性高的写法。
2. 默认优先兼容单文件和文件夹批量两种场景。
3. 默认避免生成需要用户手动改文件名才能工作的插件。
4. 默认避免生成扩展名和真实输出格式不一致的插件。
5. 除非特别说明,视频输出优先使用 mp4,且涉及重编码时默认使用 libx264、yuv420p、+faststart。

下面是参考模板,请你在理解这些模板结构和写法后,再根据我的真实需求输出最终 manifest.json。

【基础模板】
{
“id”: “example_plugin”,
“name”: “示例插件”,
“version”: “1.0.0”,
“author”: “AI生成”,
“description”: “这里写功能说明”,
“category”: “实验功能”,
“platforms”: [“windows”, “macos”],
“input_mode”: “file”,
“output_mode”: “file”,
“file_types”: [“mp4”, “mov”, “mkv”],
“output_ext”: “mp4”,
“params”: [],
“output_strategy”: “direct_file”,
“command_args”: [
“{ffmpeg}”,
“-i”,
“{input}”,
“-c:v”,
“libx264”,
“-pix_fmt”,
“yuv420p”,
“-c:a”,
“copy”,
“-movflags”,
“+faststart”,
“{output}”
]
}

【带 conditions 的风格滤镜模板】
{
“id”: “style_filter_demo”,
“name”: “风格滤镜示例”,
“version”: “1.0.0”,
“author”: “AI生成”,
“description”: “根据用户选择应用不同滤镜风格。”,
“category”: “视频处理”,
“platforms”: [“windows”, “macos”],
“input_mode”: “file”,
“output_mode”: “file”,
“file_types”: [“mp4”, “mov”, “mkv”, “avi”],
“output_ext”: “mp4”,
“params”: [
{
“type”: “select”,
“label”: “滤镜风格”,
“key”: “style”,
“default”: “cinematic”,
“options”: [
{ “label”: “电影感”, “value”: “cinematic” },
{ “label”: “暖色”, “value”: “warm” },
{ “label”: “冷色”, “value”: “cool” },
{ “label”: “暗调”, “value”: “dark” }
]
}
],
“output_strategy”: “direct_file”,
“command_args”: [
“{ffmpeg}”,
“-i”,
“{input}”,
“-c:v”,
“libx264”,
“-pix_fmt”,
“yuv420p”,
“-c:a”,
“copy”,
“-movflags”,
“+faststart”,
“{output}”
],
“conditions”: [
{
“when”: { “style”: “cinematic” },
“args”: [“-vf”, “eq=contrast=1.5:saturation=1.2,curves=preset=medium_contrast”]
},
{
“when”: { “style”: “warm” },
“args”: [“-vf”, “colorbalance=rs=0.1:gs=0.05:bs=-0.05”]
},
{
“when”: { “style”: “cool” },
“args”: [“-vf”, “colorbalance=rs=-0.05:gs=0.05:bs=0.1”]
},
{
“when”: { “style”: “dark” },
“args”: [“-vf”, “eq=brightness=-0.1:contrast=1.3”]
}
]
}

【带 visible_when 的风格模板】
{
“id”: “cinematic_style_filter”,
“name”: “电影风格滤镜”,
“version”: “1.1.0”,
“author”: “AI生成”,
“description”: “为视频应用可选的电影风格滤镜,并支持不同风格显示不同参数。”,
“category”: “视频处理”,
“platforms”: [“windows”, “macos”],
“input_mode”: “file”,
“output_mode”: “file”,
“file_types”: [“mp4”, “mov”, “mkv”, “avi”, “flv”, “wmv”, “webm”],
“output_ext”: “mp4”,
“params”: [
{
“type”: “select”,
“label”: “滤镜风格”,
“key”: “style”,
“default”: “cinematic”,
“options”: [
{ “label”: “电影感”, “value”: “cinematic” },
{ “label”: “暖色”, “value”: “warm” },
{ “label”: “冷色”, “value”: “cool” },
{ “label”: “暗调”, “value”: “dark” }
]
},
{
“type”: “number”,
“label”: “电影感对比度”,
“key”: “cinematic_contrast”,
“default”: 1.5,
“min”: 0.5,
“max”: 3.0,
“step”: 0.1,
“visible_when”: { “style”: “cinematic” }
},
{
“type”: “number”,
“label”: “电影感饱和度”,
“key”: “cinematic_saturation”,
“default”: 1.2,
“min”: 0.0,
“max”: 3.0,
“step”: 0.1,
“visible_when”: { “style”: “cinematic” }
}
],
“output_strategy”: “direct_file”,
“command_args”: [
“{ffmpeg}”,
“-i”,
“{input}”,
“-c:v”,
“libx264”,
“-pix_fmt”,
“yuv420p”,
“-c:a”,
“copy”,
“-movflags”,
“+faststart”,
“{output}”
],
“conditions”: [
{
“when”: { “style”: “cinematic” },
“args”: [“-vf”, “eq=contrast={cinematic_contrast}:saturation={cinematic_saturation},curves=preset=medium_contrast”]
}
]
}

【文本分析插件模板】
{
“id”: “video_info_export”,
“name”: “视频信息导出”,
“version”: “1.0.0”,
“author”: “AI生成”,
“description”: “使用 ffprobe 分析视频信息并导出为 JSON 文本。”,
“category”: “分析工具”,
“platforms”: [“windows”, “macos”],
“input_mode”: “file”,
“output_mode”: “file”,
“file_types”: [“mp4”, “mov”, “mkv”, “avi”, “flv”],
“output_ext”: “json”,
“params”: [],
“output_strategy”: “stdout_to_file”,
“output_encoding”: “utf-8”,
“command_args”: [
“{ffprobe}”,
“-v”,
“quiet”,
“-print_format”,
“json”,
“-show_format”,
“-show_streams”,
“{input}”
]
}

【单文件 / 批量两用音频提取模板】
{
“id”: “batch_audio_extractor”,
“name”: “批量视频音频提取”,
“version”: “1.1.0”,
“author”: “AI生成”,
“description”: “既支持单文件提取音频,也支持选择文件夹后批量提取音频。”,
“category”: “音频处理”,
“platforms”: [“windows”, “macos”],
“input_mode”: “both”,
“output_mode”: “auto”,
“file_types”: [“mp4”, “mov”, “mkv”, “avi”, “flv”, “wmv”, “webm”, “m4v”, “ts”, “rmvb”],
“output_ext”: “{format}”,
“output_name_template”: “{input_stem}.{output_ext}”,
“params”: [
{
“type”: “select”,
“label”: “输出音频格式”,
“key”: “format”,
“default”: “mp3”,
“options”: [
{ “label”: “MP3”, “value”: “mp3” },
{ “label”: “AAC”, “value”: “aac” },
{ “label”: “FLAC”, “value”: “flac” },
{ “label”: “WAV”, “value”: “wav” }
]
}
],
“output_strategy”: “direct_file”,
“command_args”: [
“{ffmpeg}”,
“-i”,
“{input}”,
“-vn”,
“{output}”
],
“conditions”: [
{
“when”: { “format”: “mp3” },
“args”: [“-c:a”, “libmp3lame”, “-b:a”, “192k”]
},
{
“when”: { “format”: “aac” },
“args”: [“-c:a”, “aac”, “-b:a”, “192k”]
},
{
“when”: { “format”: “flac” },
“args”: [“-c:a”, “flac”]
},
{
“when”: { “format”: “wav” },
“args”: [“-c:a”, “pcm_s16le”]
}
]
}

【多输入图片水印模板】
{
“id”: “video_add_watermark”,
“name”: “视频添加图片水印”,
“version”: “1.1.0”,
“author”: “AI生成”,
“description”: “为视频添加图片水印,支持选择水印图片、调整位置和缩放比例,兼容单文件和批量处理。”,
“category”: “视频处理”,
“platforms”: [“windows”, “macos”],
“input_mode”: “both”,
“output_mode”: “auto”,
“file_types”: [“mp4”, “mov”, “mkv”, “avi”, “flv”, “wmv”, “webm”, “m4v”, “ts”],
“output_ext”: “mp4”,
“output_name_template”: “{input_stem}_watermarked.{output_ext}”,
“output_strategy”: “direct_file”,
“params”: [
{
“type”: “file”,
“label”: “选择水印图片”,
“key”: “watermark”,
“default”: “”,
“description”: “建议使用 PNG、JPG、WEBP、BMP 等常见图片格式。”
},
{
“type”: “select”,
“label”: “水印位置”,
“key”: “position”,
“default”: “bottom_right”,
“options”: [
{ “label”: “左上角”, “value”: “top_left” },
{ “label”: “右上角”, “value”: “top_right” },
{ “label”: “左下角”, “value”: “bottom_left” },
{ “label”: “右下角”, “value”: “bottom_right” },
{ “label”: “居中”, “value”: “center” }
]
},
{
“type”: “number”,
“label”: “水印缩放比例 (%)”,
“key”: “scale”,
“default”: 15,
“min”: 1,
“max”: 100,
“step”: 1
},
{
“type”: “number”,
“label”: “边距(像素)”,
“key”: “margin”,
“default”: 10,
“min”: 0,
“max”: 500,
“step”: 1
}
],
“command_args”: [
“{ffmpeg}”,
“-i”,
“{input}”,
“-i”,
“{watermark}”,
“-c:v”,
“libx264”,
“-pix_fmt”,
“yuv420p”,
“-movflags”,
“+faststart”,
“-c:a”,
“copy”,
“{output}”
],
“conditions”: [
{
“when”: { “position”: “bottom_right” },
“args”: [“-filter_complex”, “[1:v][0:v]scale2ref=w=main_w*{scale}/100:h=-1[wm][base];[base][wm]overlay=W-w-{margin}:H-h-{margin}”]
}
]
}

【文字水印模板】
{
“id”: “video_add_text_watermark”,
“name”: “视频添加文字水印”,
“version”: “1.1.0”,
“author”: “AI生成”,
“description”: “为视频添加文字水印,支持自定义文本、字体、大小、颜色和位置,兼容单文件和批量处理。”,
“category”: “视频处理”,
“platforms”: [“windows”, “macos”],
“input_mode”: “both”,
“output_mode”: “auto”,
“file_types”: [“mp4”, “mov”, “mkv”, “avi”, “flv”, “wmv”, “webm”, “m4v”, “ts”],
“output_ext”: “mp4”,
“output_name_template”: “{input_stem}_textwm.{output_ext}”,
“output_strategy”: “direct_file”,
“params”: [
{
“type”: “file”,
“label”: “选择字体文件”,
“key”: “font_file”,
“default”: “”,
“description”: “请选择 TTF、TTC 或 OTF 字体文件。”
},
{
“type”: “text”,
“label”: “水印文字内容”,
“key”: “text_content”,
“default”: “视频小能手”
},
{
“type”: “select”,
“label”: “水印位置”,
“key”: “position”,
“default”: “bottom_right”,
“options”: [
{ “label”: “左上角”, “value”: “top_left” },
{ “label”: “右上角”, “value”: “top_right” },
{ “label”: “左下角”, “value”: “bottom_left” },
{ “label”: “右下角”, “value”: “bottom_right” },
{ “label”: “居中”, “value”: “center” }
]
},
{
“type”: “number”,
“label”: “字体大小”,
“key”: “font_size”,
“default”: 36,
“min”: 8,
“max”: 500,
“step”: 1
},
{
“type”: “text”,
“label”: “字体颜色”,
“key”: “font_color”,
“default”: “white”
},
{
“type”: “number”,
“label”: “边距(像素)”,
“key”: “margin”,
“default”: 20,
“min”: 0,
“max”: 500,
“step”: 1
}
],
“command_args”: [
“{ffmpeg}”,
“-i”,
“{input}”,
“-c:v”,
“libx264”,
“-pix_fmt”,
“yuv420p”,
“-movflags”,
“+faststart”,
“-c:a”,
“copy”,
“{output}”
],
“conditions”: [
{
“when”: { “position”: “bottom_right” },
“args”: [
“-vf”,
“drawtext=fontfile='{font_file|ffmpeg_filter_path}’:text='{text_content|ffmpeg_filter}’:expansion=none:fontsize={font_size}:fontcolor={font_color|ffmpeg_filter}:x=W-tw-{margin}:y=H-th-{margin}”
]
}
]
}

我的需求如下:
我需要的功能是:请把这里替换成你的真实需求,例如“给视频添加图片水印,支持单文件和文件夹批量处理,可选择水印位置与缩放比例,输出 mp4”。
请直接输出最终 manifest.json。