Updated on 2026-01-16 GMT+08:00

Querying Media Assets

Function

This API is used to query media assets by ID, category, status, and time range (start time and end time).

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

GET /v1.0/{project_id}/asset/info

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

asset_id

No

Array of strings

Media asset IDs. A maximum of 10 media assets can be queried at a time.

status

No

Array of strings

Media asset status.

The options include:

  • UNCREATED: The media asset has not yet been created, so no asset ID is available.

  • DELETED: The media asset has been deleted.

  • CANCELLED: The upload has been canceled.

  • SERVER_ERROR: File upload failed due to a VOD server error.

  • UPLOAD_FAILED: File upload to OBS failed.

  • CREATING: The media asset is being created.

  • PUBLISHED: The media asset has been published.

  • TRANSCODING: The media asset is to be published (being transcoded).

  • TRANSCODE_FAILED: The media asset is to be published (transcoding failed).

  • TRANSCODE_SUCCEED: The media asset is to be published (transcoding succeeded).

  • CREATED: The media file is to be published (not transcoded).

transcodeStatus

No

Array of strings

Transcoding status.

The options include:

  • TRANSCODING: The file is being transcoded.

  • TRANSCODE_FAILED: Transcoding failed.

  • TRANSCODE_SUCCEED: Transcoding succeeded.

  • UN_TRANSCODE: The file is not transcoded.

  • WAITING_TRANSCODE: The file is to be transcoded.

assetStatus

No

Array of strings

Media asset status.

The options include:

  • PUBLISHED: The media asset has been published.

  • CREATED: The media asset has not been published.

start_time

No

String

Start time. This parameter is invalid when asset_id is specified.

The format is yyyymmddhhmmss. The value must be a UTC time, without reference to any time zone.

end_time

No

String

End time. This parameter is invalid when asset_id is specified.

The format is yyyymmddhhmmss. The value must be a UTC time, without reference to any time zone.

category_id

No

Integer

Category ID.

tags

No

String

Media asset tags.

Each tag contains up to 24 characters and up to 16 tags are allowed.

Use commas (,) to separate tags. All tags must be UTF-8 encoded.

query_string

No

String

String for fuzzy search in media asset titles and descriptions.

NOTE:
Fuzzy search is inefficient when the data volume is large. This field is not recommended when the number of media assets reaches millions.

page

No

Integer

Page number. This parameter is invalid when asset_id is specified.

If this parameter is not specified or is set to null, the data on the first page will be queried by default. The default value is 0.

size

No

Integer

Number of records on each page. This parameter is invalid when asset_id is specified.

Value range: 1 to 100

Default value: 10

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when a request is sent. This parameter is mandatory for AK/SK authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

asset_info_array

Array of AssetInfo objects

Media asset information.

is_truncated

Integer

Whether the query results are truncated

The options include:

  • 1: Not all query results are returned.

  • 0: All query results are returned.

total

Integer

Total number of media assets.

NOTE:
Currently, statistics about up to 20,000 media files can be collected. To query the total number of media files, submit a service ticket.
Table 5 AssetInfo

Parameter

Type

Description

asset_id

String

Media asset ID assigned by VOD. It can only be queried but cannot be modified.

is_multi_transcode

Boolean

Whether there are multiple transcoding modes.

status

String

Media asset status.

The options include:

  • UNCREATED: The media asset has not yet been created, so no asset ID is available.

  • DELETED: The media asset has been deleted.

  • CANCELLED: The upload has been canceled.

  • SERVER_ERROR: The file upload failed due to a VOD server error.

  • UPLOAD_FAILED: File upload to OBS failed.

  • CREATING: The media asset is being created.

  • PUBLISHED: The media asset has been published.

  • WAITING_TRANSCODE: The file is to be published (to be transcoded).

  • TRANSCODING: The media asset is to be published (being transcoded).

  • TRANSCODE_FAILED: The media asset is to be published (transcoding failed).

  • TRANSCODE_SUCCEED: The media asset is to be published (transcoding succeeded).

  • CREATED: The media asset is to be published (not transcoded).

  • NO_ASSET: The media asset does not exist.

  • DELETING: The media asset is being deleted.

  • DELETE_FAILED: Deleting the media asset failed.

  • OBS_CREATING: The media asset is being created through OBS dump.

  • OBS_CREATE_FAILED: The creation of the media asset via OBS dump has failed.

  • OBS_CREATE_SUCCESS: The media asset has been created through OBS dump.

description

String

Media file substatus or description.

  • For exceptional scenarios, this parameter describes the specific error cause.

  • For normal scenarios, this parameter provides information about the media asset processing.

base_info

BaseInfo object

Basic media file information.

play_info_array

Array of PlayInfo objects

