All Products
Search
Document Center

Intelligent Media Services:SubmitLiveEditingJob

更新時間:Nov 25, 2024

Submits a live editing job to merge one or more live stream clips into one video. After a live editing job is submitted, the job is queued in the background for asynchronous processing. You can call the GeLiveEditingJob operation to query the state of the job based on the job ID. You can also call the GetMediaInfo operation to query the information about the generated media asset based on the media asset ID.

Operation description

Live editing is supported for live streams that are recorded and stored in Object Storage Service (OSS) and ApsaraVideo VOD. If multiple live streams are involved in a single job, only those recorded within the same application are supported for mixed editing. The streams must all be recorded either in OSS or ApsaraVideo VOD.

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:
    • The required resource types are displayed in bold characters.
    • 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
ice:SubmitLiveEditingJob
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ClipsstringYes

The clips in the JSON array format. The output video is created by merging these clips sequentially.

Each clip has a start time and an end time. If no live stream parameters are specified, the outer live stream configurations apply. The start and end timestamps are in UTC. For more information about the parameters, see the "Clip" section of this topic.

[{\"StartTime\": \" 2021-06-21T08:01:00Z\", \"EndTime\": \" 2021-06-21T08:03:00Z\" , "AppName": "app", "DomainName": "domain.com", "StreamName": "stream"}, {\"StartTime\": \" 2021-06-21T08:05:00Z\", \"EndTime\": \" 2021-06-21T08:09:00Z\" }]
ProjectIdstringNo

The ID of the live editing project. If this parameter is specified, the system reads the storage configurations of the project. If this parameter is not specified, the specified storage configurations take precedence.

****fddd7748b58bf1d47e95****
LiveStreamConfigstringNo

The live stream configurations, in the JSON format. The configurations must include the following parameters:

  • AppName: the name of the application to which the live stream belongs.
  • DomainName: the domain name of the application.
  • StreamName: the name of the live stream.
{ "AppName": "app", "DomainName": "domain.com", "StreamName": "stream" }
OutputMediaConfigstringNo

The configurations of the output file, in the JSON format. You can specify an OSS URL or a storage location in a storage bucket of ApsaraVideo VOD.

  • To store the output file in OSS, you must specify MediaURL.
  • To store the output file in ApsaraVideo VOD, you must specify StorageLocation and FileName.
MediaProduceConfigstringNo

The production configurations, in the JSON format. Mode specifies the editing mode. Valid values:

  • AccurateFast (default): fast editing. It is faster than the Accurate mode. The resolution of the output file is the same as that of the source stream. You cannot specify the width and height of the output file.
  • Accurate: accurate editing. In this mode, you can specify the width and height of the output file.
  • Rough: rough editing. The minimum precision is one TS segment. The output file comprises all segments within the specified time range. You can specify the width and height of the output file.
  • RoughFast: fast rough editing. It is faster than the Accurate mode. The minimum precision is one TS segment. The output file comprises all segments within the specified time range. The resolution of the output file is the same as that of the source stream. You cannot specify the width and height of the output file.
{ "Mode": "AccurateFast"}
UserDatastringNo

The user-defined data in the JSON format, which can be up to 512 bytes in length.

{"key": "value"}
OutputMediaTargetstringNo

The type of the output file. Valid values:

  • oss-object: OSS object in an OSS bucket.
  • vod-media: media asset in Alibaba Cloud VOD.
oss-object

Clip

ParameterTypeExampleDescriptionRequired
StartTimeString2021-06-21T08:01:00ZThe start time of the captured clip. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.Yes
EndTimeString2021-06-21T08:05:00ZThe end time of the captured clip. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.Yes
AppNameStringappThe name of the application to which the live stream belongs. If you do not specify this parameter, the outer live stream configurations apply.No
DomainNameStringdomain.comThe domain name. If you do not specify this parameter, the outer live stream configurations apply.No
StreamNameStringstreamThe name of the live stream. If you do not specify this parameter, the outer live stream configurations apply.No
CoverTimeString2021-06-21T08:03:00ZThe timestamp in the clip. The image at this timestamp is used as the thumbnail of the output file. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. If you specify CoverTime for multiple clips, only the first one takes effect. CoverTime must be later than or equal to StartTime and earlier than or equal to EndTime.No
CoverUrlStringhttps://test.oss-cn-shanghai.aliyuncs.comThe output URL of the thumbnail. The OSS bucket must be in the same region in which IMS is activated. Only self-managed OSS buckets are supported. Buckets managed by ApsaraVideo VOD are not supported.No

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

****36-3C1E-4417-BDB2-1E034F****
ProjectIdstring

The ID of the live editing project.

****fddd7748b58bf1d47e95****
JobIdstring

The ID of the live editing job.

****d80e4e4044975745c14b****
MediaIdstring

The media asset ID of the output file.

****c469e944b5a856828dc2****
MediaURLstring

The URL of the output file.

http://test-bucket.cn-shanghai.aliyuncs.com/test.mp4
VodMediaIdstring

The media asset ID of the output file in ApsaraVideo VOD if the output file is stored in ApsaraVideo VOD.

****d7578s4h75ci945c14b****

Examples

Sample success responses

JSONformat

{
  "RequestId": "****36-3C1E-4417-BDB2-1E034F****",
  "ProjectId": "****fddd7748b58bf1d47e95****",
  "JobId": "****d80e4e4044975745c14b****",
  "MediaId": "****c469e944b5a856828dc2****",
  "MediaURL": "http://test-bucket.cn-shanghai.aliyuncs.com/test.mp4",
  "VodMediaId": "****d7578s4h75ci945c14b****"
}

Error codes

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