帮别人做彩票网站犯法嘛,教育网站模块建设,app界面设计模板素材免费,电商网站怎样优化最近项目中用到流媒体平台#xff0c;java平台负责信令部分#xff0c;c平台负责流媒体处理#xff0c;找了评分比较好的开源项目 https://gitee.com/pan648540858/wvp-GB28181-pro 流媒体服务基于 c写的 https://github.com/ZLMediaKit/ZLMediaKit 说明文档#xff1a;h…最近项目中用到流媒体平台java平台负责信令部分c平台负责流媒体处理找了评分比较好的开源项目 https://gitee.com/pan648540858/wvp-GB28181-pro 流媒体服务基于 c写的 https://github.com/ZLMediaKit/ZLMediaKit 说明文档https://github.com/ZLMediaKit/ZLMediaKit/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B 说明文档 https://doc.wvp-pro.cn/#/_content/introduction/compile
搭建过程稍微有点复杂记录分享一下
环境依赖及版本
jdk1.8 、 node14.21 、 mysql5.7 、 c11 、ffmpeg6.1 、visual stuido2022 、 cmake 用vs12里自带的、libsrtp-2.4.2 、vcpkggit最新版 、 openssl3.2.0
1、搭建编译c流媒体平台ZLMediaKit项目 生成cmake项目 双击运行生成的exe文件启动ZLM流媒体服务 2、启动java信令平台
注意配置文件config.ini的参数要与流媒体平台的config.ini对应一致 贴出关键配置文件application.yml
spring:# [可选]上传文件大小限制servlet:multipart:max-file-size: 10MBmax-request-size: 100MB# REDIS数据库配置redis:# [可选] 超时时间timeout: 10000# 以下为单机配置# [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1host: 127.0.0.1# # [必须修改] 端口号port: 6379# [可选] 数据库 DBdatabase: 1# [可选] 访问密码,若你的redis服务器没有设置密码就不需要用密码去连接password:# 以下为集群配置# cluster:# nodes: 192.168.1.66:9001,192.168.1.66:9002,192.168.1.66:9003,192.168.1.66:9004,192.168.1.66:9005,192.168.1.66:9006# password: adminadmin123.# [可选] jdbc数据库配置, 项目使用sqlite作为数据库一般不需要配置# mysql数据源datasource:# kingbase配置# type: com.zaxxer.hikari.HikariDataSource# driver-class-name: com.kingbase8.Driver# url: jdbc:kingbase8://192.168.1.55:54321/wvp?useUnicodetruecharacterEncodingutf8# username: system# password: system# postgresql配置# type: com.zaxxer.hikari.HikariDataSource# driver-class-name: org.postgresql.Driver# url: jdbc:postgresql://192.168.1.242:3306/242wvp# username: root# password: SYceshizu1234# mysql配置type: com.zaxxer.hikari.HikariDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/242wvp?useUnicodetruecharacterEncodingUTF8rewriteBatchedStatementstrueserverTimezonePRCuseSSLfalseallowMultiQueriestrueallowPublicKeyRetrievaltrueusername: rootpassword: root# kingbase 和 postgresql需要开启这个配置
#pagehelper:
# helper-dialect: postgresql#[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口
server:port: 18080# 作为28181服务器的配置
sip:# [必须修改] 本机的IPip: 192.168.1.111# [可选] 28181服务监听的端口port: 15060# 根据国标6.1.2中规定domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码由省级、市级、区级、基层编号组成参照GB/T 2260-2007# 后两位为行业编码定义参照附录D.3# 3701020049标识山东济南历下区 信息行业接入# [可选]domain: 3402000001# [可选]id: 34020000013000000001# [可选] 默认设备认证密码后续扩展使用设备单独密码, 移除密码将不进行校验password: 12345678#zlm 默认服务器配置
media:# [必须修改] zlm服务器唯一id用于触发hook时区别是哪台服务器,general.mediaServerIdid: GQ3TF8yT83wh5Wvz# [必须修改] zlm服务器的内网IPip: 192.168.1.111# [必须修改] zlm服务器的http.porthttp-port: 6080# [可选] zlm服务器的hook.admin_paramssecretsecret: 034523TF8yT83wh5Wvz73f7# 启用多端口模式, 多端口模式使用端口区分每路流兼容性更好。 单端口使用流的ssrc区分 点播超时建议使用多端口测试rtp:# [可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输enable: true# [可选] 在此范围内选择端口用于媒体流传输,port-range: 30000,30500 # 端口范围# [可选] 国标级联在此范围内选择端口发送媒体流请不要与收流端口范围重合send-port-range: 50502,50506 # 端口范围# 录像辅助服务 部署此服务可以实现zlm录像的管理与下载 0 表示不使用record-assist-port: 18089# 录像路径record-path: ./www/record# 录像保存时长record-day: 7
# [可选] 日志配置, 一般不需要改
logging:config: classpath:logback-spring.xml# [根据业务需求配置]
user-settings:server-id: 741266auto-apply-play: trueinterface-authentication: trueinterface-authentication-excludes:- /api/v1/**- /api/media/stream_info_by_app_and_stream- /api/v1/control/ptz- /api/cloud/record/*/**# 推流直播是否录制record-push-live: true# 国标是否录制record-sip: false# 使用推流状态作为推流通道状态use-pushing-as-status: false# 设备上线时是否自动同步通道sync-channel-on-device-online: false# 消息通道功能-缺少国标ID是否给所有上级发送消息send-to-platforms-when-id-lost: false
config.ini配置文件
; auto-generated by mINI class {[api]
apiDebug1
defaultSnap./www/logo.png
secret034523TF8yT83wh5Wvz73f7
snapRoot./www/snap/[cluster]
origin_url
retry_count3
timeout_sec15[ffmpeg]
bin/usr/bin/ffmpeg
cmd%s -re -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %s
log./ffmpeg/ffmpeg.log
restart_sec0
snap%s -i %s -y -f mjpeg -t 0.001 %s[general]
check_nvidia_dev1
enableVhost0
enable_ffmpeg_log0
flowThreshold1024
maxStreamWaitMS15000
mediaServerIdGQ3TF8yT83wh5Wvz
mergeWriteMS0
resetWhenRePlay1
streamNoneReaderDelayMS15000
unready_frame_cache100
wait_add_track_ms3000
wait_track_ready_ms10000[hls]
broadcastRecordTs0
deleteDelaySec10
fileBufSize65536
segDur2
segKeep0
segNum3
segRetain5[hook]
admin_paramssecret034523TF8yT83wh5Wvz73f7
alive_interval30.000000
enable1
on_flow_report
on_http_access
on_playhttp://192.168.1.111:18082/index/hook/on_play
on_publishhttp://192.168.1.111:18082/index/hook/on_publish
on_record_mp4
on_record_ts
on_rtp_server_timeouthttp://192.168.1.111:18082/index/hook/on_rtp_server_timeout
on_rtsp_auth
on_rtsp_realm
on_send_rtp_stoppedhttp://192.168.1.111:18082/index/hook/on_send_rtp_stopped
on_server_keepalivehttp://192.168.1.111:18082/index/hook/on_server_keepalive
on_server_startedhttp://192.168.1.111:18082/index/hook/on_server_started
on_shell_login
on_stream_changedhttp://192.168.1.111:18082/index/hook/on_stream_changed
on_stream_none_readerhttp://192.168.1.111:18082/index/hook/on_stream_none_reader
on_stream_not_foundhttp://192.168.1.111:18082/index/hook/on_stream_not_found
retry1
retry_delay3.000000
timeoutSec20[http]
charSetutf-8
dirMenu1
forbidCacheSuffix
forwarded_ip_header
keepAliveSecond15
maxReqSize40960
notFoundhtmlheadtitle404 Not Found/title/headbody bgcolorwhitecenterh1您访问的资源不存在/h1/centerhrcenterZLMediaKit(git hash:f6cba98/2023-02-06T14:18:2108:00,branch:master,build time:2023-02-07T10:51:47)/center/body/html
port6080
rootPath./www
sendBufSize65536
sslport16080
virtualPath[multicast]
addrMax239.255.255.255
addrMin239.0.0.0
udpTTL64[protocol]
add_mute_audio1
continue_push_ms3000
enable_audio1
enable_fmp41
enable_hls1
enable_mp40
enable_rtmp1
enable_rtsp1
enable_ts1
fmp4_demand0
hls_demand0
hls_save_path./www
modify_stamp0
mp4_as_player0
mp4_max_second3600
mp4_save_path./www
rtmp_demand0
rtsp_demand0
ts_demand0[record]
appNamerecord
fastStart0
fileBufSize65536
fileRepeat0
sampleMS500[rtc]
externIP192.168.1.111
port8000
preferredCodecAPCMA,PCMU,opus,mpeg4-generic
preferredCodecVH264,H265,AV1,VP9,VP8
rembBitRate0
tcpPort8000
timeoutSec15[rtmp]
handshakeSecond15
keepAliveSecond15
modifyStamp0
port1935
sslport19350[rtp]
audioMtuSize600
lowLatency0
rtpMaxSize10
videoMtuSize1400[rtp_proxy]
dumpDir
h264_pt98
h265_pt99
opus_pt100
port10000
port_range40000-40500
ps_pt96
timeoutSec15[rtsp]
authBasic0
directProxy1
handshakeSecond15
keepAliveSecond15
lowLatency0
port10554
sslport[shell]
maxReqSize1024
port9000[srt]
latencyMul4
pktBufSize8192
port9000
timeoutSec5; } ---3、启动前端工程
注意修改本机ip 启动起来后长这个样子由于还没测试推流所以看不到视频 至此环境搭建起来了推流测试文档地址 https://github.com/ZLMediaKit/ZLMediaKit/wiki/ZLMediaKit%E6%8E%A8%E6%B5%81%E6%B5%8B%E8%AF%95