All Products
Search
Document Center

Intelligent Media Services:AddEditingProjectMaterials

Last Updated:Dec 16, 2024

Adds one or more materials to an online editing project.

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:AddEditingProjectMaterials
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdstringYes

The ID of the online editing project.

*****b2101cb318c*****
MaterialMapsstringYes

The material ID. Separate multiple material IDs with commas (,). Each type supports up to 10 material IDs. The following material types are supported:

  • video
  • audio
  • image
  • liveStream
  • editingProject
{"video":"*****2e057304fcd9b145c5cafc*****", "image":"****8021a8d493da643c8acd98*****,*****cb6307a4edea614d8b3f3c*****", "liveStream": "[{\"appName\":\"testrecord\",\"domainName\":\"test.alivecdn.com\",\"liveUrl\":\"rtmp://test.alivecdn.com/testrecord/teststream\",\"streamName\":\"teststream\"}]", "editingProject": "*****9b145c5cafc2e057304fcd*****"}

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

*****ACB-44F2-5F2D-88D7-1283E70*****
ProjectIdstring

The ID of the online editing project.

*****67ae06542b9b93e0d1c387*****
MediaInfosarray<object>

The media assets that meet the specified conditions.

MediaInfoobject
MediaIdstring

The ID of the media asset.

*****5cb2e35433198daae94a72*****
MediaBasicInfoobject

The basic information of the media assets.

MediaIdstring

The ID of the media asset.

*****5cb2e35433198daae94a72*****
InputURLstring

The URL of the media asset in another service.

http://bucket.oss-cn-shanghai.aliyuncs.com/file.mp4
MediaTypestring

The type of the media asset.

Video
BusinessTypestring

The business type of the media asset.

general
Sourcestring

The source of the media asset.

oss
Titlestring

The title of the media asset.

default_title_2020-12-23T03:32:59Z
Descriptionstring

The description of the media asset.

sample_description
Categorystring

The category of the media asset.

audio
MediaTagsstring

The tags of the media asset.

sample_tag
CoverURLstring

The thumbnail URL of the media asset.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>
UserDatastring

The user data.

userData
Snapshotsstring

The snapshots of the media asset.

null
Statusstring

The status of the media asset. Valid values:

- Init

- Preparing

- PrepareFail

- Normal

Normal
TranscodeStatusstring

The transcoding status of the media asset.

Init
CreateTimestring

The time when the media asset was created.

2020-12-23T03:32:59Z
ModifiedTimestring

The time when the media asset was last modified.

2020-12-23T03:32:59Z
DeletedTimestring

The time when the media asset was deleted.

2020-12-23T03:32:59Z
SpriteImagesstring

The sprite of the media asset.

http://outin-example.oss-cn-shanghai.aliyuncs.com/test.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>
FileInfoListarray<object>

FileInfos

FileInfoobject
FileBasicInfoobject

The basic information of the file, including the duration and size.

FileNamestring

The file name.

example.mp4
FileStatusstring

The file status.

-Uploading

-Normal

-UploadFail

-Disable

-Deleted

Normal
FileTypestring

The file type.

source_file
FileSizestring

The file size. Unit: bytes.

30611502
FileUrlstring

The Object Storage Service (OSS) URL of the file.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>
Regionstring

The region in which the file resides.

cn-shanghai
FormatNamestring

The container format.

mov,mp4,m4a,3gp,3g2,mj2
Durationstring

The duration.

216.206667
Bitratestring

The bitrate.

1132.68
Widthstring

The width.

960
Heightstring

The height.

540
LiveMaterialsarray<object>

The materials associated with the live stream.

LiveStreamConfigobject
AppNamestring

The application name of the live stream.

testrecord
StreamNamestring

The name of the live stream.

teststream
DomainNamestring

The domain name of the live stream.

test.alivecdn.com
LiveUrlstring

The URL of the live stream.

rtmp://test.alivecdn.com/testrecord/teststream
ProjectMaterialsarray

The materials associated with the editing project. A live stream editing project will be associated with a regular editing project after the live streaming ends.

projectMaterialstring

The ID of the regular editing project associated with the live stream editing project.

*****c38767ae06542b9b93e0d1*****

Examples

Sample success responses

JSONformat

{
  "RequestId": "*****ACB-44F2-5F2D-88D7-1283E70*****",
  "ProjectId": "*****67ae06542b9b93e0d1c387*****",
  "MediaInfos": [
    {
      "MediaId": "*****5cb2e35433198daae94a72*****",
      "MediaBasicInfo": {
        "MediaId": "*****5cb2e35433198daae94a72*****",
        "InputURL": "http://bucket.oss-cn-shanghai.aliyuncs.com/file.mp4",
        "MediaType": "Video",
        "BusinessType": "general",
        "Source": "oss",
        "Title": "default_title_2020-12-23T03:32:59Z",
        "Description": "sample_description",
        "Category": "audio",
        "MediaTags": "sample_tag",
        "CoverURL": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",
        "UserData": "userData",
        "Snapshots": "null",
        "Status": "Normal",
        "TranscodeStatus": "Init",
        "CreateTime": "2020-12-23T03:32:59Z",
        "ModifiedTime": "2020-12-23T03:32:59Z",
        "DeletedTime": "2020-12-23T03:32:59Z",
        "SpriteImages": "http://outin-example.oss-cn-shanghai.aliyuncs.com/test.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>"
      },
      "FileInfoList": [
        {
          "FileBasicInfo": {
            "FileName": "example.mp4",
            "FileStatus": "Normal",
            "FileType": "source_file",
            "FileSize": "30611502",
            "FileUrl": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",
            "Region": "cn-shanghai",
            "FormatName": "mov,mp4,m4a,3gp,3g2,mj2",
            "Duration": "216.206667",
            "Bitrate": "1132.68",
            "Width": "960",
            "Height": "540"
          }
        }
      ]
    }
  ],
  "LiveMaterials": [
    {
      "AppName": "testrecord",
      "StreamName": "teststream",
      "DomainName": "test.alivecdn.com",
      "LiveUrl": "rtmp://test.alivecdn.com/testrecord/teststream"
    }
  ],
  "ProjectMaterials": [
    "*****c38767ae06542b9b93e0d1*****"
  ]
}

Error codes

HTTP status codeError codeError message
400InvalidParameterThe specified parameter \ is not valid.
404ProjectNotFoundThe specified project not found

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

Change history

Change timeSummary of changesOperation
2021-03-31The Error code has changed. The response structure of the API has changedView Change Details