You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Video transcoding
QueryMediaJob
Copy page
Download PDF
QueryMediaJob
Description​
This interface queries the processing status of asynchronous audio and video tasks.​
Notes​
  • Querying asynchronous audio and video tasks only supports synchronous processing (x-tos-process method).​
  • You must have the relevant permissions required for GetDataProcessJob data processing.​
Request syntax​
​
GET /?job_type=Transcode&job_id=183535129563a53bfa71000188********** HTTP/1.1​
Host: <bucket_name>.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: <authorization_string>​
​
Request parameters and headers ​
For common request headers, see Common parameters.​
​
Field name​
Location​
Type​
Required​
Example value​
Description​
job_type​
Query​
String​
Yes​
Transcode​
Audio-video task type. The currently supported query task types are:​
  • Transcode​
  • Remux​
  • Animation​
job_id​
Query​
String​
Yes​
183535129563a53bfa71000188**********​
Audio and video task ID.​
​
Request body elements​
No elements are used.​
Response headers​
The response contains common headers. For more information, see Common Parameters.​
Response body elements​
Common elements​
​
Field name​
Type​
Example value​
Description​
JobID​
String​
fa81ef2a00a2211f08a9aa5**********​
Task ID.​
CreateTime​
String​
2025-11-18T20:32:54+08:00​
Task creation time.​
StartTime​
String​
2025-11-18T20:32:55+08:00​
Task start time.​
EndTime​
String​
2025-11-18T20:32:55+08:00​
Task end time.​
State​
String​
Success​
Task status.​
Code​
Integer​
0​
Task status code.​
Message​
String​
Success​
Task status message.​
Input​
Container​
-​
Input file.​
Object​
String​
​
sample.mp4​
Input file object name.​
Parent node: Input.​
Output​
Container​
-​
Output file.​
Region​
String​
cn-beijing​
The region where the output file bucket is located.​
Parent node: Output.​
Bucket​
String​
testbkt​
Output file bucket name.​
Parent node: Output.​
Object​
String​
output.mp4​
Output file object name.​
Parent node: Output.​
​
Additional elements returned when the task type is Transcode​
​
Field name​
Type​
Example value​
Description​
TranscodeConfig​
Container​
-​
Specific configuration for video transcoding.​
Transcode​
Container​
-​
Specific configuration for video transcoding.​
Parent node: TranscodeConfig.​
TimeInterval​
Container​
-​
Specify the time segment for video transcoding.​
Parent node: Transcode.​
Start​
Integer​
0​
Video start time in milliseconds.​
Parent node: TimeInterval.​
Duration​
Integer​
1000​
Video duration in milliseconds.​
tip​
If Start and Duration are not set, the entire video will be transcoded.​
Parent node: TimeInterval.​
Container​
Container​
-​
Video container format.​
Parent node: Transcode.​
Format​
String​
ts​
The container format of the transcoded video file. The options are as follows:​
  • mp4.​
  • ts.​
Parent node: Container.​
Video​
Container​
-​
Video encoding.​
Parent node: Transcode.​
Codec​
String​
H.264​
Video codec format, possible values are:​
  • H.264​
  • H.265​
Parent node: Video.​
Width​
Integer​
4096​
Video file width, must be an even number, unit px, value range is [128, 4096].​
tip​
  • If only Width is set without Height, the video file height will be calculated based on the original aspect ratio.​
  • If only Height is set and Width is not set, the video file width will be calculated based on the original video aspect ratio.​
Parent node: Video​
Height​
Integer​
1024​
Video file height, must be an even number, in px, range [128, 4096].​
Parent node: Video.​
Crf​
Integer​
25​
Video file bitrate.​
Parent node: Video.​
PixFmt​
String​
yuv420p​
Video pixel format, value is yuv420p.​
Parent node: Video.​
​
Additional elements returned when the task type is Remux​
​
Field name​
Type​
Example value​
Description​
RemuxConfig​
Container​
-​
Specific configuration for audio and video transmuxing.​
Format​
String​
MP4​
Audio and video container formats.​
Supported:​
  • mp4​
  • mkv​
  • avi​
  • mkv​
  • ts​
  • mp3​
  • aac​
  • flac​
Parent node: RemuxConfig.​
TranscodeIndex​
String​
0​
Specify the stream index to process; only the specified audio and video streams will be retained in the output file.​
All streams are processed by default.​
Parent Node: RemuxConfig.​
AIGCMetadata​
Container​
-​
Identifier for AIGC metadata content.​
  • The encapsulation format supports only mp4 when not nil;​
  • All fields under AIGCMetadata have a length limit of 22048 UTF-8 characters, restricted to characters within the GB18030-2022 (ASCII) code range 0x21 - 0x7E.​
