Querying Packaging Tasks
Function
This API is used to query one or more packaging tasks.
URI
GET /v1/{project_id}/remux
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
task_id |
No |
Array |
Task ID. A maximum of 10 task IDs can be queried at a time. |
|
status |
No |
String |
Task status. Possible values are:
|
|
start_time |
No |
String |
Start time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
|
end_time |
No |
String |
End time. If task_id is specified, this parameter is invalid. Its format is yyyymmddhhmmss. The value must be a UTC time irrelevant to the time zone. |
|
input_bucket |
No |
String |
Input bucket |
|
input_object |
No |
String |
Input object name |
|
page |
No |
Integer |
Page number. If task_id is specified, this parameter is invalid. Default value: 0. |
|
size |
No |
Integer |
Number of records on each page. If task_id is specified, this parameter is invalid. The value ranges from 1 to 100. Default value: 10 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
User token. The token is obtained by calling the IAM API used to obtain a user token. The token is the value of X-Subject-Token in the response header. |
|
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. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
total |
Integer |
Total number of tasks |
|
tasks |
Array of RemuxTask objects |
Task list |
|
Parameter |
Type |
Description |
|---|---|---|
|
task_id |
String |
Task ID |
|
status |
String |
Task status. Possible values are:
|
|
create_time |
String |
Time when a task is created |
|
start_time |
String |
Task start time |
|
end_time |
String |
Task end time |
|
description |
String |
Error description |
|
input |
ObsObjInfo object |
Input file information |
|
output |
ObsObjInfo object |
Output file information |
|
user_data |
String |
User data |
|
output_param |
RemuxOutputParam object |
Animated GIF parameters |
|
complete_ratio |
Integer |
Task completion progress, in percentage |
|
output_metadata |
MetaData object |
Metadata of the output file. |
|
Parameter |
Type |
Description |
|---|---|---|
|
bucket |
String |
OBS bucket name |
|
location |
String |
Region where an OBS bucket is located. It must be the same as the region where MPC is deployed. |
|
object |
String |
File path.
|
|
file_name |
String |
Name of an output file. This parameter is valid only for packaging tasks.
|
|
Parameter |
Type |
Description |
|---|---|---|
|
format |
String |
Output format. Possible values:
|
|
segment_duration |
Integer |
Segment duration. This parameter is used only when format is HLS. The value ranges from 2 to 10. Default value: 5 Unit: second |
|
Parameter |
Type |
Description |
|---|---|---|
|
size |
Long |
File size |
|
duration_ms |
Double |
Video duration (unit: second), with decimal places. |
|
duration |
Long |
Video duration Unit: s |
|
format |
String |
File container format |
|
bitrate |
Long |
Total bitrate. Unit: bit/s. |
|
video |
Array of VideoInfo objects |
Video metadata |
|
audio |
Array of AudioInfo objects |
Audio metadata |
|
Parameter |
Type |
Description |
|---|---|---|
|
width |
Integer |
Video width |
|
height |
Integer |
Video height |
|
bitrate |
Integer |
Video bitrate, in kbit/s |
|
bitrate_bps |
Long |
Video bitrate, in bit/s |
|
frame_rate |
Integer |
Frame rate. The value is 0 or ranges from 5 to 60. The value 0 indicates adaptive frame rate. Unit: FPS
NOTE:
If the configured frame rate is not within the value range, the value is automatically changed to 0. If the configured frame rate is higher than the frame rate of the input file, the value is automatically changed to the frame rate of the input file. |
|
codec |
String |
Video codec |
|
Parameter |
Type |
Description |
|---|---|---|
|
codec |
String |
Audio codec |
|
sample |
Integer |
Audio sampling rate |
|
channels |
Integer |
Number of audio channels |
|
bitrate |
Integer |
Audio bitrate, in kbit/s |
|
bitrate_bps |
Long |
Audio bitrate, in bit/s |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code |
|
error_msg |
String |
Error description |
Example Requests
GET https://{endpoint}/v1/{project_id}/remux?task_id=10743
Example Responses
Status code: 200
Packaging task queried successfully.
{
"total" : 1,
"tasks" : [ {
"task_id" : 10743,
"status" : "SUCCEED",
"create_time" : 20201117021558,
"start_time" : 20201117021558,
"end_time" : 20201117021559,
"description" : "The task has completed.",
"input" : {
"bucket" : "obs-apitest-01",
"location" : "cn-north-5",
"object" : "flv/flv.flv"
},
"output" : {
"bucket" : "obs-apitest-01",
"location" : "cn-north-5",
"object" : "out_gamma/remux/ucAMb.mp4",
"file_name" : "bf00ba898a3dfb3560a292fd87f790db.mp4"
},
"user_data" : 1795687,
"output_param" : {
"format" : "MP4",
"segment_duration" : 5,
"remove_meta" : false
},
"complete_ratio" : 100,
"output_metadata" : {
"size" : 3189068,
"duration_ms" : 25.48,
"duration" : 25,
"format" : "mp4",
"bitrate" : 977,
"video" : [ {
"width" : 1920,
"height" : 1080,
"bitrate" : 977,
"bitrate_bps" : 1001277,
"frame_rate" : 25,
"codec" : "H.264"
} ],
"audio" : [ {
"sample" : 48000,
"channels" : 2,
"bitrate" : 0,
"bitrate_bps" : 0
} ]
}
} ]
}
Status code: 400
Failed to query the packaging task.
{
"error_code" : "MPC.10202",
"error_msg" : "Invalid request parameter."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Packaging task queried successfully. |
|
400 |
Failed to query the packaging task. |
Error Codes
See Error Codes.
Last Article: Retrying a Packaging Task
Next Article: Canceling a Packaging Task
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.