edgeUpdate

This commit is contained in:
2022-12-14 15:17:35 +08:00
parent 0f3433ece9
commit 965097b20b
2 changed files with 10 additions and 6 deletions

View File

@ -53,7 +53,9 @@ _C.URL = 'https://api.ieemoo.com/emoo-api/intelligence' #online
_C.VreTest = 'http://api.test.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
_C.VreTest2 = 'http://api.test2.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
#_C.Vre = 'https://api.ieemoo.com/emoo-api/intelligence/queryVideoCompareResult.do' #online
_C.Vre = 'https://api.ieemoo.com/emoo-api/intelligence/queryVideoCompareResult.do' #online
_C.backups = '../module/output/videos'
_C.Ocrimg = '../module/ieemoo-ai-assist/imgs'#post ocr img
_C.Ocrtxt = '../module/ieemoo-ai-assist/document'#post ocr txts

View File

@ -17,6 +17,7 @@ def AddObs(file_path, status):
with lock:
if not cfg.flag:
addobs(file_path, status)
os.remove(file_path)
else:
if status == '02':
addobs(file_path, status)
@ -26,14 +27,14 @@ def AddObs(file_path, status):
shutil.move(file_path, f_dst)
def addobs(file_path, status): #save videos
ti.sleep(3)
ti.sleep(5)
videoUuid = os.path.basename(file_path).split('_')[1]
json_data = {'videoUuid': videoUuid}
for vre in [cfg.VreTest, cfg.VreTest2]:
for vre in [cfg.Vre]:#[cfg.VreTest, cfg.VreTest2, cfg.Vre]:
resp = requests.post(url=vre, data=json_data)
status = resp.json()
if not 'data' in status:#延迟设置
ti.sleep(5)
ti.sleep(15)
resp = requests.post(url=cfg.Vre, data=json_data)
status = resp.json()
if 'data' in status:
@ -41,13 +42,14 @@ def addobs(file_path, status): #save videos
else:
break
status = status['data']
objectkey = os.path.basename(file_path)
backups_path = os.sep.join([cfg.backups, status+'_'+objectkey])
time = os.path.basename(file_path).split('-')[0]
if objectkey.split('.')[-1] in ['avi','mp4']:
objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey
resp = obsClient.putFile(bucketName, objectkey, file_path)
os.remove(file_path)
shutil.move(file_path, backups_path)
#os.remove(file_path)
def Addimg(uuid_barcode):
time = uuid_barcode.split('-')[0].split('_')[-1]