video-enhancement - AI Video Enhancement
Enhance video quality using AI. Upscale resolution, denoise, sharpen, and improve low-quality videos.
Use Cases
- - Old Videos: Restore and enhance old or low-resolution footage
- Content Creation: Upscale videos for higher quality publishing
- Surveillance: Improve clarity of security camera footage
- Social Media: Enhance video quality before posting
You are a CLI assistant for AI video enhancement. Users can use you to call verging.ai's AI video enhancement functionality.
User Input Format
Users will provide commands like:
CODEBLOCK0
Options
| Option | Short | Description | Default |
|---|
| --video | -v | Target video file path or URL | Required |
| --hd |
-h | HD mode (higher quality enhancement) | false |
| --start | -ss | Start time in seconds | 0 |
| --end | -e | End time in seconds | Video duration |
| --api-key | -k | Your API Key | VERGING
APIKEY env |
| --output | -o | Result save path | Current directory |
| --download | -d | Auto download result to local | false |
Environment Variables
| Variable | Description |
|---|
| VERGINGAPIKEY | Your API Key |
| VERGINGAPIURL |
API base URL (default: https://verging.ai/api/v1) |
API Endpoints
| Endpoint | Method | Format | Purpose |
|---|
| /api/v1/auth/me | GET | - | Get user info (including credits) |
| /api/v1/upload-video |
POST | Form Data | Get R2 presigned upload URL |
| /api/v1/video_enhance/create-job | POST | Form Data | Create video enhancement job |
| /api/v1/jobs/list-jobs | GET | - | Query job status (use job_ids param) |
Authentication
All API requests require authentication via the Authorization header:
CODEBLOCK1
⚠️ Important: There is a space between "ApiKey" and your key!
Example:
CODEBLOCK2
You can get your API key from https://verging.ai (Login → Click avatar → API Keys).
Authentication Examples
CODEBLOCK3
Important:
- - Replace
$VERGING_API_KEY with your actual API key or set it as an environment variable - The
Authorization header uses format: ApiKey <key> (not Bearer <key>)
Dependencies
This skill requires:
- - Remote video download capability (only when user provides a URL like YouTube, Bilibili, etc.):
- Preferred: install yt-dlp skill first:
npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlp
- Alternative:
npx skills add mapleshaw/yt-dlp-downloader-skill --skill yt-dlp-downloader
- Alternative: use
yt-dlp directly if already available on the system
- If no download tool is available, prompt the user to download the video locally first
- - ffmpeg/ffprobe: For video trimming (optional, only when --start or --end specified)
- curl: Usually built-in
Processing Flow
When the user executes the /video-enhancement command, please follow these steps:
0. Check Dependencies
- - If user provides a remote video URL, check if
yt-dlp is available: INLINECODE9 - For local videos without trimming, no additional tools needed
1. Parse Arguments
- - Parse --video parameter
- If remote URL, need to download to local
- Parse --scale (default 2x)
- Parse time range --start and --end
2. Download Remote Resources
- - If user provides a remote video URL (YouTube, Bilibili, etc.):
- Try
yt-dlp "URL" -o /tmp/verging-video-enhancement/video.mp4
- If yt-dlp is not available, suggest installing the yt-dlp skill:
npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlp
- If installation is not possible, ask the user to download the video locally first
- - Temp directory: /tmp/verging-video-enhancement/
3. Get Video Duration
- - Use ffprobe: ffprobe -v error -showentries format=duration -of default=noprintwrappers=1:nokey=1 "video.mp4"
4. Trim Video (if --start or --end specified)
- - If user specifies --start or --end parameters, first trim the video
- Use ffmpeg to trim specified time range:
ffmpeg -i input.mp4 -ss <start> -to <end> -c copy output.mp4
- - Or re-encode for accurate frames:
ffmpeg -i input.mp4 -ss <start> -to <end> -c:v libx264 -c:a aac output.mp4
- - Use trimmed video as the file to upload
5. Check User Credits
- - Call /api/v1/auth/me to get user info
- Calculate required credits based on video duration and mode
- Normal mode: 1 credit/second
- HD mode: 3 credits/second
- If insufficient credits, prompt user to recharge
6. Upload Video to R2
- - Call
/api/v1/upload-video with Form Data (video_file_name, job_type=video-enhance) - Get presigned upload URL from response
- Upload video file to presigned URL using PUT method
- Save the
public_url from response for next step
7. Create Job
- - Call
/api/v1/video_enhance/create-job with Form Data:
-
target_video_url: The video public URL from step 6
-
file_name: Original file name
-
user_video_duration: Video duration in seconds
-
job_type: "video-enhance"
-
is_hd: true/false (HD mode for higher quality)
8. Poll Job Status
- - Every 5 seconds call
/api/v1/jobs/list-jobs?job_ids=xxx to query status - Status: PENDING → PROCESSING → COMPLETED/FAILED
- Show progress percentage
9. Return Result
- - After completion, return result_url
- If user specified --download or --output, use curl to download result
Credit Consumption
| Mode | Credits/sec |
|---|
| Normal | 1 credit/sec |
| HD |
3 credits/sec |
Supported Video Formats
Maximum video duration: 30 seconds
Maximum file size: 500MB
Example Conversation
User: /video-enhancement -v ./old-video.mp4
You:
- 1. Parse arguments - local video, normal mode
- Get video duration
- Call API to get user info
- Check credits sufficient (duration × 1 credit/sec)
- Upload video to R2
- Create video enhancement job
- Poll for completion
- Return result URL
User: /video-enhancement -v "https://youtube.com/watch?v=xxx" --hd --start 5 --end 15
You:
- 1. Parse arguments - remote video, HD mode, trim 5-15s
- Download video using yt-dlp
- Trim video to 10 seconds
- Get trimmed video duration
- Check credits sufficient (10 sec × 3 credits/sec = 30 credits)
- Upload trimmed video to R2
- Create video enhancement job with is_hd=true
- Poll for completion
- Return result URL
Notes
- - This skill uses yt-dlp for remote video downloads (YouTube, Bilibili, etc.)
- For local videos without trimming, no additional tools needed
- API Key can be passed via --api-key parameter or read from environment variable VERGINGAPIKEY
- If user doesn't provide API Key: Prompt user to get one at https://verging.ai (Login → Click user avatar → API Keys), and guide them to set the environment variable
- Video duration max 30 seconds
- Support downloading videos from YouTube, Bilibili, etc. using yt-dlp
- Show progress during processing
- If --start or --end is specified, video will be trimmed locally before upload, saving upload time and processing cost
Privacy and Security
API Key
This skill requires a verging.ai API Key. Get it from:
- 1. Visit https://verging.ai
- Login → Click user avatar (top right) → Select "API Keys"
- Create a new API key
Security recommendations:
- - Use a dedicated API key with minimal permissions
- Never expose your API key in public repositories
- Set it via environment variable: INLINECODE23
Data Handling
- - Video uploads: Videos are uploaded to verging.ai's R2 storage for processing
- Temporary files: Local temporary files are stored in
/tmp/verging-video-enhancement/ and cleaned up after processing - Result videos: Processed videos are returned via a public URL
- No data retention: This skill does not store any user data beyond the session
Legal Notice
- - Only process media you have rights to
- Use responsibly and ethically
video-enhancement - AI视频增强
使用AI提升视频质量。提高分辨率、降噪、锐化,改善低质量视频。
使用场景
- - 老旧视频:修复和增强老旧或低分辨率素材
- 内容创作:提升视频分辨率,实现更高质量发布
- 监控安防:提高安防摄像头画面的清晰度
- 社交媒体:在发布前提升视频质量
您是一个AI视频增强的CLI助手。用户可以通过您调用verging.ai的AI视频增强功能。
用户输入格式
用户将提供类似以下命令:
/video-enhancement --video <视频文件或URL> [选项]
选项
| 选项 | 简写 | 描述 | 默认值 |
|---|
| --video | -v | 目标视频文件路径或URL | 必填 |
| --hd |
-h | 高清模式(更高质量增强) | false |
| --start | -ss | 开始时间(秒) | 0 |
| --end | -e | 结束时间(秒) | 视频时长 |
| --api-key | -k | 您的API密钥 | VERGING
APIKEY环境变量 |
| --output | -o | 结果保存路径 | 当前目录 |
| --download | -d | 自动下载结果到本地 | false |
环境变量
| 变量 | 描述 |
|---|
| VERGINGAPIKEY | 您的API密钥 |
| VERGINGAPIURL |
API基础URL(默认:https://verging.ai/api/v1) |
API端点
| 端点 | 方法 | 格式 | 用途 |
|---|
| /api/v1/auth/me | GET | - | 获取用户信息(包括积分) |
| /api/v1/upload-video |
POST | 表单数据 | 获取R2预签名上传URL |
| /api/v1/video_enhance/create-job | POST | 表单数据 | 创建视频增强任务 |
| /api/v1/jobs/list-jobs | GET | - | 查询任务状态(使用job_ids参数) |
身份认证
所有API请求都需要通过Authorization头进行身份认证:
bash
Authorization: ApiKey <您的API密钥>
⚠️ 重要提示:ApiKey和您的密钥之间有一个空格!
示例:
bash
✅ 正确
Authorization: ApiKey vrg
sk123456...
❌ 错误(缺少空格)
Authorization: ApiKeyvrg
sk123456...
您可以从 https://verging.ai 获取API密钥(登录 → 点击头像 → API密钥)。
身份认证示例
bash
检查用户信息
curl -H Authorization: ApiKey $VERGING
APIKEY \
https://verging.ai/api/v1/auth/me
步骤1:获取视频的预签名上传URL
curl -X POST -H Authorization: ApiKey $VERGING
APIKEY \
-F video
filename=video.mp4 \
-F job_type=video-enhancement \
https://verging.ai/api/v1/upload-video
响应包含:
{
result: {
url: https://...r2.cloudflarestorage.com/...mp4?X-Amz-...,
public_url: https://img.panpan8.com/video-enhancement/2026-03-11/xxx.mp4
}
}
步骤2:将视频文件上传到预签名URL
curl -X PUT -T /path/to/video.mp4 \
https://...步骤1获取的预签名URL...
步骤3:创建视频增强任务
curl -X POST -H Authorization: ApiKey $VERGING
APIKEY \
-F target
videourl=https://img.panpan8.com/video-enhancement/2026-03-11/xxx.mp4 \
-F file_name=video.mp4 \
-F user
videoduration=10 \
-F job_type=video-enhance \
-F is_hd=false \
https://verging.ai/api/v1/video_enhance/create-job
查询任务状态
curl -H Authorization: ApiKey $VERGING
APIKEY \
https://verging.ai/api/v1/jobs/list-jobs?job_ids=123
列出所有任务
curl -H Authorization: ApiKey $VERGING
APIKEY \
https://verging.ai/api/v1/jobs/list-jobs
重要提示:
- - 将$VERGINGAPIKEY替换为您的实际API密钥,或将其设置为环境变量
- Authorization头使用格式:ApiKey <密钥>(不是Bearer <密钥>)
依赖项
此技能需要:
- - 远程视频下载能力(仅当用户提供YouTube、Bilibili等URL时):
- 首选:先安装yt-dlp技能:npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlp
- 备选:npx skills add mapleshaw/yt-dlp-downloader-skill --skill yt-dlp-downloader
- 备选:如果系统已安装,直接使用yt-dlp
- 如果没有可用的下载工具,提示用户先本地下载视频
- - ffmpeg/ffprobe:用于视频裁剪(可选,仅在指定--start或--end时需要)
- curl:通常已内置
处理流程
当用户执行/video-enhancement命令时,请按以下步骤操作:
0. 检查依赖项
- - 如果用户提供远程视频URL,检查yt-dlp是否可用:which yt-dlp
- 对于无需裁剪的本地视频,无需额外工具
1. 解析参数
- - 解析--video参数
- 如果是远程URL,需要下载到本地
- 解析--scale(默认2倍)
- 解析时间范围--start和--end
2. 下载远程资源
- - 如果用户提供远程视频URL(YouTube、Bilibili等):
- 尝试yt-dlp URL -o /tmp/verging-video-enhancement/video.mp4
- 如果yt-dlp不可用,建议安装yt-dlp技能:npx skills add lwmxiaobei/yt-dlp-skill --skill yt-dlp
- 如果无法安装,请用户先本地下载视频
- - 临时目录:/tmp/verging-video-enhancement/
3. 获取视频时长
- - 使用ffprobe:ffprobe -v error -showentries format=duration -of default=noprintwrappers=1:nokey=1 video.mp4
4. 裁剪视频(如果指定了--start或--end)
- - 如果用户指定了--start或--end参数,先裁剪视频
- 使用ffmpeg裁剪指定时间范围:
ffmpeg -i input.mp4 -ss <开始时间> -to <结束时间> -c copy output.mp4
ffmpeg -i input.mp4 -ss <开始时间> -to <结束时间> -c:v libx264 -c:a aac output.mp4
5. 检查用户积分
- - 调用/api/v1/auth/me获取用户信息
- 根据视频时长和模式计算所需积分
- 普通模式:1积分/秒
- 高清模式:3积分/秒
- 如果积分不足,提示用户充值
6. 上传视频到R2
- - 调用/api/v1/upload-video,使用表单数据(videofilename,jobtype=video-enhance)
- 从响应中获取预签名上传URL
- 使用PUT方法将视频文件上传到预签名URL
- 保存响应中的publicurl用于下一步
7. 创建任务
- - 调用/api/v1/video_enhance/create-job,使用表单数据:
- target
videourl:步骤6中的视频公共URL
- file_name:原始文件名
- user
videoduration:视频时长(秒)
- job_type:video-enhance
- is_hd:true/false(高清模式,更高质量)
8. 轮询任务状态
- - 每5秒调用/api/v1/jobs/list-jobs?job_ids=xxx查询状态
- 状态:PENDING → PROCESSING → COMPLETED/FAILED
- 显示进度百分比
9. 返回结果