Queries media asset information
Function
Queries media asset information by ID, category, status, start time and end time
URI
GET /v1.0/{project_id}/asset/info
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
asset_id |
No |
Array |
Media ID. A maximum of 10 media assets can be queried at a time. |
status |
No |
Array |
Media file status Possible values are:
|
transcodeStatus |
No |
Array |
Transcoding status Possible values are:
|
assetStatus |
No |
Array |
Media file status Possible values are:
|
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 irrelevant to the 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 irrelevant to the time zone. |
category_id |
No |
Integer |
Category ID |
tags |
No |
String |
Media file tag Each tag contains up to 16 characters and up to 16 tags are allowed. Use commas (,) to separate tags. The values are UTF-8-encoded. |
query_string |
No |
String |
String for fuzzy search in the media asset title and description |
page |
No |
Integer |
Page number. This parameter is invalid when asset_id is specified. Default value: 0 |
size |
No |
Integer |
Number of records on each page. This parameter is invalid when asset_id is specified. The value ranges from 1 to 100. Default value: 10 |
Request 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 a token. |
Authorization |
No |
String |
Authentication information. This parameter is mandatory for AK/SK authentication. |
X-Sdk-Date |
No |
String |
Time when the request is sent. This parameter is mandatory for AK/SK authentication. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
asset_info_array |
Array of AssetInfo objects |
Media asset information list |
is_truncated |
Integer |
Whether the query results are truncated Possible values are:
|
total |
Integer |
Queries the total number of media files>Currently, statistics about up to 20,000 media files can be collected. To query the total number of media files, submit a service ticket. |
Parameter |
Type |
Description |
---|---|---|
asset_id |
String |
Media asset ID assigned by VOD. This parameter can only be queried but cannot be modified. |
is_multi_transcode |
Boolean |
Whether there are multiple transcoding modes. |
status |
String |
Media file status Possible values are:
|
description |
String |
Media file substatus or description
|
base_info |
BaseInfo object |
Basic media file information. |
play_info_array |
Array of PlayInfo objects |
Playback information about the transcoded file
|
Parameter |
Type |
Description |
---|---|---|
title |
String |
Media file title The value is UTF-8-encoded and contains a maximum of 128 characters. |
video_name |
String |
Media asset file name |
description |
String |
Media file description The value contains a maximum of 1024 characters. |
category_id |
Long |
Media asset category ID |
category_name |
String |
Media asset category name |
create_time |
String |
Time when the media file was created The format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
last_modified |
String |
Time when the media file was last modified The format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
video_type |
String |
Audio/Video file type Possible values are:
|
tags |
String |
Media file tag Each tag contains up to 16 characters and up to 16 tags are allowed. Use commas (,) to separate tags. The values are 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 File Information is called. |
cover_info_array |
Array of CoverInfo objects |
Cover 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. |
Parameter |
Type |
Description |
---|---|---|
url |
String |
URL for downloading the subtitle file |
id |
Integer |
Subtitle file ID |
type |
String |
Subtitle file type |
language |
String |
Subtitle file language |
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 region of the VOD service. |
object |
String |
File path |
Parameter |
Type |
Description |
---|---|---|
play_type |
String |
Playback protocol type Possible values are:
|
group_id |
String |
Transcoding group ID. |
group_name |
String |
Transcoding group name. |
url |
String |
Streaming URL |
encrypted |
Integer |
Whether the stream is encrypted Possible values are:
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. |
Parameter |
Type |
Description |
---|---|---|
pack_type |
String |
Video container format Possible values are:
|
codec |
String |
Video encoding format. Options:
NOTE:
If unknown is returned for codec, the current audio/video encoding format sent by the user cannot be parsed. |
duration |
Long |
Video duration. If the value of the original video duration is not an integer, the value of this field is rounded up. |
video_size |
Long |
Video file size Unit: byte |
width |
Long |
Video width, in pixels
|
hight |
Long |
Video height, in pixels.
|
bit_rate |
Long |
Average video bitrate |
frame_rate |
Long |
Frame rate, in FPS Possible values are:
Unit: FPS |
quality |
String |
Definition Possible values are:
|
audio_channels |
Integer |
Number of audio channels |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error description |
Example Requests
-
Queries one media ID
GET /v1.0/{project_id}/asset/info?asset_id=652c1e4085afeb22fdc256c6757d751b
-
Queries multiple media IDs
GET /v1.0/{project_id}/asset/info?asset_id=652c1e4085afeb22fdc256c6757d751b&asset_id=xxxxxx&asset_id=xxxxxx
-
Performs query by time segment
GET /v1.0/{project_id}/asset/info?start_time=20170725181000&end_time=20170726181000&page=0&size=20
-
Queries the latest 10 media assets of the current tenant. Page defaults to 0 and size defaults to 10.
GET /v1.0/{project_id}/asset/info
-
Queries the latest 21st to 40th media assets of the current tenant
GET /v1.0/{project_id}/asset/info?page=1&size=20
-
Performs query by category
GET /v1.0/{project_id}/asset/info?category_id=100
Example Responses
Status code: 200
The information is returned when the request succeeds.
{ "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, "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, "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, "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
The information is returned when the request fails.
{ "error_code" : "VOD.10053", "error_msg" : "The request parameter is illegal, illegal field: {xx}." }
Status Codes
Status Code |
Description |
---|---|
200 |
The information is returned when the request succeeds. |
400 |
The information is returned when the request fails. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot