add compress log msg

This commit is contained in:
13339479676 2022-01-25 21:02:30 +08:00
parent d4d52ee906
commit fb0285a5de
2 changed files with 7 additions and 2 deletions

View File

@ -198,8 +198,10 @@ def webcam_opencv(device_index="0",
# ------------------压缩文件------------------
if (is_compress and (is_autoSaveFrame or is_handSaveFrame)):
webcam_compress(compressStyle, is_autoCompressName,
compress_msg = webcam_compress(compressStyle, is_autoCompressName,
compressName, frame_savePath, compressMode)
log_management(f'{compress_msg}\n', logName, logMode) # 记录用时
def main(args):

View File

@ -12,6 +12,7 @@ from pathlib import Path
from utils.time_format import time_format
from utils.ows_path import increment_path
ROOT_PATH = sys.path[0] # 项目根目录
COMPRESS_SUFFIX = ['zip', 'tar'] # 压缩文件格式
# 帧保存路径管理
@ -61,4 +62,6 @@ def webcam_compress(compressStyle, is_autoCompressName, compressName, preCompres
compress_file.close()
compress_endTime = time.time() # 压缩结束时间
compress_totalTime = compress_endTime - compress_startTime
print(f'文件压缩成功!用时:{time_format(compress_totalTime)},已保存在:{compressName}')
compress_msg = f'文件压缩成功!用时:{time_format(compress_totalTime)},已保存在:{compressName}'
print(compress_msg)
return compress_msg