All Products
Search
Document Center

Intelligent Media Services:SearchMediaClipByFace

Last Updated:Mar 30, 2026

The API for searching media asset segments by face image (fine search) returns information about relevant character segments in the media asset where the face appears, based on coarse search results.

Operation description

For questions about using or troubleshooting the Intelligent Media Search feature of Alibaba Cloud Intelligent Media Services, please search for the DingTalk group (30415005038) and join the Intelligent Media Services multimodal search Customer Support DingTalk group to contact us.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ice:SearchMediaClipByFace

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

SearchLibName

string

No

The name of the search library.

test1

PageNo

integer

No

The page number. Default value: 1.

1

PageSize

integer

No

The number of entries per page. Default value: 10. Maximum value: 50.

10

EntityId

string

No

The ID of the entity.

2d3bf1e35a1e42b5ab338d701efa****

FaceSearchToken

string

Yes

The value of this parameter is the same as that of the FaceSearchToken parameter in the SearchMediaByFace request. This specifies to return media asset clips that meet the same query conditions.

zxtest-huangxuan-2023-3-7-V1

MediaId

string

Yes

The ID of the media asset.

3b187b3620c8490886cfc2a9578c****

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

E44FFACD-9E90-555A-A09A-6FD3B7335E39

Success

string

Indicates whether the request was successful. Valid values: true and false.

true

Code

string

The status code returned.

200

MediaClipList

array<object>

The media asset clips that meet the requirements.

array<object>

Score

number

The score of the clip. The value is of the Float type. The value is in the range of [0,1].

0.99041677

EntityId

string

The ID of the entity, which is the same as the entity ID returned in tag analysis.

1031025****

LabelName

string

The name of the entity.

Zhang San

OccurrencesInfos

array<object>

The information about clips related to the face.

array<object>

StartTime

number

The start time of the clip. Unit: seconds. The value is of the Float type.

61.066353

EndTime

number

The end time of the clip. Unit: seconds. The value is of the Float type.

69.06635

TrackData

array<object>

The information about the face in the clip.

array<object>

Timestamp

number

The timestamp when the face appears in the clip. Unit: seconds. The value is of the Float type.

62.03302

BoxPosition

object

The coordinates of the face.

X

integer

The x-axis coordinate of the upper-left corner. Unit: pixels.

517

Y

integer

The y-axis coordinate of the upper-left corner. Unit: pixels.

409

W

integer

The width of the rectangle frame. Unit: pixels.

128

H

integer

The height of the rectangle frame. Unit: pixels.

168

Expression

string

Expression.

Calm

Category

string

The type of the character. Valid values: celebrity sensitive politician custom unknown

celebrity

Total

integer

The total number of media asset clips that meet the conditions.

5

Examples

Success response

JSON format

{
  "RequestId": "E44FFACD-9E90-555A-A09A-6FD3B7335E39",
  "Success": "true",
  "Code": "200",
  "MediaClipList": [
    {
      "Score": 0.99041677,
      "EntityId": "1031025****",
      "LabelName": "John Doe",
      "OccurrencesInfos": [
        {
          "StartTime": 61.066353,
          "EndTime": 69.06635,
          "TrackData": [
            {
              "Timestamp": 62.03302,
              "BoxPosition": {
                "X": 517,
                "Y": 409,
                "W": 128,
                "H": 168
              }
            }
          ],
          "Expression": "Calm"
        }
      ],
      "Category": "celebrity"
    }
  ],
  "Total": 5
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.