Commit 0d40ecc9 authored by 周昊's avatar 周昊

1、修改正式环境数据库配置

parent a7baada6
......@@ -99,7 +99,7 @@ public class StreamingJob {
});
//3、5 输出kafka
outputStreamOperator.addSink(new FlinkKafkaProducer("172.16.33.152:9092", "test-topic", new SimpleStringSchema()));
outputStreamOperator.addSink(new FlinkKafkaProducer("127.0.0.1:9092", "test-topic", new SimpleStringSchema()));
//3、6 打印输出
outputStreamOperator.print();
......@@ -121,46 +121,4 @@ public class StreamingJob {
.stream()
.filter(algorithmPo -> id.equals(algorithmPo.getId())).findFirst().get();
}
private static String getVideo(String channelId, Long startTime, Long endTime) {
try {
//获取录像视频流
String rtsp = rtsp(channelId, startTime, endTime);
//视频流转mp4
String filePath = "F:\\data\\MP4\\1.mp4";
RtspToMP4.StartRecord("F:\\ffmpeg\\ffmpeg-2023-10-29-git-2532e832d2-full_build\\bin\\ffmpeg.exe",rtsp,filePath);
return filePath;
} catch (ClientException e) {
e.printStackTrace();
}
return "";
}
private static String rtsp(String channelId, Long startTime, Long endTime) throws ClientException {
IClient iClient = new DefaultClient();
GeneralRequest generalRequest =
new GeneralRequest("/evo-apigw/admin/API/SS/Playback/StartPlaybackByFile", com.dahuatech.hutool.http.Method.POST);
String body =
"{\n" +
" \"data\": {\n" +
" \"channelId\": \"" + channelId + "\",\n" +
" \"recordSource\": \"3\",\n" +
" \"startTime\": \"" + startTime + "\",\n" +
" \"endTime\": \"" + endTime + "\",\n" +
" \"streamType\": \"1\",\n" +
" \"recordType\": \"1\"\n" +
" }\n" +
"}";
generalRequest.body(body);
GeneralResponse response = iClient.doAction(generalRequest, generalRequest.getResponseClass());
String result = response.getResult();
JSONObject obj = JSONUtil.parseObj(response.getResult());
String url = obj.getJSONObject("data").getStr("url");
String token = obj.getJSONObject("data").getStr("token");
String[] parts = url.split("\\|");
return parts[0] + "?token=" + token+"&trackID=0";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment