提交 b677ec31 authored 作者: blu's avatar blu

video detect: time and path

上级 b5ccb4b2
......@@ -148,6 +148,7 @@ def video_analysis(data):
ret = {'code': 0, 'msg': 'ok'}
ret['target'] = data
print(json.dumps(data))
imageName = None
try:
if 'cameraId' in data: # azure storage
# get azure storage video
......@@ -177,6 +178,7 @@ def video_analysis(data):
if m:
ret['data']['humanDetect']['found'] = 1
ret['data']['humanDetect']['level'] = m.group(2)
imageName = m.group(3)
ret['data']['humanDetect']['image'] = ipcSN + '/' + dirName + '/' + m.group(3)
ret['data']['humanDetect']['time'] = int(m.group(4))
print('found {}: {}, img: {}, elapse: {}'.format(m.group(1), m.group(2), m.group(3), m.group(4)))
......@@ -202,7 +204,7 @@ def video_analysis(data):
# upload
uploadFile(ipcSN, dirName, 'result.json', downloadDir)
if ret['data']['humanDetect']['found'] != 0:
uploadFile(ipcSN, dirName, ret['data']['humanDetect']['image'], downloadDir)
uploadFile(ipcSN, dirName, imageName, downloadDir)
# pub msg
mc = mqtt.Client("vamqtt-pub")
mc.connect(MQTT_HOST, MQTT_PORT)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论