Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
my-flink-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AI算法平台
my-flink-project
Commits
0d40ecc9
Commit
0d40ecc9
authored
Nov 02, 2023
by
周昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、修改正式环境数据库配置
parent
a7baada6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
43 deletions
+1
-43
src/main/java/com/censoft/flink/StreamingJob.java
src/main/java/com/censoft/flink/StreamingJob.java
+1
-43
No files found.
src/main/java/com/censoft/flink/StreamingJob.java
View file @
0d40ecc9
...
...
@@ -99,7 +99,7 @@ public class StreamingJob {
});
//3、5 输出kafka
outputStreamOperator
.
addSink
(
new
FlinkKafkaProducer
(
"1
72.16.33.152
:9092"
,
"test-topic"
,
new
SimpleStringSchema
()));
outputStreamOperator
.
addSink
(
new
FlinkKafkaProducer
(
"1
27.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"
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment