You need to enable JavaScript to run this app.
文档中心
文档控制台
注册
机器翻译

机器翻译

复制全文
下载 pdf
视频项目管理
VideoProjectSubtitleUpload - 上传字幕文件
复制全文
下载 pdf
VideoProjectSubtitleUpload - 上传字幕文件

在指定项目下批量上传字幕文件,上传成功后返回batchId用于查询上传进度

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

const columns = [
  {
    width: '20%',
    title: '参数',
    dataIndex: 'Name',
    className: 'openapi-doc-parameter-table-name'
  },
  {
    width: 130,
    title: '类型',
    dataIndex: 'DataType',
    className: 'openapi-doc-parameter-table-type'
  },
  {
    width: 90,
    title: '是否必填',
    dataIndex: 'IsRequired',
    className: 'openapi-doc-parameter-table-required'
  },
  {
    width: '20%',
    title: '示例值',
    dataIndex: 'Example',
    className: 'openapi-doc-parameter-table-example'
  },
  {
    title: '描述',
    dataIndex: 'Description',
    className: 'openapi-doc-parameter-table-description'
  },
];

const data = [
  {
    rowKey: '->Action',
    Name: 'Action',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"VideoProjectSubtitleUpload"} />,
    Description: <RenderMd content={"要执行的操作,取值:VideoProjectSubtitleUpload。"} />,
    children: [
    ]
  },
  {
    rowKey: '->Version',
    Name: 'Version',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"2021-05-21"} />,
    Description: <RenderMd content={"API的版本,取值:2021-05-21。"} />,
    children: [
    ]
  },
  {
    rowKey: '->projectId',
    Name: 'projectId',
    DataType: 'String',
    IsRequired: '是',
    Example: <RenderMd content={"123456"} />,
    Description: <RenderMd content={"指定上传字幕文件所属的项目ID"} />,
    children: [
    ]
  },
  {
    rowKey: '->subtitles',
    Name: 'subtitles',
    DataType: 'Array of Object',
    IsRequired: '是',
    Example: <RenderMd content={"[\n    {\n        \"subtitleUrl\": \"https://sf1-cdn-tos.huoshanstatic.com/obj/ies.fe.starling/qqqq_zh_1_a638140e454f9db8aed6c1cb62c437.ass\",\n        \"subtitleName\": \"重生后得到\",\n        \"subtitleLangs\": [\"zh\"],\n        \"fileType\": 2,\n        \"vid\": \"v0d34dg10001d8kjb3nog65llj\"\n\n}]\n}"} />,
    Description: <RenderMd content={"字幕文件列表,支持批量上传多个字幕文件"} />,
    children: [
        {
          rowKey: '->subtitles->subtitleUrl',
          Name: 'subtitleUrl',
          DataType: 'String',
          IsRequired: '是',
          Example: <RenderMd content={"https://example.com/subtitle.srt"} />,
          Description: <RenderMd content={"字幕文件的获取链接"} />,
          children: [
          ]
        },
        {
          rowKey: '->subtitles->subtitleName',
          Name: 'subtitleName',
          DataType: 'String',
          IsRequired: '否',
          Example: <RenderMd content={"episode1_en"} />,
          Description: <RenderMd content={"字幕文件名称,不传时默认以字幕ID命名"} />,
          children: [
          ]
        },
        {
          rowKey: '->subtitles->fileType',
          Name: 'fileType',
          DataType: 'Integer',
          IsRequired: '是',
          Example: <RenderMd content={"1"} />,
          Description: <RenderMd content={"字幕文件格式: 1-SRT, 2-ASS"} />,
          children: [
          ]
        },
        {
          rowKey: '->subtitles->vid',
          Name: 'vid',
          DataType: 'String',
          IsRequired: '否',
          Example: <RenderMd content={"v12345"} />,
          Description: <RenderMd content={"字幕关联的视频vid,只能传入一个"} />,
          children: [
          ]
        },
        {
          rowKey: '->subtitles->subtitleLangs',
          Name: 'subtitleLangs',
          DataType: 'Array of String',
          IsRequired: '是',
          Example: <RenderMd content={"[zh, en] 表示双语文件中文字幕在上,英文字幕在下"} />,
          Description: <RenderMd content={"字幕语言对,双语文件,根据字幕文件的语言顺序设置"} />,
          children: [
          ]
        },
    ]
  },

];

return (<Table
  rowKey="rowKey"
  className="openapi-doc-parameter-table"
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

const columns = [
  {
    width: '25%',
    title: '参数',
    dataIndex: 'Name',
    className: 'openapi-doc-parameter-table-name',
  },
  {
    width: 130,
    title: '类型',
    dataIndex: 'DataType',
    className: 'openapi-doc-parameter-table-type'
  },
  {
    width: '25%',
    title: '示例值',
    dataIndex: 'Example',
    className: 'openapi-doc-parameter-table-example'
  },
  {
    title: '描述',
    dataIndex: 'Description',
    className: 'openapi-doc-parameter-table-description'
  },
];

const data = [
  {
    rowKey: "->data",
    Name: "data",
    DataType: "Object",
    Example: <RenderMd content={"{batchId: '233'}"} />,
    Description: <RenderMd content={"视频上传返回"} />,
    children: [
        {
          rowKey: "->data->batchId",
          Name: "batchId",
          DataType: "String",
          Example: <RenderMd content={""} />,
          Description: <RenderMd content={"上传的id"} />,
          children: [
          ]
        },
    ]
  },
];

return (<Table
  rowKey="rowKey"
  className="openapi-doc-parameter-table"
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);

请求示例

POST /?Action=VideoProjectSubtitleUpload&Version=2021-05-21 HTTP/1.1
Host: open.volcengineapi.com
Content-Type: application/json; charset=UTF-8
X-Date: 20260625T091125Z
X-Content-Sha256: 287e874e******d653b44d21e
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20260625/cn-beijing/i18n_openapi/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f

{"projectId":"123456","subtitles":[{"subtitleUrl":"https://example.com/subtitle.srt","subtitleName":"episode1_en","subtitleLang":"en","fileType":1,"vid":"v12345"}]}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "2026062517112912311503601596D968",
    "Action": "VideoProjectSubtitleUpload",
    "Version": "2021-05-21",
    "Service": "i18n_openapi",
    "Region": "cn-beijing"
  },
  "Result": {
    
     "data": {
     "batchId": "789012"
}
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

const columns = [
  {
    title: '状态码',
    dataIndex: 'HttpCode',
    width: '12%',
    className: 'openapi-doc-errorcode-table-httpcode'
  },
  {
    title: '错误码',
    dataIndex: 'ErrorCode',
    width: '22%',
    className: 'openapi-doc-errorcode-table-errorcode'
  },
  {
    title: '错误信息',
    dataIndex: 'ErrorMessage',
    width: '33%',
    className: 'openapi-doc-errorcode-table-errormessage'
  },
  {
    title: '说明',
    dataIndex: 'Description',
    width: '33%',
    className: 'openapi-doc-errorcode-table-description'
  },
];

const data = [
  {
    HttpCode: 400,
    ErrorCode: '1001',
    ErrorMessage: <RenderMd content={"Server Error"} />,
    Description: <RenderMd content={"服务内部错误"} />,
  },
];

return (<Table
  columns={columns}
  data={data}
  border={ { cell: true, wrapper: true } }
  scroll={ { x: "auto" } }
  pagination={false}
/>);
最近更新时间:2026.07.03 12:02:38
这个页面对您有帮助吗?
有用
有用
无用
无用