update
This commit is contained in:
parent
a90818cdb3
commit
3285b85af7
|
@ -8,5 +8,5 @@ CURRENT_TIME=$(date +"%Y-%m-%d_%H-%M-%S")
|
|||
# 构建录像文件名
|
||||
OUTPUT_FILE="${OUTPUT_DIR}/${CURRENT_TIME}.mp4"
|
||||
# 开始录制RTSP流
|
||||
/usr/bin/ffmpeg -rtsp_transport tcp -i "${RTSP_URL}" -c copy -c:a aac -s 1920x1080 -r 15 -crf 35 -b:v 1250k -t "${RECORD_DURATION}" -f mp4 "${OUTPUT_FILE}"
|
||||
/usr/bin/ffmpeg -rtsp_transport tcp -i "${RTSP_URL}" -c copy -c:a aac -s 1920x1080 -r 15 -crf 35 -t "${RECORD_DURATION}" -f mp4 "${OUTPUT_FILE}"
|
||||
|
||||
|
|
|
@ -27,4 +27,4 @@ try:
|
|||
add(t2)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
pass
|
||||
|
|
Binary file not shown.
|
@ -36,8 +36,8 @@ def get_kb_detail_by_time(session, start_time, end_time):
|
|||
|
||||
# 删除数据
|
||||
@with_session
|
||||
def delete_kb_detail_by_time(session, start_time, end_time):
|
||||
d = session.query(LOT_DATA_MODEL).filter(start_time <= LOT_DATA_MODEL.create_time, LOT_DATA_MODEL.create_time <= end_time).delete()
|
||||
def delete_kb_detail_by_time(session, end_time):
|
||||
d = session.query(LOT_DATA_MODEL).filter(LOT_DATA_MODEL.create_time <= end_time).delete()
|
||||
return d
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
# 删除lot_data.db 保留三天的数据
|
||||
import datetime
|
||||
|
||||
from db.repository import delete_kb_detail_by_time
|
||||
|
||||
|
||||
def delete_data_3_days_ago():
|
||||
try:
|
||||
# 计算3天前的日期并转化为数据库格式
|
||||
end_time = int((datetime.datetime.now() - datetime.timedelta(days=3)).timestamp())
|
||||
d = delete_kb_detail_by_time(end_time)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
delete_data_3_days_ago()
|
Loading…
Reference in New Issue