最近更新时间:2023.11.13 13:47:54
首次发布时间:2023.09.25 14:34:06
创建拉流转推任务成功后,使用该接口修改任务参数。
请求频率:单用户请求频率限制为 10 次/秒。
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | UpdatePullToPushTask | 接口名称。当前 API 的名称为 UpdatePullToPushTask 。 |
Version | String | 是 | 2023-01-01 | 接口版本。当前 API 的版本为 2023-01-01 。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Title | String | 否 | task001 | 标题,支持中英文字符、数字,最大长度为 10 个字符 |
TaskId | String | 是 | 8fde6aa0281*********59a6e242365 | 任务 ID,任务的唯一标识 |
StartTime | Integer | 是 | 1640891476 | 开始时间,Unix 时间戳,单位为 s |
EndTime | Integer | 是 | 1640891976 | 结束时间,Unix 时间戳(秒) |
CallbackURL | String | 否 | http://example.mtime.cn/live/example/callbackapi | 回调地址,最大长度为 512 个字符 |
Type | Integer | 是 |
| 拉流来源类型。支持以下 2 种取值。
|
CycleMode | Integer | 否 |
| 循环模式。当
|
DstAddr | String | 否 | rtmp://example.mtime.cn/Video/2022/02/04/mp4/190204084208765161.mp4 | 推流地址 |
Domain | String | 否 | push.example.com | 推流域名,DstAddr 为空时必传;反之,则该参数不生效 |
App | String | 否 | live | 推流 App 名称,DstAddr 为空时必传;反之,则该参数不生效 |
Stream | String | 否 | stream-123 | 转推的推流流名,DstAddr 为空时必传;反之,则该参数不生效 |
SrcAddr | String | 否 |
| 拉流地址,当 |
SrcAddrS | Array of String | 否 | ["http://example.mtime.cn/Video/2003/02/04/mp4/190204084208765161.mp4"] | 点播列表,当 Type 取值为 1 ,即拉流来源为点播视频时,为必选项 |
Watermark | Object of Watermark | 否 | - | 水印信息 |
PreDownload | Integer | 否 |
| 是否开启点播预热,仅对点播地址生效。
|
OffsetS | Array of Float | 否 | [1.1] | 点播文件启播时间偏移值, 单位秒;数量与 SrcAddrS 列表数量相等。 |
ContinueStrategy | Integer | 否 |
| 续播策略,支持以下配置项。
|
Offset | Float | 否 | 30 | 点播文件启播时间偏移值,仅当 SrcAddr 不为空时生效。 |
PlayTimes | Integer | 否 | 3 | 播放次数,仅当 CycleMode 为 0 时生效。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Picture | String | 是 |
| 水印图片字符串,图片最大 2MB,最小 100Bytes,最大分辨率为 1080×1080。图片 Data URL 格式为:
|
RelativePosX | Float | 是 | 0.1 | 水平偏移,表示水印左侧边与转码流画面左侧边之间的距离,使用相对比率,取值范围为 [0,1) |
RelativePosY | Float | 是 | 0.1 | 垂直偏移,表示水印顶部边与转码流画面顶部边之间的距离,使用相对比率,取值范围为 [0,1) |
Ratio | Float | 是 | 0.1 | 水印宽度,占直播原始画面宽度百分比,支持精度,小数点后两位 |
本接口无特有的返回参数。更多信息请见返回结构。
POST https://live.volcengineapi.com?Action=UpdatePullToPushTask&Version=2023-01-01 { "Type": 0, "DstAddr": "rtmp://example.mtime.cn/Video/2022/02/04/mp4/190204084208765161.mp4", "EndTime": 1640891476, "SrcAddr": "http://example.mtime.cn/Video/2003/02/04/mp4/190204084208765161.mp4", "TaskId": "8fde6aa0281d9f6e15e6059a6e242365", "StartTime": 1640841476, "Title": "suexample007", "CallbackURL": "http://example.mtime.cn/live/example/callbackapi" }
{ "ResponseMetadata": { "RequestId": "202112311522300102252431180946DD57", "Action": "UpdatePullToPushTask", "Version": "2023-01-01", "Service": "live", "Region": "cn-north-1" } }
下表仅列出本接口特有的错误码。更多信息请参见公共错误码获取详细信息。
状态码 | 错误码 | 错误信息 | 说明 |
---|---|---|---|
200 | CommonErr | - | 未分类错误。建议重试,如果仍返回该错误码,请联系技术支持。 |
400 | InvalidParam | - | 输入的参数无效或不符合要求,请参照请求参数说明进行检查。 |
400 | InvalidParam.BindError | Request parameter error, please check input data | 参数未通过校验,请检查参数类型是否正确。 |
400 | InvalidParam.Format | %s format error | 参数格式错误,请检查错误消息中指定参数中是否存在非法字符或 URL 格式错误。 |
400 | InvalidParam.OutOfRange | %s should be one of {[%s]}%s should be between %d and %d | 参数超出允许范围,请检查错误消息中指定参数的取值是否超出取值范围。 |
403 | RequestForbidden | - | 请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。 |
403 | RequestForbidden.AccountIDNotAllow | this AccountID does not have permission to access the corresponding resource, please check the request parameters | 请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。 |
403 | RequestForbidden.BillingStatus | Billing status is not available for the AccountID, please activate the service or recharge. | 未开通视频直播服务或账号欠费,造成账单不可用,请检查服务开通情况和账号欠费情况。 |
404 | ResourceNotFound | - | 未找到资源(域名空间、域名、应用、配置模版、证书)。建议重试,如果仍返回该错误码,请联系技术支持。 |
429 | RequestLimitExceeded | - | 请求创建的资源(域名空间、域名、应用、配置模版、证书)超出限制。 |
500 | InternalError | an internal error occurred, please contact the administrator. | 出现内部错误,请联系技术支持。 |
502 | InternalServiceError | an internal error occurred, please contact the administrator. | 服务间出现错误,请联系技术支持。 |
502 | InternalServiceError.BadResponse | an internal error occurred, please contact the administrator. | 服务间出现错误,请联系技术支持。 |
504 | InternalServiceTimeout | Internal Service is timeout. please contact the administrator. | 内部服务超时,请联系技术支持。 |