最近想把大华的监控通过广域网进行传输,找了部分开源软件进行测试:
选型:WVP-GB28181+ZLMediakitSourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
1:WVP-GB28181配置
SourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 $ ip a1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope hostvalid_lft forever preferred_lft forever2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 00:16:3e:0b:5b:76 brd ff:ff:ff:ff:ff:ffinet 172.31.0.1/24 brd 172.31.0.255 scope global dynamic noprefixroute eth0valid_lft 313865895sec preferred_lft 313865895secinet6 fe80::216:3eff:fe0b:5b76/64 scope linkvalid_lft forever preferred_lft forever$ cat application.ymlspring:# 设置接口超时时间mvc:async:request-timeout: 20000thymeleaf:cache: false# [可选]上传文件大小限制servlet:multipart:max-file-size: 10MBmax-request-size: 100MB# REDIS数据库配置redis:# [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1host: 127.0.0.1# [必须修改] 端口号port: 6379# [可选] 数据库 DBdatabase: 7# [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接password: redis密码# [可选] 超时时间timeout: 10000# mysql数据源datasource:type: com.zaxxer.hikari.HikariDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=trueusername: wvppassword: wvp密码hikari:connection-timeout: 20000 # 是客户端等待连接池连接的最大毫秒数initialSize: 10 # 连接池初始化连接数maximum-pool-size: 200 # 连接池最大连接数minimum-idle: 5 # 连接池最小空闲连接数idle-timeout: 300000 # 允许连接在连接池中空闲的最长时间(以毫秒为单位)max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位)#[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口server:port: 8080# [可选] HTTPS配置, 默认不开启ssl:# [可选] 是否开启HTTPS访问enabled: false# [可选] 证书文件路径,放置在resource/目录下即可,修改xxx为文件名key-store: classpath:test.monitor.89iot.cn.jks# [可选] 证书密码key-store-password: gpf64qmw# [可选] 证书类型, 默认为jks,根据实际修改key-store-type: JKS# 作为28181服务器的配置sip:# [必须修改] 本机的IP,对应你的网卡,监听什么ip就是使用什么网卡,# 如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4# 如果不明白,就使用0.0.0.0,大部分情况都是可以的# 请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。ip: 0.0.0.0show-ip: 服务器公网IP# [可选] 28181服务监听的端口port: 8116# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)# 后两位为行业编码,定义参照附录D.3# 3701020049标识山东济南历下区 信息行业接入# [可选]domain: 1300000000# [可选]id: 13000000002000000001# [可选] 默认设备认证密码,后续扩展使用设备单独密码, 移除密码将不进行校验password: 密码# 是否存储alarm信息alarm: true#zlm 默认服务器配置media:id: zlmediakit-local1# [必须修改] zlm服务器的内网IPip: 172.31.0.1# [必须修改] zlm服务器的http.porthttp-port: 19092# [可选] 返回流地址时的ip,置空使用 media.ipstream-ip: 公网IP# [可选] wvp在国标信令中使用的ip,此ip为摄像机可以访问到的ip, 置空使用 media.ip#rtmp-port: 1935#rtsp-port: 5545sdp-ip: 公网IP# [可选] zlm服务器的hook所使用的IP, 默认使用sip.iphook-ip: 172.31.0.1# [可选] zlm服务器的http.sslport, 置空使用zlm配置文件配置http-ssl-port: 1443# [可选] zlm服务器的hook.admin_params=secretsecret: 025c73f7-b36b-4889-a715-d9eb2d1925c4#secret: 10000# 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试rtp:# [可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输enable: true# [可选] 在此范围内选择端口用于媒体流传输, 必须提前在zlm上配置该属性,不然自动配置此属性可能不成功port-range: 40000,60300 # 端口范围# [可选] 国标级联在此范围内选择端口发送媒体流,send-port-range: 40000,60300 # 端口范围# 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载, 0 表示不使用record-assist-port: 0#record-assist-port: 18081# [根据业务需求配置]user-settings:# 点播/录像回放 等待超时时间,单位:毫秒play-timeout: 180000# [可选] 自动点播, 使用固定流地址进行播放时,如果未点播则自动进行点播, 需要rtp.enable=trueauto-apply-play: true# 设备/通道状态变化时发送消息device-status-notify: true# 跨域配置,配置你访问前端页面的地址即可, 可以配置多个allowed-origins:- http://localhost:8080- http://127.0.0.1:8080- http://公网ip:8080# [可选] 日志配置, 一般不需要改logging:config: classpath:logback-spring-local.xml2:ZLMediakitSourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
SourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 $ cat config.ini; auto-generated by mINI class {[api]apiDebug=1defaultSnap=./www/logo.pngsecret=025c73f7-b36b-4889-a715-d9eb2d1925c4snapRoot=./www/snap/[cluster]origin_url=retry_count=3timeout_sec=15[ffmpeg]bin=/opt/ffmpeg-4.4.4/bin/ffmpegcmd=%s -re -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %slog=./ffmpeg/ffmpeg.logrestart_sec=0snap=%s -rtsp_transport tcp -i %s -y -f mjpeg -t 0.001 %s[general]check_nvidia_dev=1enableVhost=0enable_ffmpeg_log=0flowThreshold=1024maxStreamWaitMS=15000mediaServerId=zlmediakit-local1mergeWriteMS=0resetWhenRePlay=1streamNoneReaderDelayMS=20000unready_frame_cache=100wait_add_track_ms=3000wait_track_ready_ms=10000[hls]broadcastRecordTs=0deleteDelaySec=10fileBufSize=65536segDur=2segKeep=0segNum=3segRetain=5[hook]alive_interval=10.0enable=1on_flow_report=on_http_access=on_play=http://172.31.0.1:8080/index/hook/on_playon_publish=http://172.31.0.1:8080/index/hook/on_publishon_record_mp4=on_record_ts=on_rtp_server_timeout=http://172.31.0.1:8080/index/hook/on_rtp_server_timeouton_rtsp_auth=on_rtsp_realm=on_send_rtp_stopped=http://172.31.0.1:8080/index/hook/on_send_rtp_stoppedon_server_exited=https://172.31.0.1:8080/index/hook/on_server_exitedon_server_keepalive=http://172.31.0.1:8080/index/hook/on_server_keepaliveon_server_started=http://172.31.0.1:8080/index/hook/on_server_startedon_shell_login=on_stream_changed=http://172.31.0.1:8080/index/hook/on_stream_changedon_stream_none_reader=http://172.31.0.1:8080/index/hook/on_stream_none_readeron_stream_not_found=http://172.31.0.1:8080/index/hook/on_stream_not_foundretry=1retry_delay=3.0stream_changed_schemas=rtsp/rtmp/fmp4/ts/hls/hls.fmp4timeoutSec=20[http]allow_cross_domains=1allow_ip_range=公网IP,127.0.0.1,172.16.0.0-172.31.255.255,192.168.0.0-192.168.255.255,10.0.0.0-10.255.255.255charSet=utf-8dirMenu=1forbidCacheSuffix=forwarded_ip_header=keepAliveSecond=30maxReqSize=40960notFound=<html><head><title>404 Not Found</title></head><body bgcolor="white"><center><h1>您访问的资源不存在!</h1></center><hr><center>ZLMediaKit(git hash:f69f3b3/2023-09-09T10:59:27+08:00,branch:master,build time:2023-09-11T23:43:40)</center></body></html>port=19092rootPath=./wwwsendBufSize=65536sslport=1443virtualPath=[multicast]addrMax=239.255.255.255addrMin=239.0.0.0udpTTL=64[protocol]add_mute_audio=1auto_close=0continue_push_ms=3000enable_audio=1enable_fmp4=1enable_hls=1enable_hls_fmp4=0enable_mp4=0enable_rtmp=1enable_rtsp=1enable_ts=1fmp4_demand=0hls_demand=0hls_save_path=./wwwmodify_stamp=2mp4_as_player=0mp4_max_second=3600mp4_save_path=./wwwrtmp_demand=0rtsp_demand=0ts_demand=0[record]appName=recordfastStart=0fileBufSize=65536fileRepeat=0sampleMS=500[rtc]externIP=port=18000preferredCodecA=PCMU,PCMA,opus,mpeg4-genericpreferredCodecV=H264,H265,AV1,VP9,VP8rembBitRate=0tcpPort=18000timeoutSec=15[rtmp]handshakeSecond=15keepAliveSecond=15port=1935sslport=0[rtp]audioMtuSize=600h264_stap_a=1lowLatency=0rtpMaxSize=10videoMtuSize=1400[rtp_proxy]dumpDir=gop_cache=1h264_pt=98h265_pt=99opus_pt=100port=110000port_range=40000-60300ps_pt=96timeoutSec=15[rtsp]authBasic=0directProxy=1handshakeSecond=15keepAliveSecond=15lowLatency=0port=5545rtpTransportType=-1sslport=0[shell]maxReqSize=1024port=0[srt]latencyMul=4pktBufSize=8192port=19000timeoutSec=5; } ---
防火墙、安全组配置:SourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
防火墙:
01234567891011121314 $ firewall-cmd --zone=public --list-allpublic (active)target: defaulticmp-block-inversion: nointerfaces: eth0 eth1sources:services:ports: 19092/tcp 1-65535/udp 5545/tcpprotocols:masquerade: noforward-ports:source-ports:icmp-blocks:rich rules:rule family="ipv4" source address="172.31.0.1/32" port port="8080" protocol="tcp" accept
安全组:
开放TCP:19092、5545 以及UDP:1-65535 SourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
其他平台:http://www.ntvgbs.com/?note.t4x.orgSourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
参考文档:
1:https://doc.wvp-pro.cn/#/_content/introduction/compile
2:https://gitee.com/xia-chu/ZLMediaKitSourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/
SourceByrd's Weblog-https://note.t4x.org/service/wvp-gb28181-zlmediakit-config/