将录像存储路径迁移至wvp中配置,assist以有在需要视频合成的时候才会用
| | |
| | | update_time character varying(50), |
| | | hook_alive_interval integer, |
| | | record_path character varying(255), |
| | | record_date integer default 7, |
| | | record_day integer default 7, |
| | | constraint uk_media_server_unique_ip_http_port unique (ip, http_port) |
| | | ); |
| | | |
| | |
| | | update_time character varying(50), |
| | | hook_alive_interval integer, |
| | | record_path character varying(255), |
| | | record_date integer default 7, |
| | | record_day integer default 7, |
| | | constraint uk_media_server_unique_ip_http_port unique (ip, http_port) |
| | | ); |
| | | |
| | |
| | | add record_path character varying(255); |
| | | |
| | | alter table wvp_media_server |
| | | add record_date integer default 7; |
| | | add record_day integer default 7; |
| | | |
| | | |
| | |
| | | add record_path character varying(255); |
| | | |
| | | alter table wvp_media_server |
| | | add record_date integer default 7; |
| | | add record_day integer default 7; |
| | | |
| | | |
| | | |
| | |
| | | /** |
| | | * 宿¶æ¥è¯¢å¾
å é¤çå½åæä»¶ |
| | | */ |
| | | // @Scheduled(fixedRate = 5000) //æ¯äºç§æ§è¡ä¸æ¬¡ï¼æ¹ä¾¿æµè¯ |
| | | @Scheduled(cron = "0 0 0 * * ?") //æ¯å¤©ç0ç¹æ§è¡ |
| | | // @Scheduled(fixedRate = 5000) |
| | | public void execute(){ |
| | | logger.info("[å½åæä»¶å®æ¶æ¸
ç] å¼å§æ¸
çè¿æå½åæä»¶"); |
| | | // è·åé
ç½®äºassistçæµåªä½èç¹ |
| | |
| | | for (MediaServerItem mediaServerItem : mediaServerItemList) { |
| | | |
| | | Calendar lastCalendar = Calendar.getInstance(); |
| | | if (mediaServerItem.getRecordDate() > 0) { |
| | | if (mediaServerItem.getRecordDay() > 0) { |
| | | lastCalendar.setTime(new Date()); |
| | | // è·åä¿åçæåæªè³æ¥æï¼å 为æ¯ä¸ªèç¹é½æä¸ä¸ªæ¥æï¼ä¹å°±æ¯æ¯ææ¯ä¸ªèç¹è®¾ç½®ä¸åçä¿åæ¥æï¼ |
| | | lastCalendar.add(Calendar.DAY_OF_MONTH, -mediaServerItem.getRecordDate()); |
| | | lastCalendar.add(Calendar.DAY_OF_MONTH, -mediaServerItem.getRecordDay()); |
| | | Long lastDate = lastCalendar.getTimeInMillis(); |
| | | |
| | | // è·åå°æªè³æ¥æä¹åçå½åæä»¶åè¡¨ï¼æä»¶å表满足æªè¢«æ¶èåä¿æçãè¿ä¸¤ä¸ªå段ç®åå
±è½ä¸è´ï¼ |
| | |
| | | if (cloudRecordItemList.isEmpty()) { |
| | | continue; |
| | | } |
| | | List<Integer> cloudRecordItemIdList = new ArrayList<>(); |
| | | for (CloudRecordItem cloudRecordItem : cloudRecordItemList) { |
| | | String date = new File(cloudRecordItem.getFilePath()).getParentFile().getName(); |
| | | JSONObject jsonObject = zlmresTfulUtils.deleteRecordDirectory(mediaServerItem, cloudRecordItem.getApp(), |
| | | cloudRecordItem.getStream(), date, cloudRecordItem.getFileName()); |
| | | if (jsonObject.getInteger("code") == 0) { |
| | | cloudRecordItemIdList.add(cloudRecordItem.getId()); |
| | | }else { |
| | | logger.warn("[å½åæä»¶å®æ¶æ¸
ç] å é¤ç£çæä»¶éè¯¯ï¼ {}", jsonObject); |
| | | logger.warn("[å½åæä»¶å®æ¶æ¸
ç] å é¤ç£çæä»¶éè¯¯ï¼ {}:{}", cloudRecordItem.getFilePath(), jsonObject); |
| | | } |
| | | } |
| | | if (cloudRecordItemIdList.isEmpty()) { |
| | | continue; |
| | | } |
| | | cloudRecordServiceMapper.deleteList(cloudRecordItemIdList, mediaServerItem.getId()); |
| | | result += cloudRecordItemIdList.size(); |
| | | result += cloudRecordServiceMapper.deleteList(cloudRecordItemList); |
| | | } |
| | | } |
| | | logger.info("[å½åæä»¶å®æ¶æ¸
ç] å
±æ¸
ç{}ä¸ªè¿æå½åæä»¶", result); |
| | |
| | | @Value("${media.record-assist-port:0}") |
| | | private Integer recordAssistPort = 0; |
| | | |
| | | @Value("${media.record-date:7}") |
| | | private Integer recordDay = 7; |
| | | |
| | | @Value("${media.record-path}") |
| | | private String recordPath; |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | |
| | | mediaServerItem.setSendRtpPortRange(rtpSendPortRange); |
| | | mediaServerItem.setRecordAssistPort(recordAssistPort); |
| | | mediaServerItem.setHookAliveInterval(30.00f); |
| | | |
| | | mediaServerItem.setRecordDay(recordDay); |
| | | if (recordPath != null) { |
| | | mediaServerItem.setRecordPath(recordPath); |
| | | } |
| | | mediaServerItem.setCreateTime(DateUtil.getNow()); |
| | | mediaServerItem.setUpdateTime(DateUtil.getNow()); |
| | | |
| | | return mediaServerItem; |
| | | } |
| | | |
| | | public Integer getRecordDay() { |
| | | return recordDay; |
| | | } |
| | | |
| | | public void setRecordDay(Integer recordDay) { |
| | | this.recordDay = recordDay; |
| | | } |
| | | |
| | | public String getRecordPath() { |
| | | return recordPath; |
| | | } |
| | | |
| | | public void setRecordPath(String recordPath) { |
| | | this.recordPath = recordPath; |
| | | } |
| | | |
| | | public String getRtpSendPortRange() { |
| | | return rtpSendPortRange; |
| | | } |
| | |
| | | |
| | | private String serverId = "000000"; |
| | | |
| | | private String recordPath = null; |
| | | |
| | | private String thirdPartyGBIdReg = "[\\s\\S]*"; |
| | | |
| | | private String civilCodeFile = "classpath:civilCode.csv"; |
| | |
| | | |
| | | public void setRefuseChannelStatusChannelFormNotify(Boolean refuseChannelStatusChannelFormNotify) { |
| | | this.refuseChannelStatusChannelFormNotify = refuseChannelStatusChannelFormNotify; |
| | | } |
| | | |
| | | public String getRecordPath() { |
| | | return recordPath; |
| | | } |
| | | |
| | | public void setRecordPath(String recordPath) { |
| | | this.recordPath = recordPath; |
| | | } |
| | | |
| | | public int getMaxNotifyCountQueue() { |
| | |
| | | result.setEnable_mp4(true); |
| | | } |
| | | } |
| | | if (mediaInfo.getRecordAssistPort() > 0 && userSetting.getRecordPath() == null) { |
| | | logger.info("æ¨æµæ¶åç°å°æªè®¾ç½®å½åè·¯å¾ï¼ä»assistæå¡ä¸è¯»å"); |
| | | JSONObject info = assistRESTfulUtils.getInfo(mediaInfo, null); |
| | | if (info != null && info.getInteger("code") != null && info.getInteger("code") == 0 ) { |
| | | JSONObject dataJson = info.getJSONObject("data"); |
| | | if (dataJson != null) { |
| | | String recordPath = dataJson.getString("record"); |
| | | userSetting.setRecordPath(recordPath); |
| | | result.setMp4_save_path(recordPath); |
| | | // ä¿®æ¹zlmä¸çå½åè·¯å¾ |
| | | if (mediaInfo.isAutoConfig()) { |
| | | taskExecutor.execute(() -> { |
| | | mediaServerService.setZLMConfig(mediaInfo, false); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (param.getApp().equalsIgnoreCase("rtp")) { |
| | | String receiveKey = VideoManagerConstants.WVP_OTHER_RECEIVE_RTP_INFO + userSetting.getServerId() + "_" + param.getStream(); |
| | | OtherRtpSendInfo otherRtpSendInfo = (OtherRtpSendInfo)redisTemplate.opsForValue().get(receiveKey); |
| | |
| | | private boolean defaultServer; |
| | | |
| | | @Schema(description = "å½åå卿¶é¿") |
| | | private int recordDate; |
| | | private int recordDay; |
| | | |
| | | @Schema(description = "å½ååå¨è·¯å¾") |
| | | private String recordPath; |
| | | |
| | | public MediaServerItem() { |
| | | } |
| | |
| | | this.sendRtpPortRange = sendRtpPortRange; |
| | | } |
| | | |
| | | public int getRecordDate() { |
| | | return recordDate; |
| | | public int getRecordDay() { |
| | | return recordDay; |
| | | } |
| | | |
| | | public void setRecordDate(int recordDate) { |
| | | this.recordDate = recordDate; |
| | | public void setRecordDay(int recordDay) { |
| | | this.recordDay = recordDay; |
| | | } |
| | | |
| | | public String getRecordPath() { |
| | | return recordPath; |
| | | } |
| | | |
| | | public void setRecordPath(String recordPath) { |
| | | this.recordPath = recordPath; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | if (serverItem.isAutoConfig()) { |
| | | // æ¥çassistæå¡çå½åè·¯å¾é
ç½® |
| | | if (serverItem.getRecordAssistPort() > 0 && userSetting.getRecordPath() == null) { |
| | | JSONObject info = assistRESTfulUtils.getInfo(serverItem, null); |
| | | if (info != null && info.getInteger("code") != null && info.getInteger("code") == 0 ) { |
| | | JSONObject dataJson = info.getJSONObject("data"); |
| | | if (dataJson != null) { |
| | | String recordPath = dataJson.getString("record"); |
| | | userSetting.setRecordPath(recordPath); |
| | | } |
| | | } |
| | | } |
| | | setZLMConfig(serverItem, "0".equals(zlmServerConfig.getHookEnable())); |
| | | } |
| | | final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + serverItem.getId(); |
| | |
| | | param.put("rtp_proxy.port_range", mediaServerItem.getRtpPortRange().replace(",", "-")); |
| | | } |
| | | |
| | | if (userSetting.getRecordPath() != null) { |
| | | File recordPathFile = new File(userSetting.getRecordPath()); |
| | | File mp4SavePathFile = recordPathFile.getParentFile().getAbsoluteFile(); |
| | | param.put("protocol.mp4_save_path", mp4SavePathFile.getAbsoluteFile()); |
| | | if (mediaServerItem.getRecordPath() != null) { |
| | | File recordPathFile = new File(mediaServerItem.getRecordPath()); |
| | | param.put("protocol.mp4_save_path", recordPathFile.getParentFile().getPath()); |
| | | param.put("record.appName", recordPathFile.getName()); |
| | | } |
| | | |
| | |
| | | |
| | | @Delete(" <script>" + |
| | | "delete from wvp_cloud_record where media_server_id=#{mediaServerId} and id in " + |
| | | " <foreach collection='cloudRecordItemIdList' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + |
| | | " <foreach collection='cloudRecordItemIdList' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" + |
| | | " </script>") |
| | | int deleteList(List<Integer> cloudRecordItemIdList, @Param("mediaServerId") String mediaServerId); |
| | | int deleteList(List<CloudRecordItem> cloudRecordItemIdList); |
| | | |
| | | } |
| | |
| | | "rtp_port_range,"+ |
| | | "send_rtp_port_range,"+ |
| | | "record_assist_port,"+ |
| | | "record_day,"+ |
| | | "record_path,"+ |
| | | "default_server,"+ |
| | | "create_time,"+ |
| | | "update_time,"+ |
| | |
| | | "#{rtpPortRange}, " + |
| | | "#{sendRtpPortRange}, " + |
| | | "#{recordAssistPort}, " + |
| | | "#{recordDay}, " + |
| | | "#{recordPath}, " + |
| | | "#{defaultServer}, " + |
| | | "#{createTime}, " + |
| | | "#{updateTime}, " + |
| | |
| | | "<if test=\"secret != null\">, secret=#{secret}</if>" + |
| | | "<if test=\"recordAssistPort != null\">, record_assist_port=#{recordAssistPort}</if>" + |
| | | "<if test=\"hookAliveInterval != null\">, hook_alive_interval=#{hookAliveInterval}</if>" + |
| | | "<if test=\"recordDay != null\">, record_day=#{recordDay}</if>" + |
| | | "<if test=\"recordPath != null\">, record_path=#{recordPath}</if>" + |
| | | "WHERE id=#{id}"+ |
| | | " </script>"}) |
| | | int update(MediaServerItem mediaServerItem); |
| | |
| | | "<if test=\"sendRtpPortRange != null\">, send_rtp_port_range=#{sendRtpPortRange}</if>" + |
| | | "<if test=\"secret != null\">, secret=#{secret}</if>" + |
| | | "<if test=\"recordAssistPort != null\">, record_assist_port=#{recordAssistPort}</if>" + |
| | | "<if test=\"recordDay != null\">, record_day=#{recordDay}</if>" + |
| | | "<if test=\"recordPath != null\">, record_path=#{recordPath}</if>" + |
| | | "<if test=\"hookAliveInterval != null\">, hook_alive_interval=#{hookAliveInterval}</if>" + |
| | | "WHERE ip=#{ip} and http_port=#{httpPort}"+ |
| | | " </script>"}) |
| | |
| | | auto-config: true |
| | | # [å¯é] zlmæå¡å¨çhook.admin_params=secret |
| | | secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc |
| | | # å½åè·¯å¾ |
| | | record-path: ./www/record |
| | | # å½åä¿åæ¶é¿ |
| | | record-date: 7 |
| | | # å¯ç¨å¤ç«¯å£æ¨¡å¼, å¤ç«¯å£æ¨¡å¼ä½¿ç¨ç«¯å£åºåæ¯è·¯æµï¼å
¼å®¹æ§æ´å¥½ã å端å£ä½¿ç¨æµçssrcåºåï¼ ç¹æè¶
æ¶å»ºè®®ä½¿ç¨å¤ç«¯å£æµè¯ |
| | | rtp: |
| | | # [å¯é] æ¯å¦å¯ç¨å¤ç«¯å£æ¨¡å¼, å¼å¯åä¼å¨portRangeèå´å
éæ©ç«¯å£ç¨äºåªä½æµä¼ è¾ |