RuoYi整合ZLM4j+WVP
最近集成zlm由于是C开发,zlm4j是java版本,使用的若依框架。所以集成下,方便后续
1. 创建视频和wvp模块,附录zlm4j和wvp的pom.xml
zlm4j的pom.xml
文档(https://ux5phie02ut.feishu.cn/wiki/NA2ywJRY2ivALSkPfUycZFM4nUB)
Gitee https://gitee.com/aizuda/zlm4j
Github https://github.com/lidaofu-hub/j_zlm_sdk
<dependencies><dependency><groupId>com.hikvision.ga</groupId><artifactId>artemis-http-client</artifactId></dependency><dependency><groupId>cn.hutool</groupId><artifactId>hutool-all</artifactId><version>5.8.4</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.4.0</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-extension</artifactId><version>3.4.0</version></dependency><dependency><groupId>org.bytedeco</groupId><artifactId>javacv</artifactId><version>1.5.6</version></dependency><dependency><groupId>org.bytedeco</groupId><artifactId>ffmpeg</artifactId><version>4.4-1.5.6</version><classifier>windows-x86_64</classifier></dependency><dependency><groupId>org.bytedeco</groupId><artifactId>ffmpeg</artifactId><version>4.4-1.5.6</version><classifier>linux-x86_64</classifier></dependency><dependency><groupId>com.sun.jna.examples</groupId><artifactId>test</artifactId><version>1.0.0</version><scope>system</scope><systemPath>${project.basedir}/lib/test-1.0.0.jar</systemPath></dependency><dependency><groupId>net.java.dev.jna</groupId><artifactId>jna</artifactId><version>5.11.0</version></dependency><dependency><groupId>com.hikvision.ga</groupId><artifactId>artemis-http-client</artifactId><version>1.1.3</version></dependency><dependency><groupId>io.netty</groupId><artifactId>netty-all</artifactId><version>4.1.59.Final</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency></dependencies>
wvp的pom.xml (官网doc.wvp-pro.cn )
<dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-cache</artifactId></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.2.2</version></dependency><dependency><groupId>com.baomidou</groupId><artifactId>dynamic-datasource-spring-boot-starter</artifactId><version>3.6.1</version></dependency><!--参数校验 --><dependency><groupId>javax.validation</groupId><artifactId>validation-api</artifactId></dependency><!-- sip协议栈 --><dependency><groupId>javax.sip</groupId><artifactId>jain-sip-ri</artifactId><version>1.3.0-91</version></dependency><!-- 取代log4j --><dependency><groupId>org.slf4j</groupId><artifactId>log4j-over-slf4j</artifactId><version>1.7.36</version></dependency><!-- xml解析库 --><dependency><groupId>org.dom4j</groupId><artifactId>dom4j</artifactId><version>2.1.3</version></dependency><!-- json解析库fastjson2 --><dependency><groupId>com.alibaba.fastjson2</groupId><artifactId>fastjson2</artifactId><version>2.0.17</version></dependency><dependency><groupId>com.alibaba.fastjson2</groupId><artifactId>fastjson2-extension</artifactId><version>2.0.17</version></dependency><!-- okhttp --><dependency><groupId>com.squareup.okhttp3</groupId><artifactId>okhttp</artifactId><version>4.10.0</version></dependency><!-- okhttp 调试日志 --><dependency><groupId>com.squareup.okhttp3</groupId><artifactId>logging-interceptor</artifactId><version>4.10.0</version></dependency><!-- okhttp-digest --><dependency><groupId>io.github.rburgst</groupId><artifactId>okhttp-digest</artifactId><version>2.7</version></dependency><!--反向代理--><dependency><groupId>org.mitre.dsmiley.httpproxy</groupId><artifactId>smiley-http-proxy-servlet</artifactId><version>1.12.1</version></dependency><!--excel解析库--><dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>3.3.2</version><exclusions><exclusion><groupId>org.apache.commons</groupId><artifactId>commons-compress</artifactId></exclusion></exclusions></dependency><dependency><groupId>org.apache.commons</groupId><artifactId>commons-compress</artifactId><version>1.24.0</version></dependency><!-- 获取系统信息 --><dependency><groupId>com.github.oshi</groupId><artifactId>oshi-core</artifactId><version>6.2.2</version></dependency><!-- JNA 依赖通常由 oshi-core 引入,除非需要特定版本 --><dependency><groupId>net.java.dev.jna</groupId><artifactId>jna</artifactId><version>5.14.0</version></dependency><dependency><groupId>net.java.dev.jna</groupId><artifactId>jna-platform</artifactId><version>5.14.0</version></dependency><dependency><groupId>org.springframework.session</groupId><artifactId>spring-session-core</artifactId></dependency><dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>32.1.3-jre</version></dependency></dependencies>
2. 代码可详见gitee(https://gitee.com/wangwenfei/zlm4j_wvp.git)
3.配置摄像头(海康摄像头为例)
4.测试数据:
推流接口: /index/api/addStreamPusherProxy
{"app": "live","enableAudio": 0,"enableFmp4": 0,"enableHls": 0,"enableMp4": 0,"enableRtmp": 0,"enableRtsp": 1,"enableTs": 0,"mp4MaxSecond": 0,"retryCount": 0,"rtpType": 0,"rtspSpeed": 0,"stream": "test","timeoutSec": 1000,"url": "rtsp://admin:abc12345.@192.168.1.43:554/stream1"}
5.webrtc效果图(前端可以去web-pro官网下载)
6. 常见问题和注意点