类 ZlmMediaService

java.lang.Object
cn.skcks.docking.gb28181.media.proxy.ZlmMediaService

public class ZlmMediaService extends Object
  • 构造器详细资料

    • ZlmMediaService

      public ZlmMediaService()
  • 方法详细资料

    • getApiList

      public ZlmResponse<List<String>> getApiList()
      功能:获取API列表
    • getServerConfig

      public ZlmResponse<List<ServerConfig>> getServerConfig()
      功能:获取服务器配置
    • getServerConfigResponseEntity

      public org.springframework.http.ResponseEntity<String> getServerConfigResponseEntity()
    • setServerConfig

      public String setServerConfig(ServerConfig config)
      功能:设置服务器配置
    • openRtpServer

      public OpenRtpServerResp openRtpServer(OpenRtpServer params)
      功能:创建GB28181 RTP接收端口,如果该端口接收数据超时,则会自动被回收(不用调用closeRtpServer接口)
    • closeRtpServer

      public CloseRtpServerResp closeRtpServer(CloseRtpServer params)
      关闭GB28181 RTP接收端口
    • listRtpServer

      public ZlmResponse<List<RtpServer>> listRtpServer()
      获取openRtpServer接口创建的所有RTP服务器
    • version

      public ZlmResponse<VersionResp> version()
      功能:获取版本信息,如分支,commit id, 编译时间
    • addStreamPusherProxy

      public ZlmResponse<AddStreamPusherProxyResp> addStreamPusherProxy(AddStreamPusherProxy params)
      添加rtsp/rtmp主动推流(把本服务器的直播流推送到其他服务器去)
    • delStreamPusherProxy

      public ZlmResponse<DelStreamPusherProxyResp> delStreamPusherProxy(String key)
      功能:关闭推流

      (可以使用close_streams接口关闭源直播流也可以停止推流)

      参数:
      key - addStreamPusherProxy 接口返回的key
    • startSendRtp

      public StartSendRtpResp startSendRtp(StartSendRtp params)

      功能:作为GB28181客户端,启动ps-rtp推流,支持rtp/udp方式;该接口支持rtsp/rtmp等协议转ps-rtp推流。

      第一次推流失败会直接返回错误,成功一次后,后续失败也将无限重试。
    • startSendRtpPassive

      public StartSendRtpResp startSendRtpPassive(StartSendRtpPassive params)

      功能:作为GB28181 Passive TCP服务器;该接口支持rtsp/rtmp等协议转ps-rtp被动推流。

      调用该接口,zlm会启动tcp服务器等待连接请求,连接建立后,zlm会关闭tcp服务器,然后源源不断的往客户端推流。

      第一次推流失败会直接返回错误,成功一次后,后续失败也将无限重试(不停地建立tcp监听,超时后再关闭)。

    • stopSendRtp

      public ZlmResponse<Void> stopSendRtp(StopSendRtp params)
      功能:停止GB28181 ps-rtp推流
    • getSnap

      public org.springframework.http.ResponseEntity<byte[]> getSnap(Snap params)
      功能:获取截图或生成实时截图并返回
    • restartServer

      public ZlmResponse<Void> restartServer()
      功能:重启服务器,只有Daemon方式才能重启,否则是直接关闭!
    • addStreamProxy

      public ZlmResponse<AddStreamProxyResp> addStreamProxy(AddStreamProxy params)
      功能:动态添加rtsp/rtmp/hls/http-ts/http-flv拉流代理(只支持H264/H265/aac/G711/opus负载)
    • delStreamProxy

      public ZlmResponse<DelStreamProxyResp> delStreamProxy(String key)
      功能:关闭拉流代理
    • getMediaList

      public ZlmResponse<List<MediaResp>> getMediaList(GetMediaList params)
      功能:获取流列表,可选筛选参数
    • getRtpInfo

      public GetRtpInfoResp getRtpInfo(String streamId)
      功能:获取rtp代理时的某路ssrc rtp信息
      参数:
      streamId - RTP的ssrc,16进制字符串或者是流的id(openRtpServer接口指定)
    • addFfmpegSource

      public ZlmResponse<AddFFmpegSourceResp> addFfmpegSource(AddFFmpegSource params)
      功能:通过 fork FFmpeg 进程的方式拉流代理,支持任意协议
    • delFfmpegSource

      public ZlmResponse<DelFFmpegSourceResp> delFfmpegSource(String key)
      功能:关闭 ffmpeg 拉流代理
    • startRecord

      public StartRecordResp startRecord(@RequestBody StartRecord params)
      开始录制 hls 或 MP4
    • stopRecord

      public StopRecordResp stopRecord(@RequestBody StopRecord params)
      停止录制流
    • isRecording

      public IsRecordingResp isRecording(@RequestBody IsRecording params)
      获取流录制状态
    • getMp4RecordFile

      public GetMp4RecordFileResp getMp4RecordFile(@RequestBody GetMp4RecordFile params)
      搜索文件系统,获取流对应的录像文件列表或日期文件夹列表
    • deleteRecordDirectory

      public DeleteRecordDirectoryResp deleteRecordDirectory(@RequestBody DeleteRecordDirectory params)