Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RuoYi-Vue-master
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算法平台
RuoYi-Vue-master
Commits
9042b8c6
Commit
9042b8c6
authored
Sep 01, 2023
by
周昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、icc环境测试
parent
089f05e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
4 deletions
+113
-4
ruoyi-admin/src/main/java/com/ruoyi/icc/RtspToMP4.java
ruoyi-admin/src/main/java/com/ruoyi/icc/RtspToMP4.java
+93
-0
ruoyi-admin/src/main/resources/application-druid.yml
ruoyi-admin/src/main/resources/application-druid.yml
+2
-2
ruoyi-admin/src/main/resources/application.yml
ruoyi-admin/src/main/resources/application.yml
+18
-2
No files found.
ruoyi-admin/src/main/java/com/ruoyi/icc/RtspToMP4.java
0 → 100644
View file @
9042b8c6
package
com
.
ruoyi
.
icc
;
import
org.springframework.stereotype.Component
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
/**
* TODO:
*
* @Author: ZHANG
* @create: 2021/8/27 16:11
*/
@Component
public
class
RtspToMP4
{
public
class
In
implements
Runnable
{
private
InputStream
inputStream
;
public
In
(
InputStream
inputStream
)
{
this
.
inputStream
=
inputStream
;
}
@Override
public
void
run
()
{
try
{
//转成字符输入流
InputStreamReader
inputStreamReader
=
new
InputStreamReader
(
inputStream
,
"gbk"
);
int
len
=
-
1
;
char
[]
c
=
new
char
[
1024
];
//读取进程输入流中的内容
while
((
len
=
inputStreamReader
.
read
(
c
))
!=
-
1
)
{
String
s
=
new
String
(
c
,
0
,
len
);
System
.
out
.
print
(
s
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
public
Process
StartRecord
(
String
ffmpegPath
,
String
streamUrl
,
String
FilePath
){
ProcessBuilder
processBuilder
=
new
ProcessBuilder
();
//定义命令内容
List
<
String
>
command
=
new
ArrayList
<>();
command
.
add
(
ffmpegPath
);
command
.
add
(
"-rtsp_transport"
);
command
.
add
(
"tcp"
);
command
.
add
(
"-y"
);
command
.
add
(
"-i"
);
command
.
add
(
streamUrl
);
command
.
add
(
"-c"
);
command
.
add
(
"copy"
);
command
.
add
(
"-f"
);
command
.
add
(
"mp4"
);
command
.
add
(
FilePath
);
processBuilder
.
command
(
command
);
System
.
out
.
println
(
"脚本:"
+
command
.
toString
());
//将标准输入流和错误输入流合并,通过标准输入流读取信息
processBuilder
.
redirectErrorStream
(
true
);
try
{
//启动进程
Process
process
=
processBuilder
.
start
();
System
.
out
.
println
(
"开始时间:"
+
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
new
Date
(
System
.
currentTimeMillis
())));
//获取输入流
InputStream
inputStream
=
process
.
getInputStream
();
Thread
inThread
=
new
Thread
(
new
In
(
inputStream
));
inThread
.
start
();
return
process
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
boolean
stopRecord
(
Process
process
)
{
try
{
OutputStream
os
=
process
.
getOutputStream
();
os
.
write
(
"q"
.
getBytes
());
// 一定要刷新
os
.
flush
();
os
.
close
();
}
catch
(
Exception
err
)
{
err
.
printStackTrace
();
return
false
;
}
return
true
;
}
}
ruoyi-admin/src/main/resources/application-druid.yml
View file @
9042b8c6
...
...
@@ -6,9 +6,9 @@ spring:
druid
:
# 主库数据源
master
:
url
:
jdbc:mysql://
192.168.4.221:3307
/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://
localhost:3306
/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
password
:
mysql
password
:
root
# 从库数据源
slave
:
# 从数据源开关/默认关闭
...
...
ruoyi-admin/src/main/resources/application.yml
View file @
9042b8c6
...
...
@@ -70,7 +70,7 @@ spring:
# redis 配置
redis
:
# 地址
host
:
192.168.4.221
host
:
localhost
# 端口,默认为6379
port
:
6379
# 数据库索引
...
...
@@ -137,7 +137,7 @@ flink:
# 端口,默认为8081
port
:
8081
# jarId
jarId
:
0b
26a8a0-a2cc-43ff-b809-1d5ed0551804
_my-flink-project-0.1.jar
jarId
:
0b
1a0852-931e-4933-b1f6-6b7d9c4f7f1b
_my-flink-project-0.1.jar
# flink启动类
entryClass
:
com.censoft.flink.StreamingJob
# 启动参数
...
...
@@ -150,3 +150,19 @@ airestapi:
# 端口,默认为8081
port
:
8081
#大华ICC视频配置
icc
:
sdk
:
# host
host
:
124.160.33.135:4077
# 客户端模式
clientId
:
CompanyName
clientSecret
:
42bec152-8f04-476a-9aec-e7d616ff3cb3
# 密码校验模式
pwdClientId
:
CompanyName
pwdClientSecret
:
42bec152-8f04-476a-9aec-e7d616ff3cb3
username
:
TEST
password
:
Admin123
# 使用授权类型password
grantType
:
password
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