All Products
Search
Document Center

Media asset search protocol

Last Updated: Jul 11, 2019

Description

This topic describes the syntax of the ApsaraVideo for VOD media asset search protocol. The protocol needs to be used together with the SearchMedia operation. This protocol is a real-time search protocol that integrates retrieval, filtering, sorting, and page flip features. It can be used to search for media asset information generated by ApsaraVideo for VOD, including video, audio, and image information.

Syntax

Based on syntax rules defined in the media asset search protocol, media asset fields are classified into Response field, Exact match, Fuzzy match, Multi-value query, Range query, and Sorting field. For more information about all media asset fields supported by ApsaraVideo for VOD and applicable syntax rules, see Media.

Note: When you call an API, you need to perform URL encoding for the query statement and use single-byte punctuation marks, such as the equal sign (=), double quotation marks (" "), single quotation marks (' '), and parentheses ( ). For more information about special characters defined in the media asset search protocol, see Special characters.

The following table lists the syntax defined in the media asset search protocol and examples.

Parameter Description Syntax Example
Response field Specifies the fields returned in the query results. Only the media ID, creation time, and media type are returned by default. field1,field2 Response field
Exact match Searches for media asset information that exactly matches the specified field value. field = value Exact match
Fuzzy match Searches for media asset information that contains the specified characters or string. field in ('value1','value2') or field = 'value' Fuzzy match
Multi-value query Specifies multiple field values to search for media asset information that matches one of the specified field values. field in ('value1','value2') Multi-value query
Range query Specifies an open or closed interval to search for media asset information that matches a field value in the specified range. field = (value1,value2) Range query
Sorting field Specifies the sorting fields used to sort the queried results and the sorting order (Desc or Asc) for each sorting field. Multiple sorting fields are listed from left to right based on their priorities in descending order. SortBy=field:Desc Sorting field

Special characters

Parameter Description Syntax
and Connects two filter criteria to search for media asset information that meets both filter criteria. field1 = 'value' and field2 = 'value '
or Connects two filter criteria to search for media asset information that meets either filter criterion. In this case, the filter criteria start with the left parenthesis "(" and end with the right parenthesis ")". (field1 = 'value1' or field2 = 'value2')
( ) The parentheses. They specify a range of field values to be queried in a range query. field = ('value1','value2')
( ) The parentheses. They specify the OR relationship between multiple filter criteria. (field1 = 'value1' or field2 = 'value2')
' ' The single quotation marks. They specify a string as the field value to be queried. The specified string starts with a single quotation mark (') and ends with a single quotation mark ('). field = 'value '
, The comma. This parameter is used for multi-value query. This parameter separates multiple field values to be queried in a multi-value query. field in ('value1','value2')
( ) [] Specifies an open or closed interval for a range query to indicate whether the endpoints of the interval are included in or excluded from the specified range. field = ['value1','value2']
in Specifies multiple field values to be queried in a multi-value query to search for media asset information that matches one of the specified field values. field in ('value1','value2')

Media

Currently, ApsaraVideo for VOD allows you to search for video, audio, and image information. The following tables list the syntax supported by various media asset fields.

Video

Note: You can specify a maximum of 100 video IDs to be queried in a multi-value query.

Parameter Type Description Response field Exact match Fuzzy match Multi-value query Range query Sorting field
VideoId String The ID of the video.
AppId String The ID of the application.
CateId Long The ID of the category.
CateName String The name of the category.
StorageLocation String The bucket.
Title String The title of the video.
Tags String The tag of the video.
Description String The description of the video.
Status String The video status.
MediaSource String The video source.
PreprocessStatus String The preprocessing status.
Size Long The video size.
Duration Float The video duration.
CreationTime String The time when the video information was created.
ModificationTime String The time when the video information was last modified.
CoverURL String The URL of the video thumbnail.
Snapshots String[] The list of automatic snapshots.
SpriteSnapshots String[] The list of sprite snapshots.
DownloadSwitch String The download switch.
TranscodeMode String The transcoding mode.

