mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-09 07:20:03 +08:00
Updated MediaServer支持的HTTP API (markdown)
@@ -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 #成功
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user