Alibaba Cloud Super Resolution (阿里云视频超分辨率)
Enhance video resolution using Alibaba Cloud's video super resolution API, converting low-resolution videos to higher resolution (e.g., 480p → 960p).
Prerequisites
Set the following environment variables for authentication:
CODEBLOCK0
Optional OSS Configuration (for large files)
For files larger than 2GB or when using OSS directly:
CODEBLOCK1
Execution (Python CLI Tool)
A Python CLI tool is provided at ~/.openclaw/workspace/skills/alibaba-super-resolution/alibaba_super_resolve.py.
Quick Examples
CODEBLOCK2
Input Requirements
Video Files
- - Formats: MP4, MOV, AVI, MKV
- Max Size: 2GB (direct upload) / No limit (OSS URL)
- Max Duration: 30 minutes
- Input Resolutions: 480p, 720p
Output Resolutions
| Input | Output |
|---|
| 480p | 960p (2x upscale) |
| 720p |
2K (2x upscale) |
Bit Rate Settings
| Bit Rate | Quality | File Size | Processing Time | Use Case |
|---|
| 1-3 | Low | Small | Fast | Preview/Testing |
| 4-6 |
Medium | Medium | Medium | Social Media |
| 7-10 | High | Large | Slow | HD Publishing |
Rules
- 1. Always check that credentials are configured before making API calls.
- Files over 2GB must use OSS URL instead of direct upload.
- Default bit rate: 5 (balanced quality/size).
- Default timeout: 1200 seconds (20 minutes).
- Download immediately - output URLs expire after 24 hours.
- Handle errors gracefully - display clear error messages.
Troubleshooting
VideoTooLarge
Error: INLINECODE1
Fix: Use OSS URL instead of direct upload
Timeout
Error: INLINECODE2
Fix: Increase timeout parameter: --timeout 1800 (30 minutes)
OSSAccessDenied
Error: INLINECODE4
Fix: Verify RAM permissions for the access key, ensure it has OSS read/write access.
Related Documents
阿里云视频超分辨率
使用阿里云视频超分辨率API提升视频分辨率,将低分辨率视频转换为更高分辨率(例如:480p → 960p)。
前置条件
设置以下环境变量进行身份验证:
bash
export ALIBABACLOUDACCESSKEYID=your-access-key-id
export ALIBABACLOUDACCESSKEYSECRET=your-access-key-secret
可选的OSS配置(用于大文件)
对于超过2GB的文件或直接使用OSS时:
bash
export ALIYUNOSSBUCKET=your-bucket-name
export ALIYUNOSSENDPOINT=oss-cn-shanghai.aliyuncs.com
执行(Python CLI工具)
Python CLI工具位于 ~/.openclaw/workspace/skills/alibaba-super-resolution/alibabasuperresolve.py。
快速示例
bash
基本用法:本地文件 → 本地高清文件
python3 ~/.openclaw/workspace/skills/alibaba-super-resolution/alibaba
superresolve.py \
--input videos/input-480p.mp4 \
--output videos/output-960p.mp4
自定义比特率(越高画质越好,文件越大)
python3 ~/.openclaw/workspace/skills/alibaba-super-resolution/alibaba
superresolve.py \
--input videos/input-480p.mp4 \
--output videos/output-960p.mp4 \
--bit-rate 8
不等待完成(立即返回任务ID)
python3 ~/.openclaw/workspace/skills/alibaba-super-resolution/alibaba
superresolve.py \
--input videos/input-480p.mp4 \
--no-wait
检查现有任务状态
python3 ~/.openclaw/workspace/skills/alibaba-super-resolution/alibaba
superresolve.py \
--status
等待现有任务完成并下载结果
python3 ~/.openclaw/workspace/skills/alibaba-super-resolution/alibabasuperresolve.py \
--wait \
--output videos/output-960p.mp4
输入要求
视频文件
- - 格式:MP4、MOV、AVI、MKV
- 最大大小:2GB(直接上传)/ 无限制(OSS URL)
- 最大时长:30分钟
- 输入分辨率:480p、720p
输出分辨率
2K(2倍放大) |
比特率设置
| 比特率 | 质量 | 文件大小 | 处理时间 | 使用场景 |
|---|
| 1-3 | 低 | 小 | 快 | 预览/测试 |
| 4-6 |
中 | 中 | 中 | 社交媒体 |
| 7-10 | 高 | 大 | 慢 | 高清发布 |
规则
- 1. 始终检查 在进行API调用前确保凭证已配置。
- 超过2GB的文件 必须使用OSS URL而非直接上传。
- 默认比特率:5(质量/大小平衡)。
- 默认超时时间:1200秒(20分钟)。
- 立即下载 - 输出URL在24小时后过期。
- 优雅处理错误 - 显示清晰的错误信息。
故障排除
视频过大
错误:文件超过2GB限制
解决方案:使用OSS URL而非直接上传
超时
错误:任务超时
解决方案:增加超时参数:--timeout 1800(30分钟)
OSS访问被拒绝
错误:OSSAccessDenied
解决方案:验证访问密钥的RAM权限,确保具有OSS读写权限。
相关文档