Audio

Parameter Type Description Response field Exact match Fuzzy match Multi-value query Range query Sorting field
AudioId String The ID of the audio.
AppId String The ID of the application.
CateId Long The ID of the category.
CateName String The name of the category.
StorageLocation String The bucket.
Title String The title of the audio.
Tags String The tag of the audio.
Description String The description of the audio.
Status String The audio status.
MediaSource String The audio source.
PreprocessStatus String The preprocessing status.
Size Long The audio size.
Duration Float The audio duration.
CreationTime String The time when the audio information was created.
ModificationTime String The time when the audio information was last modified.
CoverURL String The URL of the audio thumbnail.
Snapshots String[] The list of automatic snapshots.
SpriteSnapshots String[] The list of sprite snapshots.
DownloadSwitch String The download switch.
TranscodeMode String The transcoding mode.

Image

Parameter Type Description Response field Exact match Fuzzy match Multi-value query Range query Sorting field
ImageId String The ID of the image.
AppId String The ID of the application.
CateId Long The ID of the category.
CateName String The name of the category.
StorageLocation String The bucket.
FileName String The file name of the image.
Title String The title of the image.
Tags String The tag of the image.
Description String The description of the image.
Status String The image status.
CreationTime String The time when the image information was created.
ModificationTime String The time when the image information was last modified.
URL String The URL of the image.

AttachedMedia

Parameter Type Description Response field Exact match Fuzzy match Multi-value query Range query Sorting field
MediaId String The ID of the attached media asset.
AppId String The ID of the application.
CateId Long The ID of the category.
Categories Category[] The category ID list.
StorageLocation String The bucket.
FileName String The file name of the attached media asset.
Title String The title of the attached media asset.
Tags String The tags of the attached media asset.
Description String The description of the attached media asset.
Status String The status of the attached media asset.
CreationTime String The time when the attached media asset was created.
ModificationTime String The time when the attached media asset was last modified.
URL String The URL of the attached media asset.

PreprocessStatus

Specifies the preprocessing status. Only preprocessed videos can be played as live streams in the production studio.

Value Description Remarks
UnPreprocess Indicates that the video has not been processed. The initial status.
Preprocessing Indicates that the video is being preprocessed. -
PreprocessSucceed Indicates that the video has been preprocessed. -
PreprocessFailed Indicates that the video fails to be preprocessed. -

DownloadSwitch

Specifies the offline download switch. A video or audio can be downloaded in offline mode only when the download switch is turned on.

Value Description Remarks
on Indicates that the switch is turned on. The initial status, in which the video or audio can be downloaded in offline mode.
off Indicates that the switch is turned off. The video or audio cannot be downloaded in offline mode.

MediaSource

Specifies the media source.

Value Description Remarks
general Indicates that the media file is uploaded to ApsaraVideo for VOD in simple upload mode. -
short_video Indicates that the media file is uploaded to ApsaraVideo for VOD through a short video SDK. For more information, see Short video SDK.
editing Indicates that the media file is uploaded to ApsaraVideo for VOD through a video production task. For more information, see ProduceEditingProjectVideo.
live Indicates that the media file is uploaded to ApsaraVideo for VOD through live stream recording. -

TranscodeMode

Specifies the transcoding mode. After a media file is uploaded to ApsaraVideo for VOD, it can be played depending on the processing logic. The processing method varies in different transcoding modes.

Value Description Remarks
FastTranscode Indicates normal transcoding. The default mode in which the media file is transcoded immediately after being uploaded and can be played only after transcoding.
NoTranscode Indicates distribution without transcoding. The media file is not transcoded after being uploaded and can be immediately played without transcoding.
AsyncTranscode Indicates distribution with transcoding. The media file can be played immediately and transcoded asynchronously after being uploaded.