Giter Site home page Giter Site logo

zlmediakit.dotnetcore.sdk's Introduction

ZLMediaKit.DotNetCore.Sdk

一个基于ZLMediaKit的.NetCoreSDK

STRealVideo.Control 控制台项目(主要用于测试)

参考代码文件Program.cs

STRealVideo.Lib 核心SDK类库(用于实际开发对接)

\Common 文件夹存放工具类

\Models 文件夹存放实体类

ZLClient.cs 基于ZLMediaServer实现的API客户端(所有业务操作都使用它来完成)

ZLClient 构造方法中传入api地址(如果api服务器运行在本机,则第二个参数secret可以不传)

调用方法参考

        ZLClient client = new ZLClient("http://127.0.0.1/", "035c73f7-bb6b-4889-a715-d9eb2d1925cc");
        var snapImageResponse = client.getSnap("rtmp://1.1.1.1/live/cctv", 10, 0); //捕捉截图
        var resThreadsLoad = client.getThreadsLoad();//获取各epoll(或select)线程负载以及延时
        var resWorkThreadsLoad = client.getWorkThreadsLoad();//获取各后台epoll(或select)线程负载以及延时
        var resServerConfigs = client.getServerConfig();//获取服务器配置
        var resSetConfig = client.setServerConfig("api.apiDebug", "1");//将服务器参数api.apiDebug设置为0
        var resRestartServer = client.restartServer();//重启服务器,只有Daemon方式才能重启,否则是直接关闭!
        var resMediaList = client.getMediaList();//获取流列表,可选筛选参数
        var resCloseStream = client.closeStream("rtsp", "127.0.0.1", "live", "test");//关闭流(目前所有类型的流都支持关闭)
        var resCloseStreams = client.closeStreams("rtsp", "127.0.0.1");//关闭流(目前所有类型的流都支持关闭)
        var resSessions = client.getAllSession();//获取所有TcpSession列表(获取所有tcp客户端相关信息)
        var resKillSession = client.kickSession(resSessions.data[0].id);//断开tcp连接,比如说可以断开rtsp、rtmp播放器等
        var resKillSessions = client.kickSessions(null, "127.0.0.1");//断开tcp连接,比如说可以断开rtsp、rtmp播放器等
        var resAddStream = client.addStreamProxy("__defaultVhost__", "live", "0", "rtsp://admin:[email protected]:554/h264/ch1/main/av_stream", true, true, RTPPullType.TCP);//动态添加rtsp/rtmp拉流代理(只支持H264/H265/aac负载)
        var resDelStream = client.delStreamProxy("xxxxxxxxx");//关闭拉流代理
        var resAddFFmpegSource = client.addFFmpegSource("http://127.0.0.1/live/0/hls.m3u8", "rtmp://127.0.0.1/live/2", 10000);//通过fork FFmpeg进程的方式拉流代理,支持任意协议
        var resDelFFmpegSource = client.delFFmpegSource("xxxxxxxxx");//关闭ffmpeg拉流代理
        var resMediaOnline = client.isMediaOnline("rtsp", "__defaultVhost__", "live", "0");//判断直播流是否在线
        var resMediaInfo = client.getMediaInfo("rtsp", "__defaultVhost__", "live", "0");//获取流相关信息
        var resSsrcInfo = client.getSsrcInfo("XXXXXXX");//获取rtp代理时的某路ssrc rtp信息
        var resMp4RecordFile = client.getMp4RecordFile("__defaultVhost__", "live", "0", "2020-04-08");//搜索文件系统,获取流对应的录像文件列表或日期文件夹列表
        var resStartRecord = client.startRecord(0, "__defaultVhost__", "live", "0");//开始录制hls或MP4
        var resStopRecord = client.stopRecord(0, "__defaultVhost__", "live", "0");//停止录制流
        var resRecording = client.isRecording(0, "__defaultVhost__", "live", "0");//停止录制流

致谢

感谢作者夏楚开源提供这么棒的流媒体服务框架

zlmediakit.dotnetcore.sdk's People

Contributors

mingzhuliu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.