You need to enable JavaScript to run this app.
导航

生成推流地址

最近更新时间2023.10.12 17:39:59

首次发布时间2022.09.27 17:56:43

调用接口生成推流地址。

说明

该接口属于历史版本 API,我们计划于 2023 年 12 月 25 日停止对其进行维护,并于 2024 年 3 月 25 日下线文档,建议您使用新版生成推流地址接口。

注意事项

请求频率:单用户请求频率限制为 25 次/秒

请求说明

  • 请求方式:POST
  • 请求地址:https://live.volcengineapi.com?Action=GeneratePushURL&Version=2020-08-01

请求参数

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

Query

参数类型是否必选示例值描述
ActionStringGeneratePushURL接口名称。当前 API 的名称为 GeneratePushURL
VersionString2020-08-01接口版本。当前 API 的版本为 2020-08-01

Body

参数类型是否必选示例值描述
VhostStringpush.example.com域名空间名称
AppStringlive应用名称
StreamStringstream001流名称

ValidDuration

Integer

5

有效时长,推流地址的有效时间,过期后需要重新生成。单位为秒,取值 ﹥0,缺省情况下表示 7 天。

说明

如果同时设置 ValidDurationExpiredTime,以 ExpiredTime 的时间为准。

ExpiredTime

String

2023-08-19T16:07:25+08:00

过期时间,推流地址的有效时间,过期后需要重新生成。RFC3339 格式的 UTC 时间,精度为秒,缺省情况下表示 7 天。

说明

如果同时设置 ValidDurationExpiredTime,以 ExpiredTime 的时间为准。

DomainString推流域名名称,需要推流地址的域名,不填返回Vhost下所有推流域名生成的地址

返回参数

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

参数类型示例值描述
PushURLListArray of String["rtmp://push.example.com/live/stream001"]RTMP 推流地址
PushURLListDetailArray of PushURLListDetail-推流地址详情

TsOverSrtURLList

Array of String

[
"srt://push.example.com:9000?streamid=#!::h=push.example.com,r=live/stream001,m=publish",
	"WebTransportURLList":	["https://push.example.com/live/stream001"]
]

TS over SRT 推流地址

RtmpOverSrtURLListArray of String["rtmp://push.example.com:1999/live/stream001"]RTMP over SRT 推流地址
RtmURLListArray of String["http://push.example.com/live/stream001.sdp"]RTM 推流地址
WebTransportURLListArray of String["https://push.example.com/live/stream001"]网络传输推流地址

PushURLListDetail

参数类型示例值描述
URLStringrtmp://live.push.example.com/live/stream001推流地址
DomainAppStringrtmp://push.example.com/live/OBS 推流地址,例如,rtmp://push.example.com/live/
StreamSignStringstream001OBS 推流名称,例如,streamname1?volcTime=1675652376&volcSecret=c57d247c2f19b395b6ec9b182******7

示例

请求示例

POST https://live.volcengineapi.com?Action=GeneratePushURL&Version=2020-08-01
{
  "Vhost": "push.example.com",
  "Domain": "push.example.com",
  "App": "live",
  "Stream": "stream001",
  "ExpiredTime": "2022-08-19T16:07:25+08:00"
}

返回示例

{
  "ResponseMetadata":{
    "RequestId":"2022081915573801022524312506B8B2EA",
    "Action":"GeneratePushURL",
    "Version":"2020-08-01",
    "Service":"live",
    "Region": "cn-north-1"
  },
  "Result": {
    "PushURLList": [
      "rtmp://example.org/live/test1"
    ],
    "PushURLListDetail": [
      {
        "DomainApp": "rtmp://example.org/live/",
        "StreamSign": "test1",
        "URL": "rtmp://example.org/live/test1"
      }
    ],
    "RtmURLList": [
      "http://example.org/live/test1.sdp"
    ],
    "RtmpOverSrtURLList": [
      "rtmp://example.org:1999/live/test1"
    ],
    "TsOverSrtURLList": [
      "srt://example.org:9000?streamid=#!::h=example.org,r=live/test1,m=publish",
      "WebTransportURLList": ["https://example.org/live/test1"]
    ]
  } 
}

错误码

访问公共错误码获取详细信息。