Package io.github.lunasaw.zlm.api
Class ZlmRestService
java.lang.Object
io.github.lunasaw.zlm.api.ZlmRestService
- Version:
- 1.0
- Author:
- luna
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerResponse<StreamKey>
addFFmpegSource
(String host, String secret, StreamFfmpegItem streamFfmpegItem) static ServerResponse<StreamKey>
添加FFmpeg拉流代理static ServerResponse<StreamKey>
addStreamProxy
(String host, String secret, StreamProxyItem streamProxyItem) 添加代理拉流static ServerResponse<StreamKey>
添加rtsp/rtmp/hls拉流代理static ServerResponse<StreamKey>
addStreamPusherProxy
(String host, String secret, StreamPusherItem streamPusherItem) static ServerResponse<StreamKey>
添加rtsp/rtmp推流static ServerResponse<String>
广播webrtc datachannel消息static CloseRtpServerResult
closeRtpServer
(String host, String secret, String streamId) 关闭RTP服务器static ServerResponse<String>
closeStream
(String host, String secret, MediaReq mediaReq) static ServerResponse<String>
关断单个流static ServerResponse
批量关断流static OpenRtpServerResult
connectRtpServer
(String host, String secret, ConnectRtpServerReq req) static OpenRtpServerResult
连接RTP服务器static DeleteRecordDirectory
删除录像文件夹delFFmpegSource
(String host, String secret, String key) 关闭FFmpeg拉流代理delStreamProxy
(String host, String secret, String key) 关闭拉流代理delStreamPusherProxy
(String host, String secret, String key) 关闭推流static String
static String
static ServerResponse<List<TcpLink>>
getAllSession
(String host, String secret, String localPort, String peerIp) 获取所有TcpSession列表(获取所有tcp客户端相关信息)static ServerResponse<List<TcpLink>>
获取Session列表static ServerResponse<List<String>>
getApiList
(String host, String secret) static ServerResponse<List<String>>
获取流媒体服务器列表static ServerResponse<MediaInfo>
getMediaInfo
(String host, String secret, MediaReq mediaReq) static ServerResponse<List<MediaData>>
getMediaList
(String host, String secret, MediaReq mediaReq) static ServerResponse<List<MediaData>>
获取流列表static ServerResponse<MediaPlayer>
getMediaPlayerList
(String host, String secret, MediaReq mediaReq) static ServerResponse<MediaPlayer>
获取媒体流播放器列表static ServerResponse<Mp4RecordFile>
getMp4RecordFile
(String host, String secret, RecordReq recordReq) static ServerResponse<Mp4RecordFile>
获取流信息static ServerResponse<String>
查询文件概览static ServerResponse<PlayUrl>
getPlaybackUrls
(String host, String secret, MediaReq mediaReq) 获取播放地址static ServerResponse<String>
获取拉流代理信息static ServerResponse<String>
获取推流代理信息static RtpInfoResult
getRtpInfo
(String host, String secret, String streamId) 获取rtp推流信息static ServerResponse<List<ServerNodeConfig>>
getServerConfig
(String host, String secret) 获取服务器配置static String
getSnap
(String host, String secret, SnapshotReq snapshotReq) static String
获取截图static ServerResponse<ImportantObjectNum>
getStatistic
(String host, String secret) 获取主要对象个数static ServerResponse<String>
获取存储信息static ServerResponse<List<ThreadLoad>>
getThreadsLoad
(String host, String secret) 获取网络线程负载static ServerResponse<Version>
getVersion
(String host, String secret) 获取版本信息static ServerResponse<List<ThreadLoad>>
getWorkThreadsLoad
(String host, String secret) 获取后台线程负载static MediaOnlineStatus
isMediaOnline
(String host, String secret, MediaReq mediaReq) static MediaOnlineStatus
流是否在线static ServerResponse<String>
isRecording
(String host, String secret, RecordReq recordReq) static ServerResponse<String>
是否正在录制static ServerResponse<String>
kickSession
(String host, String secret, String sessionId) 断开tcp连接static ServerResponse<String>
批量断开tcp连接static ServerResponse<List<RtpServer>>
listRtpServer
(String host, String secret) 获取RTP服务器列表static ServerResponse<String>
点播mp4文件static OpenRtpServerResult
openRtpServer
(String host, String secret, OpenRtpServerReq req) static OpenRtpServerResult
创建RTP服务器static OpenRtpServerResult
openRtpServerMultiplex
(String host, String secret, OpenRtpServerReq req) static OpenRtpServerResult
创建多路复用RTP服务器static ServerResponse<String>
pauseRtpCheck
(String host, String secret, String streamId) 暂停RTP超时检查static ServerResponse<Object>
重启服务器 重启服务器,只有Daemon方式才能重启,否则是直接关闭!static ServerResponse<String>
resumeRtpCheck
(String host, String secret, String streamId) 恢复RTP超时检查static ServerResponse<String>
seekRecordStamp
(String host, String secret, RecordReq recordReq) static ServerResponse<String>
设置录像流播放位置static ServerResponse<String>
setRecordSpeed
(String host, String secret, RecordReq recordReq) static ServerResponse<String>
设置录像速度static ServerResponse<String>
设置服务器配置static ServerResponse<String>
多文件推流static ServerResponse<String>
startRecord
(String host, String secret, RecordReq recordReq) static ServerResponse<String>
开始录制static StartSendRtpResult
startSendRtp
(String host, String secret, StartSendRtpReq req) static StartSendRtpResult
开始发送rtpstatic StartSendRtpResult
startSendRtpPassive
(String host, String secret, StartSendRtpReq req) static StartSendRtpResult
开始tcp passive被动发送rtpstatic ServerResponse<String>
关闭多文件推流static ServerResponse<String>
stopRecord
(String host, String secret, RecordReq recordReq) static ServerResponse<String>
停止录制static ServerResponse<String>
stopSendRtp
(String host, String secret, CloseSendRtpReq req) static ServerResponse<String>
停止 发送rtpstatic ServerResponse<String>
updateRtpServerSSRC
(String host, String secret, String streamId, String ssrc) 更新RTP服务器过滤SSRC
-
Constructor Details
-
ZlmRestService
public ZlmRestService()
-
-
Method Details
-
getVersion
获取版本信息 -
getApiList
-
getApiList
public static ServerResponse<List<String>> getApiList(String host, String secret, Map<String, String> params) 获取流媒体服务器列表 -
getThreadsLoad
获取网络线程负载 -
getStatistic
获取主要对象个数 -
getWorkThreadsLoad
获取后台线程负载 -
getServerConfig
获取服务器配置 -
setServerConfig
public static ServerResponse<String> setServerConfig(String host, String secret, Map<String, String> params) 设置服务器配置 -
restartServer
public static ServerResponse<Object> restartServer(String host, String secret, Map<String, String> params) 重启服务器 重启服务器,只有Daemon方式才能重启,否则是直接关闭! -
getMediaList
-
getMediaList
public static ServerResponse<List<MediaData>> getMediaList(String host, String secret, Map<String, String> params) 获取流列表 -
closeStream
-
closeStream
public static ServerResponse<String> closeStream(String host, String secret, Map<String, String> params) 关断单个流 -
closeStreams
批量关断流 -
getAllSession
public static ServerResponse<List<TcpLink>> getAllSession(String host, String secret, String localPort, String peerIp) 获取所有TcpSession列表(获取所有tcp客户端相关信息)- Parameters:
host
-secret
-localPort
- 筛选本机端口,例如筛选rtsp链接:554peerIp
- 筛选客户端ip- Returns:
-
getAllSession
public static ServerResponse<List<TcpLink>> getAllSession(String host, String secret, Map<String, String> params) 获取Session列表 -
kickSession
断开tcp连接 -
kickSessions
public static ServerResponse<String> kickSessions(String host, String secret, Map<String, String> params) 批量断开tcp连接 -
addStreamProxy
public static ServerResponse<StreamKey> addStreamProxy(String host, String secret, StreamProxyItem streamProxyItem) 添加代理拉流- Parameters:
host
-secret
-streamProxyItem
-- Returns:
-
addStreamProxy
public static ServerResponse<StreamKey> addStreamProxy(String host, String secret, Map<String, String> params) 添加rtsp/rtmp/hls拉流代理 -
delStreamProxy
public static ServerResponse<StreamKey.StringDelFlag> delStreamProxy(String host, String secret, String key) 关闭拉流代理 -
addStreamPusherProxy
public static ServerResponse<StreamKey> addStreamPusherProxy(String host, String secret, StreamPusherItem streamPusherItem) -
addStreamPusherProxy
public static ServerResponse<StreamKey> addStreamPusherProxy(String host, String secret, Map<String, String> params) 添加rtsp/rtmp推流 -
delStreamPusherProxy
public static ServerResponse<StreamKey.StringDelFlag> delStreamPusherProxy(String host, String secret, String key) 关闭推流 -
addFFmpegSource
public static ServerResponse<StreamKey> addFFmpegSource(String host, String secret, StreamFfmpegItem streamFfmpegItem) -
addFFmpegSource
public static ServerResponse<StreamKey> addFFmpegSource(String host, String secret, Map<String, String> params) 添加FFmpeg拉流代理 -
delFFmpegSource
public static ServerResponse<StreamKey.StringDelFlag> delFFmpegSource(String host, String secret, String key) 关闭FFmpeg拉流代理 -
isMediaOnline
-
isMediaOnline
public static MediaOnlineStatus isMediaOnline(String host, String secret, Map<String, String> params) 流是否在线 -
getMediaPlayerList
public static ServerResponse<MediaPlayer> getMediaPlayerList(String host, String secret, MediaReq mediaReq) -
getMediaPlayerList
public static ServerResponse<MediaPlayer> getMediaPlayerList(String host, String secret, Map<String, String> params) 获取媒体流播放器列表 -
broadcastMessage
public static ServerResponse<String> broadcastMessage(String host, String secret, Map<String, String> params) 广播webrtc datachannel消息 -
getMediaInfo
-
getPlaybackUrls
public static ServerResponse<PlayUrl> getPlaybackUrls(String host, String secret, MediaReq mediaReq) 获取播放地址 -
getMp4RecordFile
public static ServerResponse<Mp4RecordFile> getMp4RecordFile(String host, String secret, RecordReq recordReq) -
getMp4RecordFile
public static ServerResponse<Mp4RecordFile> getMp4RecordFile(String host, String secret, Map<String, String> params) 获取流信息 -
deleteRecordDirectory
public static DeleteRecordDirectory deleteRecordDirectory(String host, String secret, Map<String, String> params) 删除录像文件夹 -
startRecord
-
startRecord
public static ServerResponse<String> startRecord(String host, String secret, Map<String, String> params) 开始录制 -
setRecordSpeed
public static ServerResponse<String> setRecordSpeed(String host, String secret, RecordReq recordReq) -
setRecordSpeed
public static ServerResponse<String> setRecordSpeed(String host, String secret, Map<String, String> params) 设置录像速度 -
seekRecordStamp
public static ServerResponse<String> seekRecordStamp(String host, String secret, RecordReq recordReq) -
seekRecordStamp
public static ServerResponse<String> seekRecordStamp(String host, String secret, Map<String, String> params) 设置录像流播放位置 -
stopRecord
-
stopRecord
public static ServerResponse<String> stopRecord(String host, String secret, Map<String, String> params) 停止录制 -
isRecording
-
isRecording
public static ServerResponse<String> isRecording(String host, String secret, Map<String, String> params) 是否正在录制 -
getSnap
-
getSnap
获取截图 -
getMp4RecordSummary
public static ServerResponse<String> getMp4RecordSummary(String host, String secret, Map<String, String> params) 查询文件概览 -
getRtpInfo
获取rtp推流信息- Parameters:
streamId
- RTP的ssrc,16进制字符串或者是流的id(openRtpServer接口指定)
-
openRtpServer
-
openRtpServer
public static OpenRtpServerResult openRtpServer(String host, String secret, Map<String, String> params) 创建RTP服务器 -
openRtpServerMultiplex
public static OpenRtpServerResult openRtpServerMultiplex(String host, String secret, OpenRtpServerReq req) -
openRtpServerMultiplex
public static OpenRtpServerResult openRtpServerMultiplex(String host, String secret, Map<String, String> params) 创建多路复用RTP服务器 -
connectRtpServer
public static OpenRtpServerResult connectRtpServer(String host, String secret, ConnectRtpServerReq req) -
connectRtpServer
public static OpenRtpServerResult connectRtpServer(String host, String secret, Map<String, String> params) 连接RTP服务器 -
closeRtpServer
关闭RTP服务器 -
updateRtpServerSSRC
public static ServerResponse<String> updateRtpServerSSRC(String host, String secret, String streamId, String ssrc) 更新RTP服务器过滤SSRC -
pauseRtpCheck
暂停RTP超时检查 -
resumeRtpCheck
恢复RTP超时检查 -
listRtpServer
获取RTP服务器列表 -
startSendRtp
-
startSendRtp
public static StartSendRtpResult startSendRtp(String host, String secret, Map<String, String> params) 开始发送rtp -
startSendRtpPassive
public static StartSendRtpResult startSendRtpPassive(String host, String secret, StartSendRtpReq req) -
startSendRtpPassive
public static StartSendRtpResult startSendRtpPassive(String host, String secret, Map<String, String> params) 开始tcp passive被动发送rtp -
stopSendRtp
-
stopSendRtp
public static ServerResponse<String> stopSendRtp(String host, String secret, Map<String, String> params) 停止 发送rtp -
getProxyInfo
public static ServerResponse<String> getProxyInfo(String host, String secret, Map<String, String> params) 获取拉流代理信息 -
getProxyPusherInfo
public static ServerResponse<String> getProxyPusherInfo(String host, String secret, Map<String, String> params) 获取推流代理信息 -
startMultiMp4Publish
public static ServerResponse<String> startMultiMp4Publish(String host, String secret, Map<String, String> params) 多文件推流 -
getStorageSpace
public static ServerResponse<String> getStorageSpace(String host, String secret, Map<String, String> params) 获取存储信息 -
stopMultiMp4Publish
public static ServerResponse<String> stopMultiMp4Publish(String host, String secret, Map<String, String> params) 关闭多文件推流 -
loadMP4File
public static ServerResponse<String> loadMP4File(String host, String secret, Map<String, String> params) 点播mp4文件 -
doApi
-
doApiImg
-