Media
为视频添加文字水印,可自定义位置、字体大小、颜色、透明度和显示时间
用三种语言从你的代码中调用此工具。
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/video-watermark-text' \
-F 'file=@/path/to/videoFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/zh/api/tools/video-watermark-text' \
-F 'videoFile=/path/to/file.ext' \
-F 'text=Watermark' \
-F 'position=bottom-right' \
-F 'fontSize=24' \
-F 'fontColor=#FFFFFF' \
-F 'opacity=0.7' \
-F 'margin=20' \
-F 'animationMode=static' \
-F 'animationSpeed=50' \
-F 'backgroundColor=#000000' \
-F 'backgroundOpacity=0' \
-F 'shadowOpacity=0.5' \
-F 'startTime=0' \
-F 'endTime=-1' \
-F 'outputFormat=mp4'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/video-watermark-text| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| videoFile | file需先上传 | 是 | — |
| text | text | 是 | — |
| position | select | 否 | — |
| fontSize | range | 否 | 水印文字的大小(8-200 像素) |
| fontColor | color | 否 | 水印文字的颜色 |
| opacity | range | 否 | 文字不透明度(0.1 = 透明,1 = 不透明) |
| margin | range | 否 | 距离视频边缘的距离(0-200 像素) |
| animationMode | select | 否 | — |
| animationSpeed | range | 否 | 移动速度(像素/秒,10-500) |
| backgroundColor | color | 否 | 文字后面的背景框颜色 |
| backgroundOpacity | range | 否 | 背景不透明度(0 = 无背景,1 = 实心) |
| shadowOpacity | range | 否 | 文字阴影不透明度(0 = 无阴影,1 = 实心阴影) |
| startTime | number | 否 | 何时开始显示水印(0 = 从头开始) |
| endTime | number | 否 | 何时停止显示水印(-1 = 直到结束) |
| outputFormat | select | 否 | — |
文件结果
{
"filePath": "/public/processing/randomid.ext",
"fileName": "output.ext",
"contentType": "application/octet-stream",
"size": 1024,
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-video-watermark-text": {
"name": "video-watermark-text",
"description": "为视频添加文字水印,可自定义位置、字体大小、颜色、透明度和显示时间",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=video-watermark-text",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "video-watermark-text",
"arguments": {
"videoFile": "https://example.com/file.ext",
"text": "Watermark",
"position": "bottom-right",
"fontSize": 24,
"fontColor": "#FFFFFF",
"opacity": 0.7,
"margin": 20,
"animationMode": "static",
"animationSpeed": 50,
"backgroundColor": "#000000",
"backgroundOpacity": 0,
"shadowOpacity": 0.5,
"startTime": 0,
"endTime": -1,
"outputFormat": "mp4"
}
}
}有问题或反馈?请联系 [email protected]