Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
I
ils-common-video
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
提交
议题看板
打开侧边栏
OpsTeam
ils-common-video
Commits
18c3f6ed
提交
18c3f6ed
authored
5月 09, 2021
作者:
zw.wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 修复时区等问题,标记录制失败的视频
上级
45bb863b
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
12 行增加
和
4 行删除
+12
-4
mysql.py
isc_video_record/db/mysql.py
+1
-1
merger.py
isc_video_record/merger.py
+1
-1
recorder.py
isc_video_record/recorder.py
+9
-1
setup.py
setup.py
+1
-1
没有找到文件。
isc_video_record/db/mysql.py
浏览文件 @
18c3f6ed
...
...
@@ -89,7 +89,7 @@ def get_camera_info(cursor, conn):
from camera_info
join camera_ai_config cac
on camera_info.id = cac.camera_info_id
where biz_type is not null
where biz_type is not null
and is_valid = 1
order by create_time;
'''
cursor
.
execute
(
sql
)
...
...
isc_video_record/merger.py
浏览文件 @
18c3f6ed
...
...
@@ -105,7 +105,7 @@ class EventMergerJob:
'camera_code'
:
camera
[
'device_code'
],
'camera_index'
:
camera
[
'point_index_code'
],
'db_table'
:
camera
[
'db_table'
],
'e
vent_duration
'
:
event_duration
+
10
'e
x
'
:
event_duration
+
10
}
if
len
(
events
)
>
0
:
self
.
send_mq_message
(
body
)
...
...
isc_video_record/recorder.py
浏览文件 @
18c3f6ed
...
...
@@ -125,7 +125,12 @@ class StreamRecorder:
def
recording
(
self
,
thread_id
,
db_table
,
event
):
t1
=
time
.
time
()
record_result
=
self
.
recorder
(
event
[
'camera_code'
],
event
[
'start_time'
],
event
[
'end_time'
],
thread_id
)
record_result
=
self
.
recorder
(
event
[
'camera_code'
],
event
[
'start_time'
]
.
astimezone
(
tz
),
# 录制调用接口的过程中使用的是上海时区
event
[
'end_time'
]
.
astimezone
(
tz
),
thread_id
)
t2
=
time
.
time
()
video_info
,
error_log
=
get_video_duration
(
record_result
[
'file_name'
])
...
...
@@ -143,6 +148,9 @@ class StreamRecorder:
file_name
=
file_name
,
video_url
=
url
,
video_resolution
=
video_info
[
'resolution'
],
recovered_time
=
record_result
[
'recovered_time'
]
.
astimezone
(
pytz
.
utc
))
os
.
remove
(
record_result
[
'file_name'
])
else
:
# 无有效视频文件,标记事件状态 status = 2
mysql
.
update_video_info
(
db_table
,
event
[
'video_id'
],
2
)
log
.
info
(
'video_info:
%
s, url:
%
s, video_id:
%
s.
%
s, time:
%
s'
,
video_info
,
url
,
db_table
,
...
...
setup.py
浏览文件 @
18c3f6ed
...
...
@@ -21,7 +21,7 @@ requires = [
setuptools
.
setup
(
name
=
'isc-video-record'
,
version
=
'1.0.0a
2
'
,
version
=
'1.0.0a
5
'
,
description
=
'ISC motion detection playback video stream recording service.'
,
long_description
=
long_description
,
long_description_content_type
=
'text/markdown'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论