Parent node: RemuxConfig.​
Label​
String​
test_label​
Generate synthetic tag elements to indicate whether the video is, may be, or is suspected to be AI-generated content.​
Parent node: AIGCMetadata.​
ContentProducer​
String​
test_content_producer​
Generate the synth service provider element, containing the name or code of the video synthesis service provider.​
Parent node: AIGCMetadata.​
ProduceID​
String​
test_produce_id​
Content production identification element, which is the unique identifier assigned by the video generation and synthesis service provider for this content.​
Parent node: AIGCMetadata.​
ContentPropagator​
String​
test_content_propagator​
Content distribution service provider element, which is the name or code of the video distribution service provider.​
Parent node: AIGCMetadata.​
PropagateID​
String​
test_propagate_id​
The content distribution identifier is a unique number assigned by the video distribution service provider to this video.​
Parent node: AIGCMetadata.​
ReservedCode1​
String​
dGVzdF9yZXNlcnZlZF9jb2RlXzE=​
Reserved field 1, contains user-initiated security protection information to safeguard content and identity integrity. Must be encoded in base64 before transmission.​
Parent node: AIGCMetadata.​
ReservedCode2​
String​
dGVzdF9yZXNlcnZlZF9jb2RlXzI=​
Reserved field 2 for user-initiated security measures, protecting content and identity integrity. Must be passed in after base64 encoding.​
Parent node: AIGCMetadata.​
​
Additional elements returned when the task type is Animation​
​
Field name​
Type​
Example value​
Description​
AnimationConfig​
Container​
-​
Specific configuration for video to GIF conversion.​
TimeInterval​
Container​
-​
Time range configuration for video GIF.​
Parent node: AnimationConfig​
Start​
Integer​
0​
Start time of video-to-GIF conversion, in milliseconds. Values:​
  • 0 (default): Start from the beginning.​
  • Greater than 0: Start from ss milliseconds.​
Parent node: TimeInterval.​
Duration​
Integer​
0​
Duration of video-to-animation conversion, in milliseconds. The options are as follows:​
  • 0 (default): to the end of the video.​
  • greater than 0: ss milliseconds after the start time.​
Parent node: TimeInterval.​
Container​
Container​
-​
Output container format for video-to-animated image conversion.​
Parent node: AnimationConfig.​
Format​
String​
gif​
Output animation format, values: gif.​
Parent node: Container.​
Animation​
Container​
-​
Detailed configuration for video to GIF conversion.​
Parent node: AnimationConfig.​
FrameNum​
Integer​
100​
Number of animated frames, unlimited by default (extract frames until the video ends).​
warning​
If the video is shorter, the actual number of extracted frames will be less than the set value.​
Parent node: Animation.​
FrameInterval​
Integer​
1​
Frame extraction interval for animated images, in milliseconds. By default, all video frames are extracted.​
warning​
If this value is less than the source video's frame interval (the inverse of the frame rate), frames are extracted according to the source video's frame interval instead.​
Parent node: Animation.​
Fps​
Integer​
30​
Animated frame rate, default is inter countdown. Value range is [0, 240].​
tip​
This parameter controls the playback speed of the animation. When set to the default value, it matches the source video's playback speed. Values higher than the default create a speeding-up effect; values lower produce a slowing-down effect.​
Parent node: Animation.​
Width​
Integer​
1024​
Set the output GIF width in pixels, with a range of [32,4096].​
tip​
If set to 0, the width will be calculated automatically based on the source video’s resolution ratio.​
Parent node: Animation.​
Height​
Integer​
1024​
Output GIF height in px, range [32,4096].​
tip​
If set to 0, it calculates automatically based on the source video's resolution ratio.​
Parent node: Animation.​
ScaleType​
String​
crop​
Scaling mode. The options are as follows:​
  • crop: scale and crop.​
  • stretch (default): stretch to fill.​
  • fill: scale and keep black borders.​
  • fit: scale proportionally without black borders.​
Parent: Animation.​
​
Sample request​
​
GET /?job_type=Segment&job_id=183535129563a53bfa71000188********** HTTP/1.1​
Host: <bucket_name>.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: <authorization_string>​
​
Sample response​
​
HTTP/1.1 200 OK​
Date: Fri, 30 Jul 2021 13:53:55 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
​
{​
"JobID": "fa81ef2a00a2211f08a9aa5**********",​
"CreateTime": "2025-11-18T20:32:54+08:00",​
"StartTime": "2025-11-18T20:32:55+08:00",​
"EndTime": "2025-11-18T20:32:55+08:00",​
"State": "Success",​
"Code": 0,​
"Message": "success",​
"Input" : { // Source file​
"Object" : "sample.mp4" ​
},​
"RemuxConfig": {​
"Format": "mp4",​
"TranscodeIndex": 0,​
"StartTime": 1000,​
"EndTime": 20000,​
"Duration": 5,​
"AIGCMetadata": {​
"Label": "",​
"ContentProducer": "",​
"ProduceID": "",​
"ContentPropagator": "",​
"PropagateID": "",​
"ReservedCode1": "",​
"ReservedCode2": ""​
}​
},​
"Output" : { // Output file​
"Region" : "cn-beijing", ​
"Bucket" : "testbkt",​
"Object" : "output.mp4"​
}​
}​
​
​
Last updated: 2026.04.09 15:27:10