Publishing Media Assets
Function
This API is used to publish media assets, changing their status to published. Media assets can be published in batches.
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
POST /v1.0/{project_id}/asset/status/publish
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
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 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. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
asset_id |
Yes |
Array of strings |
Media asset ID assigned by VOD. It can only be queried but cannot be modified. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
asset_info_array |
Array of AssetInfo objects |
Information about published media assets. |
|
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:
|
|
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 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:
|
|
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. |
|
Parameter |
Type |
Description |
|---|---|---|
|
cover_url |
String |
URL for downloading the thumbnail file. |
|
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. |
|
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. |
|
Parameter |
Type |
Description |
|---|---|---|
|
play_type |
String |
Playback protocol type. The options include:
|
|
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:
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 packaging format. The options include:
|
|
codec |
String |
Video encoding format. The options include:
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.
|
|
hight |
Long |
Video height, in pixels.
|
|
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:
|
|
audio_channels |
Integer |
Number of audio channels. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
This example publishes a media asset.
POST https://{endpoint}/v1.0/{project_id}/asset/status/publish
Content-Type: application/json
{
"asset_id": [
"f488337c31c8e4622f1590735b134c65",
"07ba4d46463355e800c2f42f628f0631"
]
}
Example Responses
Status code: 200
Returned when the request succeeded.
{
"asset_info_array" : [ {
"asset_id" : "f488337c31c8e4622f1590735b134c65",
"status" : "UNCREATED",
"description" : "Asset meta download fail, errorCode is VOD.100021010,\nerrorMsg is Internal server communication is abnormal",
"base_info" : {
"title" : "Avatar test test",
"video_name" : "Avatar_480P.mp4",
"description" : "Avatar, test",
"category_id" : -1,
"category_name" : "Other",
"create_time" : "20180209024019",
"last_modified" : "20180209024019",
"video_type" : "MP4",
"tags" : "mytags"
}
}, {
"asset_id" : "07ba4d46463355e800c2f42f628f0631",
"status" : " UNCREATED",
"description" : "no asset"
} ]
}
Status code: 403
Returned when the request failed.
{
"error_code" : "VOD.10062",
"error_msg" : "Media asset or resource does not exist, please check."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Returned when the request succeeded. |
|
403 |
Returned when the request failed. |
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