From 8b4235b9fd57fd720893811fad144bbbf72b21b8 Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Mon, 4 Dec 2023 10:05:04 +0800 Subject: [PATCH] test --- record.sh | 2 +- tool.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/record.sh b/record.sh index 70d6e60..ebb4d9f 100755 --- a/record.sh +++ b/record.sh @@ -11,7 +11,7 @@ while true; do # 构建录像文件名 OUTPUT_FILE="${OUTPUT_DIR}/${CURRENT_TIME}.mp4" # 开始录制RTSP流 - ffmpeg -rtsp_transport tcp -i "${RTSP_URL}" -c copy -c:a aac -s 1920x1080 -r 19 -crf 33 -t "${RECORD_DURATION}" -f mp4 "${OUTPUT_FILE}" + ffmpeg -rtsp_transport tcp -i "${RTSP_URL}" -c copy -c:a aac -s 1920x1080 -r 18 -crf 33 -t "${RECORD_DURATION}" -f mp4 "${OUTPUT_FILE}" # 等待1秒钟再开始录制 sleep ${INTERNAL} diff --git a/tool.py b/tool.py index c3fa6d0..a99be28 100644 --- a/tool.py +++ b/tool.py @@ -15,6 +15,8 @@ def close_stream(): def exec_sh(msg): cmd = json.loads(msg.payload.decode('utf-8'))["data"] + if cmd == "supervisorctl stop __mqtt__": + return subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)