postman 自动生成的restful api接口
xiongguangjie edited this page 2024-03-15 19:28:04 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Project: ZLMediaKit

媒体服务器

End-point: 获取服务器api列表(getApiList)

Method: GET

http://zlmediakit.com:8880/index/api/getApiList?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)

End-point: 获取网络线程负载(getThreadsLoad)

Method: GET

http://zlmediakit.com:8880/index/api/getThreadsLoad?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)

End-point: 获取主要对象个数(getStatistic)

Method: GET

http://zlmediakit.com:8880/index/api/getStatistic?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)

End-point: 获取后台线程负载(getWorkThreadsLoad)

Method: GET

http://zlmediakit.com:8880/index/api/getWorkThreadsLoad?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)

End-point: 获取服务器配置(getServerConfig)

Method: GET

http://zlmediakit.com:8880/index/api/getServerConfig?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)

End-point: 设置服务器配置(setServerConfig)

Method: GET

http://zlmediakit.com:8880/index/api/setServerConfig?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&api.apiDebug=0

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
api.apiDebug 0 配置键与配置项值

End-point: 重启服务器(restartServer)

Method: GET

http://zlmediakit.com:8880/index/api/restartServer?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)

End-point: 获取流列表(getMediaList)

Method: GET

http://zlmediakit.com:8880/index/api/getMediaList?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtmp 筛选协议,例如 rtsp或rtmp
vhost defaultVhost 筛选虚拟主机例如__defaultVhost__
app null 筛选应用名,例如 live
stream null 筛选流id例如 test

End-point: 关断单个流(close_stream)

Method: GET

http://zlmediakit.com:8880/index/api/close_stream?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=live&stream=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtsp 协议,例如 rtsp或rtmp
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream test 流id例如 test
force 1 是否强制关闭(有人在观看是否还关闭)

End-point: 批量关断流(close_streams)

Method: GET

http://zlmediakit.com:8880/index/api/close_streams?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=live&stream=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtsp 协议,例如 rtsp或rtmp
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream test 流id例如 test
force 1 是否强制关闭(有人在观看是否还关闭)

End-point: 获取Session列表(getAllSession)

Method: GET

http://zlmediakit.com:8880/index/api/getAllSession?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
local_port 筛选本机端口例如筛选rtsp链接554
peer_ip null 筛选客户端ip

End-point: 断开tcp连接(kick_session)

Method: GET

http://zlmediakit.com:8880/index/api/kick_session?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&id=123456

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
id 123456 客户端唯一id可以通过getAllSession接口获取

End-point: 批量断开tcp连接(kick_sessions)

Method: GET

http://zlmediakit.com:8880/index/api/kick_sessions?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
local_port 筛选本机端口例如筛选rtsp链接554
peer_ip null 筛选客户端ip

End-point: 添加rtsp/rtmp/hls拉流代理(addStreamProxy)

Method: GET

http://zlmediakit.com:8880/index/api/addStreamProxy?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=test&url=rtmp://live.hkstv.hk.lxdns.com/live/hks2

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 添加的流的虚拟主机例如__defaultVhost__
app live 添加的流的应用名例如live
stream test 添加的流的id名例如test
url rtmp://live.hkstv.hk.lxdns.com/live/hks2 拉流地址例如rtmp://live.hkstv.hk.lxdns.com/live/hks2
rtp_type null rtsp拉流时拉流方式0tcp1udp2组播
timeout_sec 10 拉流超时时间单位秒float类型
retry_count 拉流重试次数,不传此参数或传值<=0时则无限重试
enable_hls null 是否转hls-ts
enable_hls_fmp4 null 是否转hls-fmp4
enable_mp4 null 是否mp4录制
enable_rtsp 1 是否转协议为rtsp/webrtc
enable_rtmp 1 是否转协议为rtmp/flv
enable_ts 1 是否转协议为http-ts/ws-ts
enable_fmp4 1 是否转协议为http-fmp4/ws-fmp4
enable_audio 1 转协议是否开启音频
add_mute_audio 1 转协议无音频时是否添加静音aac音频
mp4_save_path null mp4录制保存根目录置空使用默认目录
mp4_max_second 1800 mp4录制切片大小单位秒
hls_save_path null hls保存根目录置空使用默认目录
modify_stamp null 是否修改原始时间戳默认值2取值范围0.采用源视频流绝对时间戳,不做任何改变;1.采用zlmediakit接收数据时的系统时间戳(有平滑处理);2.采用源视频流时间戳相对时间戳(增长量),有做时间戳跳跃和回退矫正
auto_close null 无人观看时,是否直接关闭(而不是通过on_none_reader hook返回close)

End-point: 关闭拉流代理(delStreamProxy)

Method: GET

http://zlmediakit.com:8880/index/api/delStreamProxy?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&key=__defaultVhost__/live/1

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
key defaultVhost/live/1 addStreamProxy接口返回的key

End-point: 添加rtsp/rtmp推流(addStreamPusherProxy)

Method: GET

http://zlmediakit.com:8880/index/api/addStreamPusherProxy?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtmp&vhost=__defaultVhost__&app=live&stream=test&dst_url=rtmp://192.168.1.104/live/push

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtmp 推流协议支持rtsp、rtmp大小写敏感
vhost defaultVhost 已注册流的虚拟主机一般为__defaultVhost__
app live 已注册流的应用名例如live
stream test 已注册流的id名例如test
dst_url rtmp://192.168.1.104/live/push 推流地址需要与schema字段协议一致
rtp_type 0 rtsp推流时推流方式0tcp1udp
timeout_sec 10 推流超时时间单位秒float类型
retry_count null 推流重试次数,不传此参数或传值<=0时则无限重试

End-point: 关闭推流(delStreamPusherProxy)

Method: GET

http://zlmediakit.com:8880/index/api/delStreamPusherProxy?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&key=rtmp/__defaultVhost__/live/test/f40a8ab006cac16ecc0858409e890491

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
key rtmp/defaultVhost/live/test/f40a8ab006cac16ecc0858409e890491 addStreamPusherProxy接口返回的key

End-point: 添加FFmpeg拉流代理(addFFmpegSource)

Method: GET

http://zlmediakit.com:8880/index/api/addFFmpegSource?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&src_url=http://hefeng.live.tempsource.cjyun.org/videotmp/s10100-hftv.m3u8&dst_url=rtmp://127.0.0.1/live/hks2&timeout_ms=10000&enable_hls=0&enable_mp4=0

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
src_url http://hefeng.live.tempsource.cjyun.org/videotmp/s10100-hftv.m3u8 FFmpeg拉流地址,支持任意协议或格式(只要FFmpeg支持即可)
dst_url rtmp://127.0.0.1/live/hks2 FFmpeg rtmp推流地址一般都是推给自己例如rtmp://127.0.0.1/live/stream_form_ffmpeg
timeout_ms 10000 FFmpeg推流成功超时时间,单位毫秒
enable_hls 0 是否开启hls录制
enable_mp4 0 是否开启mp4录制
ffmpeg_cmd_key ffmpeg.cmd_hd FFmpeg命名参数模板置空则采用配置项:ffmpeg.cmd

End-point: 关闭FFmpeg拉流代理(delFFmpegSource)

Method: GET

http://zlmediakit.com:8880/index/api/delFFmpegSource?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&key=5f748d2ef9712e4b2f6f970c1d44d93a

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
key 5f748d2ef9712e4b2f6f970c1d44d93a undefined

End-point: 流是否在线(isMediaOnline)

Method: GET

http://zlmediakit.com:8880/index/api/isMediaOnline?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=proxy&stream=1

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtsp 协议,例如 rtsp或rtmp
vhost defaultVhost 虚拟主机例如__defaultVhost__
app proxy 应用名,例如 live
stream 1 流id例如 test

End-point: 获取媒体流播放器列表(getMediaPlayerList)

Method: GET

http://zlmediakit.com:8880/index/api/getMediaPlayerList?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=proxy&stream=1

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtsp 协议,例如 rtsp或rtmp
vhost defaultVhost 虚拟主机例如__defaultVhost__
app proxy 应用名,例如 live
stream 1 流id例如 test

