Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
2a5b75c2
提交
2a5b75c2
authored
10月 17, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
files ring
上级
11357bbb
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
15 行删除
+23
-15
evslicer.cpp
opencv-motion-detect/evslicer.cpp
+23
-15
没有找到文件。
opencv-motion-detect/evslicer.cpp
浏览文件 @
2a5b75c2
...
@@ -778,7 +778,8 @@ protected:
...
@@ -778,7 +778,8 @@ protected:
}
}
long
first
=
*
(
this
->
sTsList
.
begin
());
long
first
=
*
(
this
->
sTsList
.
begin
());
long
end
=
*
(
--
(
this
->
sTsList
.
end
()));
auto
_it
=
this
->
sTsList
.
end
();
long
end
=
*
(
--
_it
);
if
(
tse
<
first
||
tss
>
end
)
{
if
(
tse
<
first
||
tss
>
end
)
{
spdlog
::
info
(
"evslicer {} event range ({}, {}) is in local range ({}, {})."
,
selfId
,
tss
,
tse
,
first
,
end
);
spdlog
::
info
(
"evslicer {} event range ({}, {}) is in local range ({}, {})."
,
selfId
,
tss
,
tse
,
first
,
end
);
...
@@ -786,30 +787,36 @@ protected:
...
@@ -786,30 +787,36 @@ protected:
}
}
first
=
end
=
0
;
first
=
end
=
0
;
vector
<
long
>
tmp
;
set
<
long
>
tmp
;
int
found
=
0
;
int
found
=
0
;
auto
itr
=
this
->
sTsList
.
rbegin
();
auto
itr
=
this
->
sTsList
.
rbegin
();
for
(;
itr
!=
this
->
sTsList
.
rend
();
itr
++
)
{
for
(;
itr
!=
this
->
sTsList
.
rend
();
itr
++
)
{
// state machine
if
(
found
==
3
)
{
if
(
found
==
3
)
{
break
;
break
;
}
}
if
(
*
itr
>
tse
)
{
continue
;
}
if
(
found
&
1
)
{
if
(
found
&
1
)
{
tmp
.
push_back
(
*
itr
);
tmp
.
insert
(
*
itr
);
spdlog
::
info
(
"
\t
matched file: {}, s:{}, e:{}"
,
*
itr
,
ts
e
,
tss
);
spdlog
::
info
(
"
\t
matched file: {}, s:{}, e:{}"
,
*
itr
,
ts
s
,
tse
);
}
}
if
(
tse
>
=
*
itr
)
{
if
(
tse
<
=
*
itr
)
{
if
((
found
&
1
)
!=
1
)
{
if
((
found
&
1
)
!=
1
)
{
tmp
.
push_back
(
*
itr
);
tmp
.
insert
(
*
itr
);
spdlog
::
info
(
"
\t
matched file: {}, s:{}, e:{}"
,
*
itr
,
ts
e
,
tss
);
spdlog
::
info
(
"
\t
matched file: {}, s:{}, e:{}"
,
*
itr
,
ts
s
,
tse
);
found
|=
1
;
found
|=
1
;
}
}
}
}
if
(
tss
>=
*
itr
)
{
if
(
tss
>=
*
itr
&&
(
found
&
1
)
)
{
if
((
found
&
2
)
!=
2
)
{
if
((
found
&
2
)
!=
2
)
{
tmp
.
push_back
(
*
itr
);
tmp
.
insert
(
*
itr
);
spdlog
::
info
(
"
\t
matched file: {}, s:{}, e:{}"
,
*
itr
,
ts
e
,
tss
);
spdlog
::
info
(
"
\t
matched file: {}, s:{}, e:{}"
,
*
itr
,
ts
s
,
tse
);
found
|=
2
;
found
|=
2
;
}
}
}
}
...
@@ -817,8 +824,8 @@ protected:
...
@@ -817,8 +824,8 @@ protected:
if
(
found
==
3
)
{
if
(
found
==
3
)
{
string
sf
;
string
sf
;
auto
itr
=
tmp
.
r
begin
();
auto
itr
=
tmp
.
begin
();
for
(;
itr
!=
tmp
.
r
end
();
itr
++
)
{
for
(;
itr
!=
tmp
.
end
();
itr
++
)
{
string
fname
=
videoFileTs2Name
(
*
itr
,
true
);
string
fname
=
videoFileTs2Name
(
*
itr
,
true
);
sf
+=
"
\n\t
"
+
this
->
urlOut
+
"/"
+
fname
+
".mp4, "
+
to_string
(
*
itr
);
sf
+=
"
\n\t
"
+
this
->
urlOut
+
"/"
+
fname
+
".mp4, "
+
to_string
(
*
itr
);
ret
.
push_back
(
fname
);
ret
.
push_back
(
fname
);
...
@@ -941,19 +948,20 @@ public:
...
@@ -941,19 +948,20 @@ public:
}
}
long
first
=
0
,
end
=
0
;
long
first
=
0
,
end
=
0
;
auto
itr
=
this
->
sTsList
.
end
();
if
(
this
->
sTsList
.
size
()
!=
0
)
{
if
(
this
->
sTsList
.
size
()
!=
0
)
{
first
=
*
(
this
->
sTsList
.
begin
());
first
=
*
(
this
->
sTsList
.
begin
());
end
=
*
(
--
(
this
->
sTsList
.
end
())
);
end
=
*
(
--
itr
);
}
}
if
(
first
==
0
||
tse
<
first
||
tss
>
end
)
{
if
(
first
==
0
||
tse
<
first
||
tss
>
end
)
{
spdlog
::
error
(
"evslicer {} event range ({}, {}) is in local range ({}, {})."
,
selfId
,
tss
,
tse
,
first
,
end
);
spdlog
::
error
(
"evslicer {} event range ({}, {}) is in local range ({}, {})."
,
selfId
,
tss
,
tse
,
first
,
end
);
continue
;
continue
;
}
}
auto
v
=
findSlicesByRange
(
tss
,
tse
,
offsetS
,
offsetE
);
auto
v
=
findSlicesByRange
(
tss
,
tse
,
offsetS
,
offsetE
);
if
(
v
.
size
()
==
0
)
{
if
(
v
.
size
()
==
0
)
{
spdlog
::
error
(
"evslicer {}
ignore upload videos in range ({}, {}): not found"
,
this
->
selfId
,
this
->
videoFileTs2Name
(
tss
),
this
->
videoFileTs2Name
(
tse
));
spdlog
::
error
(
"evslicer {}
event ({}, {}) = ({}, {}) not in range: ({}, {}), ({}, {})"
,
this
->
selfId
,
tss
,
tse
,
this
->
videoFileTs2Name
(
tss
),
this
->
videoFileTs2Name
(
tse
),
first
,
end
,
this
->
videoFileTs2Name
(
first
),
this
->
videoFileTs2Name
(
end
));
}
}
else
{
else
{
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
)}};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论