Creating a Video Parsing Task
Function
This API is used to create a task to parse the metadata of a video file.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/extract-metadata
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. (tag:hc,hk) Project ID. For details about how to obtain the project ID, see [Obtaining a Project ID]. (tag:hcso,g42,cmcc) |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
User token The token 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 when AK/SK-based authentication is used. |
X-Project_Id |
No |
String |
Project ID. This parameter is mandatory when AK/SK-based authentication is used. It is same as the project ID in path parameters. |
X-Sdk-Date |
No |
String |
Time when the request is sent. This parameter is mandatory when AK/SK-based authentication is used. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
input |
No |
ObsObjInfo object |
Input file information.
NOTE:
Videos in M3U8 format cannot be converted to animated GIFs, perform synchronous parsing or snapshot capturing. |
output |
No |
ObsObjInfo object |
Output file information |
user_data |
No |
String |
Custom user data |
sync |
No |
Integer |
Whether to enable synchronous processing.
Default value: 0 |
encryption |
No |
Encryption object |
Video encryption parameter. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
hls_encrypt |
No |
HlsEncrypt object |
Encryption parameters for HLS videos |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Base64-encoded content encryption key |
url |
Yes |
String |
The key carries the service address, and can be decrypted to play HLS segments. |
iv |
No |
String |
Initial vector, which is a random number in base64Binary format |
algorithm |
No |
String |
Encryption algorithm. Possible values: Default value: AES-128-CTR |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
task_id |
String |
Task ID. |
status |
String |
Task status. |
create_time |
String |
Task creation time. |
output |
ObsObjInfo object |
Output file information. |
output_file_name |
String |
Output file name. |
description |
String |
Task description. If a task is abnormal, this parameter indicates error details. |
metadata |
MetaData object |
Metadata of a video file. |
Parameter |
Type |
Description |
---|---|---|
size |
Long |
File size Unit: byte |
duration_ms |
Double |
Video duration, with decimal places Unit: second |
duration |
Long |
Video duration Unit: second |
format |
String |
File container format |
md5 |
String |
The MD5 value of the video. |
bitrate |
Long |
Total bitrate Unit: bit/s |
video |
Array of VideoInfo objects |
Video metadata |
audio |
Array of AudioInfo objects |
Audio metadata |
Parameter |
Type |
Description |
---|---|---|
codec |
String |
Audio codec |
sample |
Integer |
Audio sampling rate |
channels |
Integer |
Number of audio channels |
bitrate |
Integer |
Audio bitrate Unit: kbit/s |
bitrate_bps |
Long |
Audio bitrate Unit: bit/s |
duration |
String |
Audio stream duration, unit: seconds |
duration_ms |
String |
Audio stream duration, unit: milliseconds |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error description |
Example Requests
Creates a task to parse the metadata of a video file.
POST https://{endpoint}/v1/{project_id}/extract-metadata { "input" : { "bucket" : "example-bucket", "location" : "region01", "object" : "example-path/input.flv" }, "output" : { "bucket" : "example-bucket", "location" : "region01", "object" : "example-path/output" }, "sync" : 0 }
Example Responses
Status code: 400
Failed to create a video parsing task.
{ "error_code" : "MPC.10202", "error_msg" : "Invalid request parameter." }
Status Codes
Status Code |
Description |
---|---|
200 |
Video parsing task created successfully. |
400 |
Failed to create a video parsing task. |
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