Playback information about the transcoded file.

  • HLS or DASH: The array contains n + 1 members, where n indicates the number of transcoding output channels.

  • MP4: The array contains n members, where n indicates the number of transcoding output channels.

Table 6 BaseInfo

Parameter

Type

Description

title

String

Media asset title.

The value is UTF-8 encoded and contains a maximum of 128 characters.

video_name

String

Media asset file name.

description

String

Media asset description.

The value contains a maximum of 1,024 characters.

category_id

Long

Media asset category ID.

category_name

String

Media asset category name.

create_time

String

Time when the media asset was created.

The format is yyyymmddhhmmss. The value must be a UTC time, without reference to any time zone.

last_modified

String

Time when the media asset was last modified.

The format is yyyymmddhhmmss. The value must be a UTC time, without reference to any time zone.

video_type

String

Audio/Video file type.

The options include:

  • Video: MP4, TS, MOV, MXF, MPG, FLV, WMV, AVI, M4V, F4V, MPEG, 3GP, ASF, MKV, and WebM

  • Audio: MP3, OGG, WAV, WMA, APE, FLAC, AAC, AC3, MMF, AMR, M4A, M4R, WV, and MP2

tags

String

Media asset tags.

Each tag contains up to 24 characters and up to 16 tags are allowed.

Use commas (,) to separate tags. All tags must be UTF-8 encoded.

meta_data

MetaData object

Video metadata.

It is generated after video parsing, including the packaging format, size, resolution, bitrate, and frame rate.

video_url

String

URL for accessing the original video file.

sign_url

String

Temporary access URL of the original video file in OBS. A specific value is returned only when the API for querying a media asset is called.

cover_info_array

Array of CoverInfo objects

Thumbnail information.

subtitle_info

Array of SubtitleInfo objects

Subtitle information array.

source_path

File_addr object

Media asset storage parameters.

output_path

File_addr object

Media asset storage parameters.

Table 7 CoverInfo

Parameter

Type

Description

cover_url

String

URL for downloading the thumbnail file.

Table 8 SubtitleInfo

Parameter

Type

Description

url

String

URL for downloading the subtitle file.

id

Integer

Subtitle file ID.

type

String

Subtitle file format. Currently, only SRT and VTT are supported.

language

String

Subtitle file language.

Table 9 File_addr

Parameter

Type

Description

bucket

String

OBS bucket name.

location

String

Name of the region where the bucket is located. For example, the region name of CN North-Beijing4 is cn-north-4. The created bucket must be in the same region as VOD.

object

String

File storage path.

Table 10 PlayInfo

Parameter

Type

Description

play_type

String

Playback protocol type.

The options include:

  • hls

  • dash

  • mp4

group_id

String

Transcoding group ID.

group_name

String

Transcoding group name.

url

String

Streaming URL.

encrypted

Integer

Whether the stream is encrypted.

The options include:

  • 0: not encrypted

  • 1: encrypted

Default value: 0

meta_data

MetaData object

Video metadata.

It is generated after video parsing, including the packaging format, size, resolution, bitrate, and frame rate.

Table 11 MetaData

Parameter

Type

Description

pack_type

String

Video packaging format.

The options include:

  • MP4

  • TS

  • MOV

  • MXF

  • MPG

  • FLV

  • WMV

  • MP3

  • WMA

  • APE

  • FLAC

  • AAC

  • AC3

  • MMF

  • AMR

  • M4A

  • M4R

  • OGG

  • WAV

  • WV

  • MP2

  • AVI

  • F4V

  • M4V

  • MPEG

  • HLS

  • DASH

codec

String

Video encoding format.

The options include:

  • MPEG-2

  • MPEG-4

  • H.264

  • H.265

  • WMV

  • Vorbis

  • AAC

  • AC-3

  • AMR

  • APE

  • FLAC

  • MP3

  • MP2

  • WMA

  • PCM

  • ADPCM

  • WavPack

NOTE:
If unknown is returned for codec, the current audio/video encoding format sent by the user cannot be parsed.

duration

Long

Audio duration, in seconds.

If the original video duration is not an integer, the value of this field is rounded down.

If the original video duration is shorter than 1 second, the value of this field is 1.

duration_ms

Long

Video duration, in milliseconds.

video_size

Long

Video file size.

Unit: bytes

width

Long

Video width, in pixels.

  • Possible values for H.264: a multiple of 2 between 32 and 3,840

  • Possible values for H.265: a multiple of 4 between 320 and 3,840

hight

Long

Video height, in pixels.

  • Possible values for H.264: a multiple of 2 between 32 and 2,160

  • Possible values for H.265: a multiple of 4 between 240 and 2,160

height

Long

