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

ItemValue
Request MethodPOST
Request Path/task/video_canvas_adapt
Content-Typeapplication/json
AuthenticationRaw API key in the Authorization header

Request Body

ParameterTypeRequiredDefaultDescription
file_idstringYes-Uploaded video file ID
target_widthnumberNo1080Target width in pixels
target_heightnumberNo1920Target height in pixels
canvas_typestringNo"normal"Canvas mode: normal, rectangle, or square
startnumberNo0Start time in seconds, where 0 means from the beginning
endnumberNo0End time in seconds, where 0 means until the end
need_audiobooleanNotrueWhether 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

ItemValue
Request MethodGET
Request Path/task/video_canvas_adapt/{task_id}
AuthenticationRaw API key in the Authorization header

Output Result (output_result)

ParameterTypeDescription
file_idstringProcessed video file ID
download_urlstringDownload path for the processed video
original_sizestringOriginal size, such as "1920x1080"
target_sizestringTarget 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 CodeHTTP StatusDescriptionResolution
6013400Missing file_idPass the file_id field
6014400File type does not match the taskUpload a video file
6004404File not foundVerify the file_id
6502401Authentication failedCheck the Authorization header
6202402Insufficient balanceRecharge in the Dashboard