Updated MediaServer支持的HTTP API (markdown)

夏楚
2020-09-06 18:13:50 +08:00
parent cc70873877
commit 0d13008783

@@ -1,6 +1,6 @@
## 下载postman配置文件(可以在线测试restful api)
[postman配置文件](https://github.com/xiongziliang/ZLMediaKit/tree/master/postman)
[postman配置文件](https://github.com/xia-chu/ZLMediaKit/tree/master/postman)
## API预览
@@ -35,6 +35,8 @@ MediaServer是ZLMediaKit的主进程目前支持以下http api接口这些
"/index/api/openRtpServer",
"/index/api/closeRtpServer",
"/index/api/listRtpServer",
"/index/api/startSendRtp",
"/index/api/stopSendRtp"
```
其中POST方式参数既可以使用urlencoded方式也可以使用json方式。
@@ -938,3 +940,31 @@ typedef enum {
}
```
### 27、`/index/api/startSendRtp`
- 功能作为GB28181客户端启动ps-rtp推流支持rtp/udp方式该接口支持rtsp/rtmp等协议转ps-rtp推流。第一次推流失败会直接返回错误成功一次后后续失败也将无限重试。
- 范例:[http://127.0.0.1/index/api/startSendRtp?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=test&ssrc=1&dst_url=127.0.0.1&dst_port=10000&is_udp=0](http://127.0.0.1/index/api/startSendRtp?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=test&ssrc=1&dst_url=127.0.0.1&dst_port=10000&is_udp=0)
- 参数:
| 参数 | 是否必选 | 释意 |
| :----: | :------: | :----------------------------------------------------------: |
| secret | Y | api操作密钥(配置文件配置)如果操作ip是127.0.0.1,则不需要此参数 |
| vhost | Y | 虚拟主机例如__defaultVhost__ |
| app | Y | 应用名,例如 live |
| stream | Y | 流id例如 test |
| ssrc | Y | 推流的rtp的ssrc |
| dst_url | Y | 目标ip或域名 |
| dst_port | Y | 目标端口 |
| is_udp | Y | 是否为udp模式,否则为tcp模式 |
- 响应:
```json
{
"code": 0 #成功
}
```