All Products
Search
Document Center

Intelligent Media Management:CreateMediaConvertTask

Last Updated:Nov 20, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Create Transcoding Service

Operation description

  • Please ensure that you fully understand the billing method and pricing of the Intelligent Media Management product before using this interface.
  • Before calling this interface, make sure that there is an available project (Project) in the current Region. For more details, see Project Management.
    Notice Asynchronous tasks do not guarantee timeliness.
  • When using this interface for media transcoding, by default, only one video/audio/subtitle stream is processed, but you can also configure the number of video/audio/subtitle streams to be processed.
  • When using this interface for media concatenation, a maximum of 11 media files are supported. In this case, the configured transcoding, frame extraction, and other parameters will apply to the concatenated media data.
  • This is an asynchronous interface. After the task starts, the task information is retained for 7 days. If it exceeds 7 days, the information cannot be retrieved. Call the GetTask or ListTasks interface to get the returned TaskId and view the task information. You can also set the Notification message notification parameter to obtain task information through message notifications.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
imm:CreateMediaConvertTaskcreate
*Project
acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectNamestringYes

The name of the project. For how to obtain it, see Creating a Project.

test-project
Sourcesarray<object>Yes

A list of media files. If the list contains more than one element, it indicates that the Concat (concatenation) function is enabled. The Concat order follows the sequence of the input video file URIs.

objectYes

Source media file.

URIstringNo

The OSS address rule is oss://${Bucket}/${Object}, where ${Bucket} is the name of the OSS Bucket in the same region (Region) as the current project, and ${Object} is the complete path of the file including the file extension.

oss://test-bucket/test-object
StartTimedoubleNo

The start time for media transcoding, in seconds. The value range is as follows:

  • 0 (default): Start transcoding from the beginning of the media.
  • n (greater than 0): Start transcoding n seconds after the beginning of the media.
0
DurationdoubleNo

The duration of media transcoding, in seconds. The default value is 0, indicating until the end of the video.

0
Subtitlesarray<object>No

A list of subtitles to add, which is empty by default.

objectNo

Subtitle information.

URIstringNo

The OSS address rule is oss://${Bucket}/${Object}, where ${Bucket} is the name of the OSS Bucket in the same region (Region) as the current project, and ${Object} is the complete path of the file including the file extension. Supported subtitle formats include: srt, vtt, mov_text, ass, dvd_sub, pgs.

oss://test-bucket/test-object
TimeOffsetdoubleNo

The subtitle delay time, in seconds, with a default value of 0.

10.5
LanguagestringNo

The language of the subtitle, referenced by ISO 639-2, with a default value of empty.

eng
AttachedbooleanNo

Add the current source media file as a synchronized audio or video stream to the output media file, with a default value of false.

