You need to enable JavaScript to run this app.
导航
StartStream - 启用视频流
最近更新时间:2025.06.30 13:08:35首次发布时间:2023.06.27 11:40:50
我的收藏
有用
有用
无用
无用

启用指定视频流(适用于接入类型为 GB 的空间内的视频流)。

请求说明

  • 请求方式:POST
  • 请求地址:https://open.volcengineapi.com?Action=StartStream&Version=2021-01-01

调试

请求参数

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

参数
类型
是否必填
示例值
描述
Action
String

StartStream

要执行的操作,取值:StartStream。

Version
String

2021-01-01

API的版本,取值:2021-01-01。

SpaceID
String

spacxxxxxuuid

空间ID

StreamingIndex
Integer

0

主子码流编号,取值及含义如下所示。

  • 0:主码流;
  • 1~n:子码流。

说明

  • 如果 StreamType 和 Resolution 都不指定,则默认拉取主码流;
  • StreamType 和 Resolution 参数不能同时指定。
StreamID
String

524c804d-0149-4b58-8209-2f17f6xxxxxx

视频流 ID,可通过调用 ListStreams 接口获。

Resolution
String

3

分辨率编码(可参考 GB28181-2022 协议附录G中的定义),取值及含义如下所示。

  • 1(QCIF - 176x144)
  • 2(CIF - 320x288)
  • 3(4CIF - 704x576)
  • 4(D1 - 720x576)
  • 5(720p)
  • 6(1080p/i)
  • 其他(自定义宽高,如19201080等,需设备支持)

说明

  • 如果 StreamType 和 Resolution 都不指定,则默认拉取主码流;
  • StreamType 和 Resolution 参数不能同时指定。
IgnoreAudio
String

1

是否忽略音频,取值及含义如下所示。

  • 1:忽略;
  • 0:不忽略(默认值)。
FreshExpiredPull
String

1

是否检查并刷新过期的 URL,需要先开启域名防盗链,取值及含义如下所示。

  • 1:刷新(默认值);
  • 0:不刷新。
EnableAudioTranscode
String

0

是否开启音频转码,开启后会将音频编码由 G.711 转为 AAC,取值及含义如下所示。

  • 1:转码;
  • 0:不转码(默认值)。

返回参数

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

参数
类型
示例值
描述
TransPullUrls
Array of String

{"rtmp://xxx/vhost/app/name"}"}

转码流

ID
String

4b9ee060-9fed-4c0e-aaa4-283b17xxxxxx

启用成功的视频流 ID。

PullUrls
Array of String

["rtmp://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001","http://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001.flv","http://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001.m3u8","http://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001.sdp"]

拉流地址。

请求示例

POST https://open.volcengineapi.com?Action=StartStream&Version=2021-01-01&StreamID=
{
    "StreamingIndex": 0,
    "Resolution": "4"
}

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202112081609140102120720962400088F",
        "Action": "StartStream",
        "Version": "2021-01-01",
        "Service": "aiotvideo",
        "Region": "cn-north-1"
    },
    "Result": {
        "ID": "4b9ee060-9fed-4c0e-aaa4-283b17xxxxxx",
        "PullUrls": [
            "rtmp://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001",
            "http://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001.flv",
            "http://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001.m3u8",
            "http://xxxx.fcdn-xxx-pull.org/xxxx/xxx000001.sdp"
        ]
    }
}

错误码

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

状态码
错误码
错误信息
说明
400
ErrorStartStreamInvalidArgs

InvalidParameter.StartStream

500
InternalErrorStreamDB

InternalError.StreamDB

500
NotFoundSpace

NotFound.SpaceData

500
InternalError.StreamDB

The request is failed due to the stream can not be found due to db err.