Skip to content
当前页导航

KEYFRAMES_INFOS API Documentation

🌐 Language Switch

中文版 | English

Interface Information

POST /openapi/capcut-mate/v1/keyframes_infos

Function Description

Generate keyframe information based on keyframe type, position ratios, and values. This interface converts keyframe configurations into the keyframe information format required by Jianying drafts.

More Documentation

📖 For more detailed documentation and tutorials, please visit: https://docs.jcaigc.cn

Request Parameters

json
{
  "ctype": "position",
  "offsets": [0.0, 0.5, 1.0],
  "values": [0.0, 0.5, 1.0],
  "segment_infos": [
    {"id": "segment1", "start": 0, "end": 5000000}
  ],
  "height": 1080,
  "width": 1920
}

Parameter Description

ParameterTypeRequiredDefaultDescription
ctypestring-Keyframe type
offsetsarray[number]-Position ratio array
valuesarray[number]-Value array
segment_infosarray[object]-Segment information array
heightnumber1080Height
widthnumber1920Width

Response Format

Success Response (200)

json
{
  "keyframes_infos": "[{\"ctype\":\"position\",\"offset\":0.0,\"value\":0.0,\"segment_id\":\"segment1\",\"height\":1080,\"width\":1920},{\"ctype\":\"position\",\"offset\":0.5,\"value\":0.5,\"segment_id\":\"segment1\",\"height\":1080,\"width\":1920},{\"ctype\":\"position\",\"offset\":1.0,\"value\":1.0,\"segment_id\":\"segment1\",\"height\":1080,\"width\":1920}]"
}

Response Field Description

FieldTypeDescription
keyframes_infosstringKeyframe information JSON string

Error Response (4xx/5xx)

json
{
  "detail": "Error message description"
}

Usage Examples

cURL Examples

1. Basic Keyframe Information Generation

bash
curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/keyframes_infos \
  -H "Content-Type: application/json" \
  -d '{
    "ctype": "scale",
    "offsets": [0.0, 1.0],
    "values": [0.5, 1.5],
    "segment_infos": [{"id": "segment1", "start": 0, "end": 5000000}]
  }'

2. Position Keyframe Information

bash
curl -X POST https://capcut-mate.jcaigc.cn/openapi/capcut-mate/v1/keyframes_infos \
  -H "Content-Type: application/json" \
  -d '{
    "ctype": "position",
    "offsets": [0.0, 0.3, 0.7, 1.0],
    "values": [0.0, 0.2, 0.8, 1.0],
    "segment_infos": [{"id": "segment1", "start": 0, "end": 10000000}],
    "height": 1080,
    "width": 1920
  }'

Error Code Description

Error CodeError MessageDescriptionSolution
400ctype is requiredMissing keyframe type parameterProvide valid keyframe type
400offsets is requiredMissing position ratio parameterProvide valid position ratio array
400values is requiredMissing value parameterProvide valid value array
400segment_infos is requiredMissing segment information parameterProvide valid segment information array
400Array length mismatchoffsets and values array lengths don't matchEnsure both arrays have the same length
500Keyframe information generation failedInternal processing errorContact technical support

Notes

  1. Array Matching: offsets and values array lengths must be the same
  2. Time Unit: All time parameters use microseconds (1 second = 1,000,000 microseconds)
  3. Keyframe Types: Support position, scale, rotation, etc.
  4. Position Ratios: offsets values should be in range 0.0-1.0
  5. Resolution Settings: height and width parameters are used to set coordinate system

Workflow

  1. Validate required parameters (ctype, offsets, values, segment_infos)
  2. Check array length matching
  3. Validate parameter validity
  4. Generate corresponding keyframe information for each offset
  5. Apply resolution parameters
  6. Convert information to JSON string format
  7. Return processing result

Language Switch

中文版 | English