Authored by mali

视频录制修改

@@ -86,15 +86,18 @@ public class UfoLiveService { @@ -86,15 +86,18 @@ public class UfoLiveService {
86 86
87 String persistId; 87 String persistId;
88 String filePath; 88 String filePath;
89 - if (configReader.getBoolean("appress.video.back.enable", false)) { //启用备份视频流 89 +
  90 + Integer cameraCode = queryInitCameraCode(req);
  91 +
  92 + if (configReader.getBoolean("appress.video.back.enable" + cameraCode, false)) { //启用备份视频流
90 LOGGER.info("begin back video stream"); 93 LOGGER.info("begin back video stream");
91 - String save = qNLiveUtilBackService.fetch(queryM3u8Url(queryInitCameraCode(req), 1), req.getStartTime().longValue(), req.getEndTime().longValue()); 94 + String save = qNLiveUtilBackService.fetch(queryM3u8Url(cameraCode, 1), req.getStartTime().longValue(), req.getEndTime().longValue());
92 persistId = qNLiveUtilBackService.transfer(save, fileName); 95 persistId = qNLiveUtilBackService.transfer(save, fileName);
93 96
94 filePath = QNliveConstants.LIVE_VIDEO_BACK_DOMAIN + QNliveConstants.MP4_FILEKEY_PRE + fileName + ".mp4"; 97 filePath = QNliveConstants.LIVE_VIDEO_BACK_DOMAIN + QNliveConstants.MP4_FILEKEY_PRE + fileName + ".mp4";
95 } else { 98 } else {
96 LOGGER.info("begin init video stream"); 99 LOGGER.info("begin init video stream");
97 - String m3u8Url = queryM3u8Url(queryInitCameraCode(req), 0); 100 + String m3u8Url = queryM3u8Url(cameraCode, 0);
98 101
99 qNliveUtilService.fetch(fileName, m3u8Url, String.valueOf(req.getStartTime()), String.valueOf(req.getEndTime())); 102 qNliveUtilService.fetch(fileName, m3u8Url, String.valueOf(req.getStartTime()), String.valueOf(req.getEndTime()));
100 103