SubmitLiveEditingJob

更新时间:
复制 MD 格式

Live editing creates an output file by combining one or more segments from live streams. After you submit a live editing job, it is processed asynchronously. You can then call the GetLiveEditingJob operation with the returned JobId to query the job status, or call the GetMediaInfo operation with the MediaId to get details of the generated media asset.

Operation description

  • This is an asynchronous API. When you submit a job, the system returns a JobId before the job is complete. The job is then queued for asynchronous processing. You will receive a callback notification when the job completes. Alternatively, you can query the job status by calling the GetLiveEditingJob operation.

  • You can edit live streams that are recorded to either OSS or VOD. When editing multiple live streams together, all streams must be recorded to the same service, either all to OSS or all to VOD.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ice:SubmitLiveEditingJob

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Clips

string

Yes

A JSON array that specifies the clips to edit. The job creates the output file by concatenating these clips in the specified order.

Each clip includes a start and end time. If live stream parameters are not specified for a clip, the system uses the global LiveStreamConfig settings. The start and end timestamps must be in UTC. For more details, see the Clip data structure below.

[{\"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\" }]

ProjectId

string

No

The ID of the live editing project. If you specify this parameter, the system uses the storage settings from the project. If left empty, the system uses the storage settings provided in the request instead.

****fddd7748b58bf1d47e95****

LiveStreamConfig

string

No

The configuration of the source live stream, specified as a JSON object. It includes the following parameters:

  • AppName: The name of the application to which the stream belongs.

  • DomainName: The domain name of the stream.

  • StreamName: The name of the live stream.

{ "AppName": "app", "DomainName": "domain.com", "StreamName": "stream" }

OutputMediaConfig

string

No

The destination configuration for the output file, specified as a JSON object. You can specify either a URL on OSS or a storage location in a VOD bucket.

  • To output to OSS, the MediaURL parameter is required.

  • To output to VOD, the StorageLocation and FileName parameters are required.

{ "MediaURL": "https://ice-auto-test.oss-cn-shanghai.aliyuncs.com/testfile.mp4" }, 或 { "StorageLocation": "bucket.oss-cn-shanghai.aliyuncs.com", "FileName": "output.mp4" }

MediaProduceConfig

string

No

The production configuration for the output file, specified as a JSON object. The Mode parameter specifies the editing mode. Valid values are:

  • AccurateFast (Default): Fast and precise editing. It offers faster processing compared to the Accurate mode. The output file has the same resolution as the source stream. You cannot specify a custom width and height for the output file.

  • Accurate: Precise editing. This mode lets you specify a custom width and height for the output file.

  • Rough: Rough editing with a precision of a single TS segment. The output file includes all segments between the specified start and end times. You can specify a custom width and height for the output file.

  • RoughFast: Fast rough-cut editing, which is faster than the Accurate mode. It has a precision of a single TS segment, and the output file includes all segments between the specified start and end times. The output file has the same resolution as the source stream. You cannot specify a custom width and height for the output file.

{ "Mode": "AccurateFast"}

UserData

string

No

Custom user data, provided as a JSON object. The maximum length is 512 bytes.

{"key": "value"}

OutputMediaTarget

string

No

The destination type for the output file. Valid values:

  • oss-object: An object in an Alibaba Cloud OSS bucket.

  • vod-media: A media asset in Alibaba Cloud VOD.

oss-object

Clip data structure

ParameterTypeExampleDescriptionRequired
StartTimeString2021-06-21T08:01:00ZThe start time of the clip, in UTC format.Yes
EndTimeString2021-06-21T08:05:00ZThe end time of the clip, in UTC format.Yes
AppNameStringappThe name of the application to which the stream belongs. If not specified, the system uses the global LiveStreamConfig settings.No
DomainNameStringdomain.comThe domain name of the stream. If not specified, the system uses the global LiveStreamConfig settings.No
StreamNameStringstreamThe name of the live stream. If not specified, the system uses the global LiveStreamConfig settings.No
CoverTimeString2021-06-21T08:03:00ZSpecifies a timestamp within the clip to use for generating a cover image for the output file. The time must be in UTC format. If multiple clips have CoverTime set, the system uses only the first one. The CoverTime must be greater than or equal to StartTime and less than or equal to EndTime.No
CoverUrlStringhttps://test.oss-cn-shanghai.aliyuncs.com/cover.jpgThe custom URL for the output screenshot. The OSS bucket must be in the same region as the service. Only self-managed OSS buckets are supported; VOD-managed buckets are not.No

Response elements

Element

Type

Description

Example

object

The response object.

RequestId

string

The ID of the request.

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

ProjectId

string

The ID of the live editing project.

****fddd7748b58bf1d47e95****

JobId

string

The ID of the live editing job.

****d80e4e4044975745c14b****

MediaId

string

The ID of the output media asset.

****c469e944b5a856828dc2****

MediaURL

string

The URL of the output file.

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

VodMediaId

string

The ID of the VOD media asset. This parameter is returned only if the output destination is VOD.

****d7578s4h75ci945c14b****

Examples

Success response

JSON format

{
  "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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.