Video Motion Cut

Use OpenCVMotionCut to analyze obvious motion and camera-movement highlights in a video. The API returns structured highlight intervals only. Mode selection is not exposed, and no clip files are generated.

Example Video

Create Task

Basic Information

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

Request Body

ParameterTypeRequiredDefaultDescription
file_idstringYes-Uploaded video file ID

Request Example

curl -X POST https://api.ai-mcn.tv:10000/task/video_motion_cut \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "537489015178246"
  }'

Success Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "537489015178247",
    "task_type": "video_motion_cut",
    "status": "queued"
  }
}

Query Task Result

Basic Information

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

Output Result (output_result)

ParameterTypeDescription
total_cut_pointsintegerNumber of detected highlight intervals
video_metaobjectBasic video metadata containing fps, width, and height
cut_pointsarray<object>Structured motion-highlight interval list

cut_points Fields

ParameterTypeDescription
idintegerInterval index
start_frameintegerStart frame of the interval
end_frameintegerEnd frame of the interval
peak_frameintegerPeak frame of the interval
start_timenumberStart time in seconds
end_timenumberEnd time in seconds
peak_timenumberPeak timestamp in seconds
durationnumberInterval duration in seconds
directionnumberMain direction of on-screen content motion, computed from atan2(dy, dx) and interpreted in image coordinates; -1 means unavailable
avg_magnitudenumberAverage motion magnitude in the interval
peak_magnitudenumberPeak motion magnitude in the interval
consistencynumberDirection consistency. Values closer to 1 mean more stable direction
centroid_xnumberHorizontal centroid of the motion area, normalized to 0-1
centroid_ynumberVertical centroid of the motion area, normalized to 0-1
coveragenumberCoverage ratio of the obvious motion area
avg_brightnessnumberAverage brightness of the interval

direction Reference

direction describes the dominant movement direction of the on-screen content, not a direct statement of camera motion itself.

The angle is computed with atan2(dy, dx) from the standard mathematical coordinate system, but interpreted in image coordinates where the y-axis points downward:

                 270° (moving up)
                  ↑
                  |
  180° (moving left) ←---+---→ 0° (moving right)
                  |
                  ↓
                 90° (moving down)
  • : on-screen content moves to the right
  • 90°: on-screen content moves downward
  • 180°: on-screen content moves to the left
  • 270°: on-screen content moves upward
  • -1: no stable dominant direction can be determined for the interval

This means direction is best read as the visual motion you see in the frame. For example:

  • may correspond to a camera panning left, or to a subject moving right
  • 180° means the on-screen content moves left overall
  • 90° may correspond to an upward camera tilt, or to a subject falling / moving downward
  • 270° means the on-screen content moves upward overall

If you use this field to infer camera movement type, remember that camera motion and content motion can be inverse to each other, especially for pan and tilt shots.

Success Example

{
  "code": 200,
  "msg": "success",
  "data": {
    "task_id": "537489015178247",
    "status": "completed",
    "progress": 100,
    "output_result": {
      "total_cut_points": 2,
      "video_meta": {
        "fps": 29.97,
        "width": 1920,
        "height": 1080
      },
      "cut_points": [
        {
          "id": 1,
          "start_frame": 88,
          "end_frame": 136,
          "peak_frame": 112,
          "start_time": 2.9363,
          "end_time": 4.5379,
          "peak_time": 3.7371,
          "duration": 1.6016,
          "direction": 271.4832,
          "avg_magnitude": 3.2947,
          "peak_magnitude": 7.8124,
          "consistency": 0.9132,
          "centroid_x": 0.5148,
          "centroid_y": 0.4372,
          "coverage": 0.2864,
          "avg_brightness": 102.3381
        }
      ]
    },
    "create_time": "2026-04-12T15:40:10Z",
    "update_time": "2026-04-12T15:40:18Z"
  }
}

Error Codes

Error CodeHTTP StatusDescriptionResolution
6013400Missing file_idAdd the required field
6014400File type does not matchPass a video file ID
6004404File not foundVerify the file_id
6502401Authentication failedCheck the Authorization header

Usage Limits

  • This API currently accepts a single video file per task
  • The endpoint is fixed to the OpenCVMotionCut engine and does not expose mode selection
  • The API always returns structured results only and never exports clip files