Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
37da4ffb
提交
37da4ffb
authored
10月 15, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revise getModulesOperFromConfDiff and related applications
上级
e5aa682e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
28 行增加
和
20 行删除
+28
-20
Makefile
opencv-motion-detect/Makefile
+3
-0
evslicer.cpp
opencv-motion-detect/evslicer.cpp
+25
-20
没有找到文件。
opencv-motion-detect/Makefile
浏览文件 @
37da4ffb
...
@@ -113,3 +113,6 @@ fmt:
...
@@ -113,3 +113,6 @@ fmt:
fswatch
:
fswatch
:
cd
vendor/fswatch
&&
./autogen.sh
&&
./configure
--prefix
=
$(CURDIR)
/vendor
&&
make
-j
&&
make
install
cd
vendor/fswatch
&&
./autogen.sh
&&
./configure
--prefix
=
$(CURDIR)
/vendor
&&
make
-j
&&
make
install
libcurl
:
cd
vendor/curl
&&
./buildconf
&&
./configure
--prefix
=
$(CURDIR)
/vendor
&&
make
-j
&&
make
install
opencv-motion-detect/evslicer.cpp
浏览文件 @
37da4ffb
...
@@ -798,7 +798,6 @@ protected:
...
@@ -798,7 +798,6 @@ protected:
}
}
if
(
self
->
bSegFull
)
{
if
(
self
->
bSegFull
)
{
// TODO: backup orignal self->vTsActive[self->segHead]
}
}
try
{
try
{
...
@@ -985,21 +984,17 @@ public:
...
@@ -985,21 +984,17 @@ public:
thCloudMsgHandler
.
detach
();
thCloudMsgHandler
.
detach
();
// TODO: bugfix
// // thread for slicer maintenace
// thSliceMgr = thread([this]() {
// // get old and active slices
// this->vTsActive = this->LoadVideoFiles(this->urlOut, this->hours, this->numSlices, this->vTsOld);
// spdlog::info("evslicer {} will store slice from index: {}", selfId, this->segHead);
// monitor * m = nullptr;
// thread for slicer maintenace
// CreateDirMon(&m, this->urlOut, ".mp4", vector<string>(), EvSlicer::fileMonHandler, (void *)this);
thSliceMgr
=
thread
([
this
]()
{
// });
// get old and active slices
// thSliceMgr.detach();
this
->
vTsActive
=
this
->
LoadVideoFiles
(
this
->
urlOut
,
this
->
hours
,
this
->
numSlices
,
this
->
vTsOld
);
spdlog
::
info
(
"evslicer {} will store slice from index: {}"
,
selfId
,
this
->
segHead
);
monitor
*
m
=
nullptr
;
CreateDirMon
(
&
m
,
this
->
urlOut
,
".mp4"
,
vector
<
string
>
(),
EvSlicer
::
fileMonHandler
,
(
void
*
)
this
);
});
thSliceMgr
.
detach
();
// thread for uploading slices
getInputFormat
();
setupStream
();
// event thread
// event thread
thEventHandler
=
thread
([
this
]
{
thEventHandler
=
thread
([
this
]
{
...
@@ -1027,6 +1022,14 @@ public:
...
@@ -1027,6 +1022,14 @@ public:
long
offsetE
=
0
;
long
offsetE
=
0
;
// TODO: async
// TODO: async
this
->
vTsActive
=
this
->
LoadVideoFiles
(
this
->
urlOut
,
this
->
hours
,
this
->
numSlices
,
this
->
vTsOld
);
if
(
this
->
segHead
==
-
1
)
{
spdlog
::
error
(
"evslicer {} no local video files"
);
continue
;
}
if
(
tss
<
this
->
bootTime
)
{
if
(
tss
<
this
->
bootTime
)
{
spdlog
::
warn
(
"evslicer {} should we discard old msg? {} < bootTime {}"
,
selfId
,
evt
,
this
->
bootTime
);
spdlog
::
warn
(
"evslicer {} should we discard old msg? {} < bootTime {}"
,
selfId
,
evt
,
this
->
bootTime
);
}
}
...
@@ -1038,13 +1041,12 @@ public:
...
@@ -1038,13 +1041,12 @@ public:
sIdx
=
this
->
incSegHead
(
this
->
segHead
);
sIdx
=
this
->
incSegHead
(
this
->
segHead
);
eIdx
=
this
->
decSegHead
(
this
->
segHead
);
eIdx
=
this
->
decSegHead
(
this
->
segHead
);
}
else
{
}
else
{
sIdx
=
1
;
sIdx
=
0
;
eIdx
=
this
->
decSegHead
(
this
->
segHead
);
eIdx
=
this
->
decSegHead
(
this
->
segHead
);
}
}
if
(
sIdx
>
eIdx
||
tss
>
this
->
vTsActive
[
eIdx
]
||
tse
<
this
->
vTsActive
[
sIdx
])
{
if
(
sIdx
>
eIdx
||
tss
>
this
->
vTsActive
[
eIdx
]
||
tse
<
this
->
vTsActive
[
sIdx
])
{
spdlog
::
error
(
"event range ({}, {}) not in local range ({}, {})."
,
tss
,
tse
,
this
->
vTsActive
[
sIdx
],
this
->
vTsActive
[
eIdx
]);
spdlog
::
error
(
"evslicer {} event range ({}, {}) not in local range ({}, {})."
,
selfId
,
tss
,
tse
,
this
->
vTsActive
[
sIdx
],
this
->
vTsActive
[
eIdx
]);
this
->
debugFilesRing
(
this
->
vTsActive
);
continue
;
continue
;
}
}
...
@@ -1053,7 +1055,7 @@ public:
...
@@ -1053,7 +1055,7 @@ public:
spdlog
::
info
(
"evslicer {} wait for {}s to matching event videos"
,
this
->
selfId
,
this
->
seconds
+
5
);
spdlog
::
info
(
"evslicer {} wait for {}s to matching event videos"
,
this
->
selfId
,
this
->
seconds
+
5
);
this_thread
::
sleep_for
(
chrono
::
seconds
(
this
->
seconds
+
5
));
this_thread
::
sleep_for
(
chrono
::
seconds
(
this
->
seconds
+
5
));
}
else
{
}
else
{
spdlog
::
info
(
"ev
ent range ({}, {}) is in local range ({}, {})."
,
tss
,
tse
,
this
->
vTsActive
[
sIdx
],
this
->
vTsActive
[
eIdx
]);
spdlog
::
info
(
"ev
slicer {} event range ({}, {}) is in local range ({}, {})."
,
selfId
,
tss
,
tse
,
this
->
vTsActive
[
sIdx
],
this
->
vTsActive
[
eIdx
]);
}
}
auto
v
=
findSlicesByRange
(
tss
,
tse
,
offsetS
,
offsetE
);
auto
v
=
findSlicesByRange
(
tss
,
tse
,
offsetS
,
offsetE
);
...
@@ -1061,7 +1063,6 @@ public:
...
@@ -1061,7 +1063,6 @@ public:
spdlog
::
error
(
"evslicer {} ignore upload videos in range ({}, {})"
,
this
->
selfId
,
this
->
videoFileTs2Name
(
tss
),
this
->
videoFileTs2Name
(
tse
));
spdlog
::
error
(
"evslicer {} ignore upload videos in range ({}, {})"
,
this
->
selfId
,
this
->
videoFileTs2Name
(
tss
),
this
->
videoFileTs2Name
(
tse
));
}
}
else
{
else
{
debugFilesRing
(
this
->
vTsActive
);
vector
<
tuple
<
string
,
string
>
>
params
=
{{
"startTime"
,
to_string
(
tss
)},{
"endTime"
,
to_string
(
tse
)},{
"cameraId"
,
ipcSn
},
{
"headOffset"
,
to_string
(
offsetS
)},{
"tailOffset"
,
to_string
(
offsetE
)}};
vector
<
tuple
<
string
,
string
>
>
params
=
{{
"startTime"
,
to_string
(
tss
)},{
"endTime"
,
to_string
(
tse
)},{
"cameraId"
,
ipcSn
},
{
"headOffset"
,
to_string
(
offsetS
)},{
"tailOffset"
,
to_string
(
offsetE
)}};
vector
<
string
>
fileNames
;
vector
<
string
>
fileNames
;
string
sf
;
string
sf
;
...
@@ -1086,6 +1087,10 @@ public:
...
@@ -1086,6 +1087,10 @@ public:
}
}
}
}
});
});
// thread for uploading slices
getInputFormat
();
setupStream
();
};
};
~
EvSlicer
()
~
EvSlicer
()
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论