End-point: 广播webrtc datachannel消息(broadcastMessage)

Method: GET

http://zlmediakit.com:8880/index/api/broadcastMessage?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=live&stream=test&msg=Hello ZLMediakit

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtsp 协议,例如 rtsp或rtmp目前仅支持rtsp协议
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream test 流id例如 test
msg Hello ZLMediakit undefined

End-point: 获取流信息(getMediaInfo)

Method: GET

http://zlmediakit.com:8880/index/api/getMediaInfo?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=live&stream=mym9

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
schema rtsp 协议,例如 rtsp或rtmp
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream mym9 流id例如 test

End-point: 获取流信息(getMp4RecordFile)

Method: GET

http://zlmediakit.com:8880/index/api/getMp4RecordFile?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=proxy&stream=2&customized_path=/www&period=2020-05-26

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 虚拟主机例如__defaultVhost__
app proxy 应用名,例如 live
stream 2 流id例如 test
customized_path /www 录像文件保存自定义根目录,为空则采用配置文件设置
period 2020-05-26 流的录像日期格式为2020-02-01,如果不是完整的日期那么是搜索录像文件夹列表否则搜索对应日期下的mp4文件列表

End-point: 删除录像文件夹(deleteRecordDirectory)

Method: GET

http://zlmediakit.com:8880/index/api/deleteRecordDirectory?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=proxy&stream=2&period=2020-01-01

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 虚拟主机例如__defaultVhost__
app proxy 应用名,例如 live
stream 2 流id例如 test
period 2020-01-01 流的录像日期格式为2020-01-01,如果不是完整的日期,那么会删除失败

End-point: 开始录制(startRecord)

Method: GET

http://zlmediakit.com:8880/index/api/startRecord?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&type=1&vhost=__defaultVhost__&app=live&stream=obs

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
type 1 0为hls1为mp4
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream obs 流id例如 obs
customized_path null 录像文件保存自定义根目录,为空则采用配置文件设置
max_second 1000 MP4录制的切片时间大小单位秒

End-point: 设置录像速度(setRecordSpeed)

Method: GET

http://zlmediakit.com:8880/index/api/setRecordSpeed?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=obs&speed=2.0

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream obs 流id例如 obs
speed 2.0 要设置的录像倍速

End-point: 设置录像流播放位置(seekRecordStamp)

Method: GET

http://zlmediakit.com:8880/index/api/seekRecordStamp?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=obs&stamp=1000

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream obs 流id例如 obs
stamp 1000 要设置的录像播放位置

End-point: 停止录制(stopRecord)

Method: GET

http://zlmediakit.com:8880/index/api/stopRecord?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&type=1&vhost=__defaultVhost__&app=live&stream=obs

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
type 1 0为hls1为mp4
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream obs 流id例如 obs

End-point: 是否正在录制(isRecording)

Method: GET

http://zlmediakit.com:8880/index/api/isRecording?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&type=1&vhost=__defaultVhost__&app=live&stream=obs

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
type 1 0为hls1为mp4
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream obs 流id例如 obs

End-point: 获取截图(getSnap)

Method: GET

http://zlmediakit.com:8880/index/api/getSnap?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&url=rtsp://www.mym9.com/101065?from=2019-06-28/01:12:13&timeout_sec=10&expire_sec=1

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
url rtsp://www.mym9.com/101065?from=2019-06-28/01:12:13 需要截图的url可以是本机的也可以是远程主机的
timeout_sec 10 截图失败超时时间防止FFmpeg一直等待截图
expire_sec 1 截图的过期时间,该时间内产生的截图都会作为缓存返回

End-point: 获取rtp推流信息(getRtpInfo)

Method: GET

http://zlmediakit.com:8880/index/api/getRtpInfo?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&stream_id=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
stream_id test 流id

End-point: 创建RTP服务器(openRtpServer)

Method: GET

