调用AddEditingProjectMaterials将一个或多个素材添加到剪辑工程中。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String AddEditingProjectMaterials

系统规定参数。取值:AddEditingProjectMaterials

ProjectId String *****b2101cb318c*****

云剪辑工程ID

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

素材ID,多个素材以逗号(,)分隔;每种类型最多支持10个素材ID

返回数据

名称 类型 示例值 描述
RequestId String *****ACB-44F2-5F2D-88D7-1283E70*****

请求ID

ProjectId String *****67ae06542b9b93e0d1c387*****

云剪辑项目ID

MediaInfos Array of MediaInfo

符合要求的媒资集合

MediaId String *****5cb2e35433198daae94a72*****

媒资ID

MediaBasicInfo Object

媒资基础信息

MediaId String *****5cb2e35433198daae94a72*****

媒资ID号

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

待注册的媒资在相应系统中的地址

MediaType String Video

媒资媒体类型

BusinessType String general

媒资业务类型

Source String oss

来源

Title String default_title_2020-12-23T03:32:59Z

标题

Description String sample_description

内容描述

Category String audio

分类

MediaTags String sample_tag

标签

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

封面地址

UserData String userData

用户数据

Snapshots String null

截图

Status String Normal

媒资状态

-Init

-Preparing

-PrepareFail

-Normal

TranscodeStatus String Init

转码状态

CreateTime String 2020-12-23T03:32:59Z

媒资创建时间

ModifiedTime String 2020-12-23T03:32:59Z

媒资修改时间

DeletedTime String 2020-12-23T03:32:59Z

媒资删除时间

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

雪碧图

FileInfoList Array of FileInfo

FileInfos

FileBasicInfo Object

文件基础信息,包含时长,大小等

FileName String example.mp4

文件名

FileStatus String Normal

文件状态

-Uploading

-Normal

-UploadFail

-Disable

-Deleted

FileType String source_file

文件类型

FileSize String 30611502

文件大小(字节)

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

文件oss地址

Region String cn-shanghai

文件存储区域

FormatName String mov,mp4,m4a,3gp,3g2,mj2

封装格式

Duration String 216.206667

时长

Bitrate String 1132.68

码率

Width String 960

Height String 540

LiveMaterials Array of LiveStreamConfig

直播流关联素材

AppName String testrecord

直播播流应用名

StreamName String teststream

直播播流流名

DomainName String test.alivecdn.com

直播播流域名

LiveUrl String rtmp://test.alivecdn.com/testrecord/teststream

直播流地址

ProjectMaterials String *****9b145c5cafc2e057304fcd*****

剪辑工程关联素材。直播工程在直播结束后会关联到一个普通剪辑工程

示例

请求示例

http(s)://[Endpoint]/?Action=AddEditingProjectMaterials
&ProjectId=*****b2101cb318c*****
&MaterialMaps={"video":"*****2e057304fcd9b145c5cafc*****", "image":"****8021a8d493da643c8acd98*****,*****cb6307a4edea614d8b3f3c*****", "liveStream": "[{\"appName\":\"testrecord\",\"domainName\":\"test.alivecdn.com\",\"liveUrl\":\"rtmp://test.alivecdn.com/testrecord/teststream\",\"streamName\":\"teststream\"}]", "editingProject": "*****9b145c5cafc2e057304fcd*****"}
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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" : "*****9b145c5cafc2e057304fcd*****"
}

错误码

访问错误中心查看更多错误码。

访问错误中心查看更多错误码。