Video height, in pixels.

bit_rate

Long

Average video bitrate.

frame_rate

Long

Frame rate, in frames per second (FPS).

quality

String

Definition.

The options include:

  • FULL_HD: ultra-high-definition (UHD)

  • HD: high definition (HD)

  • SD: standard definition (SD)

  • FLUENT: smooth

  • AD: adaptive

  • 2K

  • 4K

audio_channels

Integer

Number of audio channels.

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

  • This example queries a media asset by its ID.

    GET
    /v1.0/{project_id}/asset/info?asset_id=652c1e4085afeb22fdc256c6757d751b
  • This example queries media assets by their IDs.

    GET /v1.0/{project_id}/asset/info?asset_id=652c1e4085afeb22fdc256c6757d751b&asset_id=xxxxxx&asset_id=xxxxxx
  • This example queries media assets by time range.

    GET /v1.0/{project_id}/asset/info?start_time=20170725181000&end_time=20170726181000&page=0&size=20
  • This example queries the most recent 10 media assets of the current tenant. Results start at page 0 with 10 records per page.

    GET /v1.0/{project_id}/asset/info
  • This example queries the 21st to 40th most recent media assets of the current tenant.

    GET /v1.0/{project_id}/asset/info?page=1&size=20
  • This example queries media assets by category.

    GET /v1.0/{project_id}/asset/info?category_id=100

Example Responses

Status code: 200

Returned when the request succeeded.

{
  "asset_info_array" : [ {
    "asset_id" : "652c1e4085afeb22fdc256c6757d751b",
    "status" : "PUBLISHED",
    "description" : "Asset meta is published",
    "is_multi_transcode" : false,
    "base_info" : {
      "title" : "okFLV.flv",
      "video_name" : "okFLV.flv",
      "description" : null,
      "category_id" : -1,
      "category_name" : "Other",
      "create_time" : "20190704144303",
      "last_modified" : "20190704144303",
      "video_type" : "FLV",
      "tags" : null,
      "meta_data" : {
        "pack_type" : null,
        "codec" : "H.264",
        "duration" : 244,
        "duration_ms" : 244000,
        "video_size" : 13682041,
        "width" : 512,
        "hight" : 288,
        "height" : 288,
        "bit_rate" : 448,
        "frame_rate" : 30,
        "quality" : null
      },
      "video_url" : "https://651.cdn-vod.huaweicloud.com/asset/652c1e4085afeb22fdc256c6757d751b/45c2493abe68de3dac7e98b0dadcf8ce.flv",
      "sign_url" : "",
      "cover_info_array" : [ {
        "cover_url" : "https://651.cdn-vod.huaweicloud.com/asset/652c1e4085afeb22fdc256c6757d751b/cover/Cover0.jpg"
      } ],
      "subtitle_info" : [ ],
      "source_path" : {
        "bucket" : "obs-host",
        "location" : "cn-north-4",
        "object" : "1/okFLV.flv"
      },
      "output_path" : {
        "bucket" : "obs-host",
        "location" : "cn-north-4",
        "object" : "output/652c1e4085afeb22fdc256c6757d751b/"
      }
    },
    "play_info_array" : [ {
      "play_type" : "hls",
      "url" : "https://651.cdn-vod.huaweicloud.com/asset/652c1e4085afeb22fdc256c6757d751b/play_video/index.m3u8",
      "encrypted" : 0,
      "meta_data" : {
        "pack_type" : null,
        "codec" : "H.264",
        "duration" : 0,
        "duration_ms" : 0,
        "video_size" : 0,
        "width" : 0,
        "hight" : 0,
        "height" : 0,
        "bit_rate" : 0,
        "frame_rate" : 0,
        "quality" : null
      }
    }, {
      "play_type" : "hls",
      "url" : "https://651.cdn-vod.huaweicloud.com/asset/652c1e4085afeb22fdc256c6757d751b/play_video/b5d498082bbcff7a2055041d803ae2f9_1.m3u8",
      "encrypted" : 0,
      "meta_data" : {
        "pack_type" : null,
        "codec" : "H.264",
        "duration" : 205,
        "duration_ms" : 205000,
        "video_size" : 14669824,
        "width" : 512,
        "hight" : 288,
        "height" : 288,
        "bit_rate" : 534,
        "frame_rate" : 0,
        "quality" : null
      }
    } ]
  } ],
  "is_truncated" : 0,
  "total" : 1
}

Status code: 400

Returned when the request failed.

{
  "error_code" : "VOD.10053",
  "error_msg" : "The request parameter is illegal, illegal field: {xx}."
}

Status Codes

Status Code

Description

200

Returned when the request succeeded.

400

Returned when the request failed.

Error Codes

See Error Codes.