http://zlmediakit.com:8880/index/api/openRtpServer?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&port=0&tcp_mode=1&stream_id=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
port 0 绑定的端口0时为随机端口
tcp_mode 1 tcp模式0时为不启用tcp监听1时为启用tcp监听2时为tcp主动连接模式
stream_id test 该端口绑定的流id
re_use_port 0 是否重用端口默认为0非必选参数
ssrc 0 是否指定收流的rtp ssrc, 十进制数字不指定或指定0时则不过滤rtp非必选参数
only_track 1 是否为单音频/单视频track0不设置1单音频2单视频
local_ip :: 指定创建RTP的本地ipipv4可填”0.0.0.0“ipv6可填”::“,一般保持默认

End-point: 创建多路复用RTP服务器(openRtpServerMultiplex)

Method: GET

http://zlmediakit.com:8880/index/api/openRtpServerMultiplex?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&port=0&tcp_mode=1&stream_id=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
port 0 绑定的端口0时为随机端口
tcp_mode 1 tcp模式0时为不启用tcp监听1时为启用tcp监听
stream_id test 该端口绑定的流id
only_track 0 是否为单音频/单视频track0不设置1单音频2单视频
local_ip :: 指定创建RTP的本地ipipv4可填”0.0.0.0“ipv6可填”::“,一般保持默认

End-point: 连接RTP服务器(connectRtpServer)

Method: GET

http://zlmediakit.com:8880/index/api/connectRtpServer?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&dst_url=0&dst_port=1&stream_id=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
dst_url 0 tcp主动模式时服务端地址
dst_port 1 tcp主动模式时服务端端口
stream_id test OpenRtpServer时绑定的流id

End-point: 关闭RTP服务器(closeRtpServer)

Method: GET

http://zlmediakit.com:8880/index/api/closeRtpServer?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&stream_id=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
stream_id test 该端口绑定的流id

End-point: 更新RTP服务器过滤SSRC(updateRtpServerSSRC)

Method: GET

http://zlmediakit.com:8880/index/api/updateRtpServerSSRC?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&stream_id=test&ssrc=123456

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
stream_id test 该端口绑定的流id
ssrc 123456 十进制ssrc

End-point: 暂停RTP超时检查(pauseRtpCheck)

Method: GET

http://zlmediakit.com:8880/index/api/pauseRtpCheck?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&stream_id=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
stream_id test 该端口绑定的流id

End-point: 恢复RTP超时检查(resumeRtpCheck)

Method: GET

http://zlmediakit.com:8880/index/api/resumeRtpCheck?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&stream_id=test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
stream_id test 该端口绑定的流id

End-point: 获取RTP服务器列表(listRtpServer)

Method: GET

http://zlmediakit.com:8880/index/api/listRtpServer?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)

End-point: 开始发送rtp(startSendRtp)

Method: GET

http://zlmediakit.com:8880/index/api/startSendRtp?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=obs&ssrc=1&dst_url=127.0.0.1&dst_port=10000&is_udp=0

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream obs 流id例如 obs
ssrc_multi_send 0 是否支持同ssrc推流到多个上级服务器,该参数非必选参数 默认false
ssrc 1 rtp推流的ssrc
dst_url 127.0.0.1 目标ip或域名
dst_port 10000 目标端口
is_udp 0 是否为udp模式,否则为tcp模式
src_port 0 指定tcp/udp客户端使用的本地端口0时为随机端口该参数非必选参数不传时为随机端口。
from_mp4 0 是否推送本地MP4录像该参数非必选参数
use_ps 1 rtp打包采用ps还是es模式默认采用ps模式该参数非必选参数
pt 96 rtp payload type默认96该参数非必选参数
only_audio 1 rtp es方式打包时是否只打包音频该参数非必选参数
udp_rtcp_timeout 0 udp方式推流时是否开启rtcp发送和rtcp接收超时判断开启后(默认关闭)如果接收rr rtcp超时将导致主动停止rtp发送
recv_stream_id 发送rtp同时接收一般用于双向语言对讲, 如果不为空说明开启接收值为接收流的id

End-point: 开始tcp passive被动发送rtp(startSendRtpPassive)

Method: GET

