修复录像路径设置错误

pull/1217/head
chenghong 2023-12-19 10:09:21 +08:00
parent 964d55431f
commit 8965f95365
1 changed files with 69 additions and 61 deletions

View File

@ -116,7 +116,6 @@ public class MediaServerServiceImpl implements IMediaServerService {
private ThreadPoolTaskExecutor taskExecutor; private ThreadPoolTaskExecutor taskExecutor;
/** /**
* *
*/ */
@ -292,6 +291,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
/** /**
* zlm * zlm
*
* @param mediaServerId id * @param mediaServerId id
* @return MediaServerItem * @return MediaServerItem
*/ */
@ -369,6 +369,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
/** /**
* zlm线 * zlm线
*
* @param zlmServerConfig zlm线 * @param zlmServerConfig zlm线
*/ */
@Override @Override
@ -515,6 +516,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
/** /**
* *
*
* @return MediaServerItem * @return MediaServerItem
*/ */
@Override @Override
@ -558,6 +560,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
/** /**
* zlm * zlm
*
* @param mediaServerItem ID * @param mediaServerItem ID
* @param restart zlm * @param restart zlm
*/ */
@ -609,8 +612,11 @@ public class MediaServerServiceImpl implements IMediaServerService {
if (userSetting.getRecordPath() != null) { if (userSetting.getRecordPath() != null) {
File recordPathFile = new File(userSetting.getRecordPath()); File recordPathFile = new File(userSetting.getRecordPath());
File mp4SavePathFile = recordPathFile.getParentFile().getAbsoluteFile(); // File mp4SavePathFile = recordPathFile.getParentFile().getAbsoluteFile();
param.put("protocol.mp4_save_path", mp4SavePathFile.getAbsoluteFile()); // param.put("protocol.mp4_save_path", mp4SavePathFile.getAbsoluteFile());
// 如果使用mp4SavePathFile.getAbsoluteFile() 当wvp部署在windows服务器时会添加盘符
// 导致ZLM设置mp4_save_path路径时出错
param.put("protocol.mp4_save_path", userSetting.getRecordPath());
param.put("record.appName", recordPathFile.getName()); param.put("record.appName", recordPathFile.getName());
} }
@ -683,7 +689,8 @@ public class MediaServerServiceImpl implements IMediaServerService {
if (response != null) { if (response != null) {
result = true; result = true;
} }
} catch (Exception e) {} } catch (Exception e) {
}
return result; return result;
} }
@ -694,6 +701,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + id; String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + id;
redisTemplate.delete(key); redisTemplate.delete(key);
} }
@Override @Override
public void deleteDb(String id) { public void deleteDb(String id) {
//同步删除数据库中的数据 //同步删除数据库中的数据