视频剪辑 · 提交视频剪辑

提交视频剪辑

提交视频剪辑项目:一次提交 1~100 条成片,materials / bgms 为共享池;每条成片独立计费、独立完成、逐条 webhook。竖屏 1080×1920@30,按旁白秒数预扣(0.01 元/秒),成片秒结算;M1a 仅支持 portrait / cut。字段名里的 [] 表示数组,例如 outputs[].compositionId 是 outputs 数组里每条的 compositionId。

服务正常 视频剪辑 ¥0.01 / 秒(视频剪辑)

接口信息

接口地址 https://imago.luznkj.com/v1/edits
请求方式POST
返回格式application/json

请求 Header

名称必填说明
Authorization 是 Bearer YOUR_KEY(控制台 → API Keys)
Content-Type 否 application/json(POST 时必填)

请求 Body

名称必填类型说明
clientProjectId 否 string 项目幂等键(≤64 位字母/数字/._-);重复提交返回已有项目,不重复扣费
callbackUrl 否 string webhook 地址;每条成片完成/失败回调一次,签名头 X-Edit-Signature: sha256=HMAC
materials 否 array 共享素材池,最多 50 条;只传一次,多条 output 复用同一素材只下载/缓存一次
materials[].id 是 string 素材 ID,项目内唯一;outputs[].shots[].materialId 用它引用
materials[].url 是 string 素材 HTTPS 地址(视频/图片)
materials[].materialKey 否 string 稳定素材 ID,可选;签名 URL 场景建议传,缓存命中更稳
bgms 否 array 共享 BGM 池,最多 20 条;只传一次,多条 output 用 bgmId 复用
bgms[].id 是 string BGM ID,项目内唯一;outputs[].bgmId 用它引用
bgms[].url 是 string BGM HTTPS 地址(mp3/wav/m4a 等)
bgms[].volume 否 number 默认音量 0~1;outputs[].bgmVolume 可覆盖
outputs 是 array 成片数组,1~100 条;N=1 就传 1 条,N=100 就传 100 条。每条字段见下面 outputs[].xxx
outputs[].clientOutputId 否 string 调用方成片 ID,项目内唯一;webhook 原样返回,用于对账/排序。不传自动生成 o1/o2...
outputs[].compositionId 是 string 模板 ID,见「模板列表」
outputs[].narrationUrl 是 string 这条成片的旁白音频 HTTPS;全片时长以此为准
outputs[].captions 是 array 字幕数组,与旁白同一时钟;每条含 text/start/end,可选 highlights/en
outputs[].captions[].text 是 string 字幕文字
outputs[].captions[].start 是 number 开始秒(相对旁白)
outputs[].captions[].end 是 number 结束秒;末句超出旁白 0~0.5s 自动裁剪,超过 0.5s 报错
outputs[].captions[].highlights 否 array 要高亮的词(字符串数组),可选;传了就按传入策展
outputs[].shots 是 array 分镜,1~40 条;每镜用 materialId(推荐)或 url,配 start/end/in/out/fit 等
outputs[].shots[].materialId 否 string 引用 materials[].id;与 url 二选一,推荐用池
outputs[].shots[].url 否 string 素材 HTTPS;不经过 materials 池时直接写这里
outputs[].shots[].start 是 number 在成片时间轴上的开始秒(与 captions 同钟)
outputs[].shots[].end 是 number 在成片时间轴上的结束秒;也可用 captionIndex/captionIndexEnd 对齐字幕
outputs[].shots[].captionIndex 否 number 可选:从第几条字幕开始(1 起),用字幕时间代替 start;captionIndexEnd 指定结束字幕
outputs[].shots[].captionIndexEnd 否 number 可选:到第几条字幕结束(1 起,含)
outputs[].shots[].in 否 number 素材入点秒,默认 0
outputs[].shots[].out 否 number 素材出点秒,默认按窗口长度;素材不够时定格尾帧
outputs[].shots[].fit 否 string 本镜适配:cover(铺满裁切)/ blur(模糊背景+完整画面)/ contain(黑边完整);覆盖全局 fit
outputs[].shots[].crop 否 string 先裁黑边,格式 w:h:x:y;如 720:538:0:292
outputs[].shots[].trans 否 string 转场,M1a 仅 cut;fade 后续开放
outputs[].shots[].volume 否 number 本镜原声音量 0~1,materialAudio=keep 时生效
outputs[].shots[].materialKey 否 string 覆盖 materials[].materialKey,通常不用传
outputs[].title 否 string 顶部标题,同口播;带 \n 按行渲染
outputs[].persona 否 string 人设 / 副标题
outputs[].bgmId 否 string 引用 bgms[].id;也可直接写 outputs[].bgmUrl
outputs[].bgmUrl 否 string 不经过 bgms 池时直接写 BGM HTTPS;bgmId 优先
outputs[].bgmVolume 否 number 覆盖 BGM 池默认音量,0~1
outputs[].materialAudio 否 string 素材原声:mute(默认,静音)/ keep(保留并混入旁白)
outputs[].materialVolume 否 number 素材原声音量 0~1,默认 1.0;仅 keep 生效
outputs[].tailPad 否 number 片尾留白秒数,默认 0.9
outputs[].gap 否 string 分镜空隙:extend(默认,定格补齐)/ black(黑场)
outputs[].fit 否 string 全局素材适配,默认 cover;可被单镜 fit 覆盖
outputs[].captionMode 否 string auto(默认,拆句)/ strict(按原样,不拆句不补高光)

返回参数

名称类型说明
projectId string 项目 ID
total int 成片数量
outputs array 每条:outputId / clientOutputId / status / estimateSec / frozenYuan;N=1 也是数组,长度 1

请求示例

curl -X POST https://imago.luznkj.com/v1/edits \
  -H "Authorization: Bearer ic_xxx" \
  -H "Content-Type: application/json" \
  -d '{
  "clientProjectId": "proj-20261031-001",
  "callbackUrl": "https://client.example.com/callback",
  "materials": [
    {"id":"m1","url":"https://cdn.example.com/a.mp4"},
    {"id":"m2","url":"https://cdn.example.com/b.jpg"}
  ],
  "bgms": [
    {"id":"bgm1","url":"https://cdn.example.com/bgm1.mp3","volume":0.15}
  ],
  "outputs": [
    {
      "clientOutputId": "001",
      "compositionId": "01-yellow-banner",
      "title": "门店没客流?\n3套工具帮你引流",
      "narrationUrl": "https://cdn.example.com/voice1.mp3",
      "captions": [
        {"text":"还在愁门店没客流吗","start":0.1,"end":2.0,"highlights":["客流"]}
      ],
      "shots": [
        {"materialId":"m1","start":0,"end":8,"in":3,"fit":"blur"},
        {"materialId":"m2","start":8,"end":16,"fit":"blur"}
      ],
      "bgmId": "bgm1"
    },
    {
      "clientOutputId": "002",
      "compositionId": "08-red-bar",
      "title": "第二套文案",
      "narrationUrl": "https://cdn.example.com/voice2.mp3",
      "captions": [
        {"text":"第二套文案","start":0.1,"end":2.0}
      ],
      "shots": [
        {"materialId":"m2","start":0,"end":6,"fit":"cover"}
      ],
      "bgmId": "bgm1"
    }
  ]
}'