This commit is contained in:
xyj 2023-12-11 18:06:07 +08:00
parent a91b8e72ff
commit 889ef3fb69
6 changed files with 14 additions and 12 deletions

View File

@ -8,5 +8,4 @@ CURRENT_TIME=$(date +"%Y-%m-%d_%H-%M-%S")
# 构建录像文件名 # 构建录像文件名
OUTPUT_FILE="${OUTPUT_DIR}/${CURRENT_TIME}.mp4" OUTPUT_FILE="${OUTPUT_DIR}/${CURRENT_TIME}.mp4"
# 开始录制RTSP流 # 开始录制RTSP流
/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}" /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}"

View File

@ -1,4 +1,2 @@
#!/bin/bash #!/bin/bash
set -e
supervisorctl start push_stream supervisorctl start push_stream

View File

@ -1,4 +1,2 @@
#!/bin/bash #!/bin/bash
set -e
supervisorctl stop push_stream supervisorctl stop push_stream

View File

@ -1,4 +1,10 @@
# 定时任务 # 公共定时任务
*/15 * * * * /usr/bin/python /home/pi/lot_manager/delete_than20G.sh # 每小时0分执行
# 针对32G内存卡的定时 0 * * * * /usr/bin/bash /home/pi/lot_manager/bash/cron_delete_mp4.sh
*/15 * * * * /usr/bin/bash /home/pi/lot_manager/bash/cron_delete_mp4.sh # 每天00分执行
0 0 * * * /usr/bin/python /home/pi/lot_manager/delete_lot_data_3_days.py
# 针对32G内存卡的定时额外加这个
# 每隔15分钟进行
*/15 * * * * /usr/bin/python /home/pi/lot_manager/delete_than20G.py

View File

@ -5,6 +5,6 @@ port=1883
[record] [record]
post_record_list_url=https://shop.lihaink.cn/api/index/file_list post_record_list_url=https://shop.lihaink.cn/api/index/file_list
post_record_url=https://shop.lihaink.cn/api/index/upload post_record_url=https://shop.lihaink.cn/api/index/upload
[message_type] #[message_type]

View File

@ -17,8 +17,9 @@ while True:
oldest_file = min(files_info, key=lambda x: x[0])[1] oldest_file = min(files_info, key=lambda x: x[0])[1]
# 删除最旧的文件 # 删除最旧的文件
os.remove(os.path.join(folder_path, oldest_file)) os.remove(os.path.join(folder_path, oldest_file))
print("删除" + oldest_file)
else: else:
# print("文件夹小于20G") # print("文件夹小于20G")
break break
# 等待5秒钟 # 等待5秒钟
time.sleep(5) time.sleep(1)