Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
I
ils-common-video
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
提交
议题看板
打开侧边栏
OpsTeam
ils-common-video
Commits
b19c8288
提交
b19c8288
authored
5月 03, 2021
作者:
zw.wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: bug
上级
b17a8799
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
9 行增加
和
5 行删除
+9
-5
event_merger.py
hikvision_isc_client/event_merger.py
+2
-1
recorder.py
hikvision_isc_client/recorder.py
+6
-4
setup.py
setup.py
+1
-0
没有找到文件。
hikvision_isc_client/event_merger.py
浏览文件 @
b19c8288
...
@@ -63,7 +63,8 @@ class EventMergerJob:
...
@@ -63,7 +63,8 @@ class EventMergerJob:
if
now_std
-
last_check_time
>
timedelta
(
days
=
1
):
if
now_std
-
last_check_time
>
timedelta
(
days
=
1
):
last_check_time
=
now_std
-
timedelta
(
days
=
1
)
last_check_time
=
now_std
-
timedelta
(
days
=
1
)
res
=
pipe
.
set
(
last_check_time_key
,
now_std
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
res
=
pipe
.
set
(
last_check_time_key
,
now_std
.
astimezone
(
pytz
.
utc
)
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
if
not
res
:
if
not
res
:
continue
continue
...
...
hikvision_isc_client/recorder.py
浏览文件 @
b19c8288
...
@@ -27,7 +27,6 @@ client = HikVisionClient(config.get('KEY'), config.get('SECRET'),
...
@@ -27,7 +27,6 @@ client = HikVisionClient(config.get('KEY'), config.get('SECRET'),
class
StreamRecorder
:
class
StreamRecorder
:
def
__init__
(
self
):
def
__init__
(
self
):
log_init
(
__name__
,
False
,
'./log'
)
self
.
queue_name
=
'ISC_RECORD_JOB'
self
.
queue_name
=
'ISC_RECORD_JOB'
self
.
connection
=
rabbitmq_connect
()
self
.
connection
=
rabbitmq_connect
()
...
@@ -87,12 +86,14 @@ class StreamRecorder:
...
@@ -87,12 +86,14 @@ class StreamRecorder:
self
.
connection
.
close
()
self
.
connection
.
close
()
def
process_message
(
self
,
body
):
def
process_message
(
self
,
body
):
filename
=
self
.
recorder
(
file
_
name
=
self
.
recorder
(
body
[
'camera_index'
],
body
[
'camera_index'
],
datetime
.
strptime
(
body
[
'start_time'
],
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S'
),
datetime
.
strptime
(
body
[
'start_time'
],
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S'
),
datetime
.
strptime
(
body
[
'end_time'
],
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S'
))
datetime
.
strptime
(
body
[
'end_time'
],
'
%
Y-
%
m-
%
dT
%
H:
%
M:
%
S'
))
video_info
=
get_video_duration
(
filename
)
video_info
=
get_video_duration
(
file_name
)
url
=
aliyun_oss
.
oss_upload_file
(
'isc_record/'
+
filename
.
split
(
'/'
)[
-
1
],
filename
)
url
=
''
if
file_name
and
os
.
path
.
isfile
(
file_name
):
url
=
aliyun_oss
.
oss_upload_file
(
'isc_record/'
+
file_name
.
split
(
'/'
)[
-
1
],
file_name
)
log
.
info
(
'video_info:
%
s, url:
%
s'
,
video_info
,
url
)
log
.
info
(
'video_info:
%
s, url:
%
s'
,
video_info
,
url
)
return
True
return
True
...
@@ -166,5 +167,6 @@ class StreamRecorder:
...
@@ -166,5 +167,6 @@ class StreamRecorder:
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
log_init
(
__name__
,
False
,
'/var/log/event_rcv'
)
stream_recorder
=
StreamRecorder
()
stream_recorder
=
StreamRecorder
()
stream_recorder
.
start
()
stream_recorder
.
start
()
setup.py
浏览文件 @
b19c8288
...
@@ -31,6 +31,7 @@ setuptools.setup(
...
@@ -31,6 +31,7 @@ setuptools.setup(
'redis'
,
'redis'
,
'mysql-connector'
,
'mysql-connector'
,
'retrying'
,
'retrying'
,
'oss2'
],
],
python_requires
=
'>=3.6'
,
python_requires
=
'>=3.6'
,
)
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论