Note
  • The AlignmentIndex parameter pointing to the Attached parameter of the Source cannot be true.
  • false
    AlignModestringNo

    The alignment strategy for adding audio and video streams, with the following value range:

    • false (default): No alignment.
    • loop: Loop the audio and video content to align.
    • pad: Align by padding silent frames and black video frames.
    Note
  • Only valid when the Attached parameter is true.
  • false
    DisableVideobooleanNo

    Whether to disable the video in the source media file. The value range is as follows:

    • true: Disable.
    • false (default): Do not disable.
    false
    DisableAudiobooleanNo

    Whether to disable the audio in the source media file. The value range is as follows:

    • true: Disable.
    • false (default): Do not disable.
    false
    Targetsarray<object>Yes

    List of media processing tasks, supporting multiple task configurations.

    objectYes

    Detailed information of the elements in the Targets array.

    URIstringNo

    OSS address for the output file of media transcoding.

    The OSS address rule is oss://${Bucket}/${Object}, where ${Bucket} is the name of the OSS Bucket in the same region (Region) as the current project, and ${Object} is the complete path of the file including the file extension.

    • When URI has an extension, the OSS address for the transcoded media file will be URI. If there are multiple output files, they may overwrite each other.
    • When URI does not have an extension, the OSS address for the transcoded media file is determined by the URI, Container, and Segment parameters. For example, if URI is oss://examplebucket/outputVideo:
      • When Container is mp4 and Segment is empty, the generated media file's OSS address will be oss://examplebucket/outputVideo.mp4.
      • When Container is ts and Segment's Format is hls, it will generate an m3u8 file with the OSS address oss://examplebucket/outputVideo.m3u8 and multiple ts files with the prefix oss://examplebucket/outputVideo.
    oss://test-bucket/test-target-object.mp4
    ContainerstringNo

    Media container type. Available container types are as follows:

    • Audio and video containers: mp4, mkv, mov, asf, avi, mxf, ts, flv
    • Audio containers: mp3, aac, flac, oga, ac3, opus
      Notice Both Container and URI parameters need to be set. If only subtitle extraction, frame capture, sprite image capture, or media-to-gif conversion is performed, both Container and URI should be set to null, making the Segment, Video, Audio, and Speed parameters meaningless.
    mp4
    SpeedfloatNo

    Media playback speed setting, with a value range of [0.5,1.0], default is 1.0.

    Note The ratio of the playback speed of the transcoded media file to the original media file, not a speed-up transcoding.
    1.0
    SegmentobjectNo

    Media segment settings, no segmentation by default.

    FormatstringNo

    Media slicing method. The value range is as follows:

    • hls
    • dash
    hls
    DurationdoubleNo

    Segment length. Unit: seconds.

    30
    StartNumberintegerNo

    Starting sequence number, supported only for hls, default is 0.

    5
    VideoTargetVideoNo

    Video processing parameter configuration.

    Notice If Video is null, the first video stream (if present) will be directly copied to the output file.

    AudioTargetAudioNo

    Audio processing parameter configuration.

    Notice If Audio is null, the first audio stream (if present) will be directly copied to the output file.

    SubtitleTargetSubtitleNo

    Subtitle processing parameter configuration.

    Notice If Subtitle is null, the first subtitle stream (if present) will be directly copied to the output file.

    ImageTargetImageNo

    Configuration for frame capture, sprite image capture, and media to animated image conversion.

    StripMetadatabooleanNo

    Removes metadata from the media file, such as title, album, etc. The default value is false.

    UserDatastringNo

    User-defined information that will be returned in asynchronous message notifications, used for convenient association and processing within your system. The maximum length is 2048 bytes.

    {"ID": "testuid","Name": "test-user","Avatar": "http://test.com/testuid"}
    TagsobjectNo

    Custom tags used for searching and filtering asynchronous tasks.

    {"test":"val1"}
    CredentialConfigCredentialConfigNo

    If there are no special requirements, please leave this blank.

    Chain authorization configuration. For more information, see Using Chain Authorization to Access Other Entity Resources.

    NotificationNotificationNo

    Notification configuration. For details, click Notification. The format of asynchronous notification messages can be found in Asynchronous Notification Message Format.

    AlignmentIndexintegerNo

    When performing media concatenation, the index of the primary media file (which provides the default transcoding parameters for Video and Audio, including resolution, frame rate, etc.) in the concatenation list. The default value is 0 (aligning with the first media file in the concatenation list).

    0

    Response parameters

    ParameterTypeDescriptionExample
    object

    Response structure.

    RequestIdstring

    Request ID.

    CA995EFD-083D-4F40-BE8A-BDF75FFFE0B6
    EventIdstring

    Event ID.

    0ED-1Bz8z71k5TtsUejT4UJ16Es****
    TaskIdstring

    Task ID.

    MediaConvert-adb1ee28-c4c9-42a7-9f54-3b8eadcb****

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "CA995EFD-083D-4F40-BE8A-BDF75FFFE0B6",
      "EventId": "0ED-1Bz8z71k5TtsUejT4UJ16Es****",
      "TaskId": "MediaConvert-adb1ee28-c4c9-42a7-9f54-3b8eadcb****"
    }

    Error codes

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2023-05-09The request parameters of the API has changedView Change Details
    2023-04-03The request parameters of the API has changedView Change Details
    2023-03-09The request parameters of the API has changedView Change Details
    2022-08-16The request parameters of the API has changedView Change Details
    2022-08-16The request parameters of the API has changedView Change Details