Canvas Resize
Convert a video to a target canvas size. Supports multiple canvas modes, segment clipping, and preserving the audio track.
Create Task
Basic Information
| Item | Value |
|---|
| Request Method | POST |
| Request Path | /task/video_canvas_adapt |
| Content-Type | application/json |
| Authentication | Raw API key in the Authorization header |
Request Body
| Parameter | Type | Required | Default | Description |
|---|
file_id | string | Yes | - | Uploaded video file ID |
target_width | number | No | 1080 | Target width in pixels |
target_height | number | No | 1920 | Target height in pixels |
canvas_type | string | No | "normal" | Canvas mode: normal, rectangle, or square |
start | number | No | 0 | Start time in seconds, where 0 means from the beginning |
end | number | No | 0 | End time in seconds, where 0 means until the end |
need_audio | boolean | No | true | Whether to keep the audio track |
Request Example
curl -X POST https://api.ai-mcn.tv:10000/task/video_canvas_adapt \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_id": "537489015178246",
"target_width": 1080,
"target_height": 1920,
"canvas_type": "normal",
"need_audio": true
}'
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"task_type": "video_canvas_adapt",
"status": "queued"
}
}
Query Task Result
Basic Information
| Item | Value |
|---|
| Request Method | GET |
| Request Path | /task/video_canvas_adapt/{task_id} |
| Authentication | Raw API key in the Authorization header |
Output Result (output_result)
| Parameter | Type | Description |
|---|
file_id | string | Processed video file ID |
download_url | string | Download path for the processed video |
original_size | string | Original size, such as "1920x1080" |
target_size | string | Target size, such as "1080x1920" |
Success Example
{
"code": 200,
"msg": "success",
"data": {
"task_id": "537489015178247",
"status": "completed",
"progress": 100,
"output_result": {
"file_id": "537489015178248",
"download_url": "/download/a1/output.mp4",
"original_size": "1920x1080",
"target_size": "1080x1920"
},
"create_time": "2026-04-05T08:00:00Z",
"update_time": "2026-04-05T08:00:45Z"
}
}
Error Codes
| Error Code | HTTP Status | Description | Resolution |
|---|
6013 | 400 | Missing file_id | Pass the file_id field |
6014 | 400 | File type does not match the task | Upload a video file |
6004 | 404 | File not found | Verify the file_id |
6502 | 401 | Authentication failed | Check the Authorization header |
6202 | 402 | Insufficient balance | Recharge in the Dashboard |