|
|
|
|
@ -71,7 +71,12 @@ public class CameraService {
|
|
|
|
|
camera.setPassword(configProperties.getCameraConfig().getCameraPassword());
|
|
|
|
|
camera.setPort(configProperties.getCameraConfig().getCameraPort());
|
|
|
|
|
camera.setUpdateTime(LocalDateTime.now());
|
|
|
|
|
camera.setRtsp("rtsp://"+configProperties.getCameraConfig().getCameraUser()+":"+configProperties.getCameraConfig().getCameraPassword()+"@"+camera.getIp()+":554/h264/ch1/sub/av_stream");
|
|
|
|
|
//老URL,小于64路的NVR或混合录像机的IP通道从33开始;大于等于64路的NVR的IP通道从1开始
|
|
|
|
|
int channel =1;
|
|
|
|
|
if(camera.getRecorderIp() !=null) {
|
|
|
|
|
channel = Integer.parseInt(camera.getChannel().substring(1)) + 32;
|
|
|
|
|
}
|
|
|
|
|
camera.setRtsp("rtsp://"+configProperties.getCameraConfig().getCameraUser()+":"+configProperties.getCameraConfig().getCameraPassword()+"@"+camera.getRecorderIp()+":554/h264/ch"+channel+"/sub/av_stream");
|
|
|
|
|
if(StringUtils.isEmpty(camera.getRtcServer())){
|
|
|
|
|
camera.setRtcServer("127.0.0.1");
|
|
|
|
|
}
|
|
|
|
|
@ -85,6 +90,11 @@ public class CameraService {
|
|
|
|
|
return camera.getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
int channel = Integer.parseInt("D22".substring(1)) +32;
|
|
|
|
|
System.out.println(channel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void edit(Camera camera) {
|
|
|
|
|
camera.setUpdateTime(LocalDateTime.now());
|
|
|
|
|
camera.setPtzId(null);
|
|
|
|
|
@ -269,7 +279,7 @@ public class CameraService {
|
|
|
|
|
int ptzId = 0;
|
|
|
|
|
if (IOId == null || IOId == 0) {
|
|
|
|
|
|
|
|
|
|
ptzId = camera.getPtzId() == null ? 1 : camera.getPtzId();
|
|
|
|
|
ptzId = camera.getPtzId() == null ? 108 : camera.getPtzId();
|
|
|
|
|
ptzId = ptzId + 1;
|
|
|
|
|
//新增
|
|
|
|
|
cameraIO = new CameraIO();
|
|
|
|
|
|