http://zlmediakit.com:8880/index/api/startSendRtpPassive?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=test&ssrc=1

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream test 流id例如 obs
ssrc 1 rtp推流的ssrcssrc不同时可以推流到多个上级服务器
src_port 0 指定tcp/udp客户端使用的本地端口0时为随机端口该参数非必选参数不传时为随机端口。
from_mp4 0 是否推送本地MP4录像该参数非必选参数
use_ps 1 rtp打包采用ps还是es模式默认采用ps模式该参数非必选参数
pt 96 rtp payload type默认96该参数非必选参数
only_audio 1 rtp es方式打包时是否只打包音频该参数非必选参数
recv_stream_id 发送rtp同时接收一般用于双向语言对讲, 如果不为空说明开启接收值为接收流的id
close_delay_ms 5000 等待tcp连接超时时间单位毫秒默认5000毫秒

End-point: 停止 发送rtp(stopSendRtp)

Method: GET

http://zlmediakit.com:8880/index/api/stopSendRtp?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=obs

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 虚拟主机例如__defaultVhost__
app live 应用名,例如 live
stream obs 流id例如 obs
ssrc 根据ssrc关停某路rtp推流不传时关闭所有推流

End-point: 获取版本信息(version)

Method: GET

http://zlmediakit.com:8880/index/api/version?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc undefined

End-point: 获取拉流代理信息(getProxyInfo)

Method: GET

http://zlmediakit.com:8880/index/api/getProxyInfo?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&key=__defaultVhost__/live/test

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc undefined
key defaultVhost/live/test undefined

End-point: 获取推流代理信息(getProxyPusherInfo)

Method: GET

http://zlmediakit.com:8880/index/api/getProxyPusherInfo?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&key=rtmp/__defaultVhost__/live/test/f40a8ab006cac16ecc0858409e890491

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc undefined
key rtmp/defaultVhost/live/test/f40a8ab006cac16ecc0858409e890491 undefined

End-point: 点播mp4文件(loadMP4File)

Method: GET

http://zlmediakit.com:8880/index/api/loadMP4File?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&vhost=__defaultVhost__&app=live&stream=test&file_path=/path/to/mp4/file.mp4

Query Params

Param value description
secret 035c73f7-bb6b-4889-a715-d9eb2d1925cc api操作密钥(配置文件配置)
vhost defaultVhost 添加的流的虚拟主机例如__defaultVhost__
app live 添加的流的应用名例如live
stream test 添加的流的id名例如test
file_path /path/to/mp4/file.mp4 mp4文件绝对路径
file_repeat 1 是否循环点播mp4文件如果配置文件已经开启循环点播此参数无效
enable_hls 是否转hls-ts
enable_hls_fmp4 是否转hls-fmp4
enable_mp4 是否mp4录制默认不开启(覆盖配置文件)
enable_rtsp 1 是否转协议为rtsp/webrtc
enable_rtmp 1 是否转协议为rtmp/flv
enable_ts 1 是否转协议为http-ts/ws-ts
enable_fmp4 1 是否转协议为http-fmp4/ws-fmp4
enable_audio 1 转协议是否开启音频
add_mute_audio 1 转协议无音频时是否添加静音aac音频
mp4_save_path mp4录制保存根目录置空使用默认目录
mp4_max_second 1800 mp4录制切片大小单位秒
hls_save_path hls保存根目录置空使用默认目录
modify_stamp 是否修改原始时间戳默认值2取值范围0.采用源视频流绝对时间戳,不做任何改变;1.采用zlmediakit接收数据时的系统时间戳(有平滑处理);2.采用源视频流时间戳相对时间戳(增长量),有做时间戳跳跃和回退矫正
auto_close 无人观看时,是否直接关闭(而不是通过on_none_reader hook返回close);强制开启,此参数不生效

End-point: 下载文件(downloadFile)

Method: GET

http://zlmediakit.com:8880/index/api/downloadFile?file_path=/path/to/file.ext

Query Params

Param value description
file_path /path/to/file.ext 文件绝对路径根据文件名生成Content-Type该接口将触发on_http_access hook
save_name test 浏览器下载文件后保存文件名;可选参数


Powered By: postman-to-markdown