mqtt
This commit is contained in:
parent
912dd83005
commit
5dd7f5793e
|
@ -0,0 +1,13 @@
|
||||||
|
[program:record]
|
||||||
|
directory=/home/pi/lot_manager
|
||||||
|
command=/usr/bin/bash record.sh
|
||||||
|
user=pi
|
||||||
|
;是否随开机自启 或者reload自启动
|
||||||
|
autostart=true
|
||||||
|
;失败重启
|
||||||
|
autorestart=true
|
||||||
|
;重启次数
|
||||||
|
restart_times=3
|
||||||
|
redirect_stderr=true
|
||||||
|
stopsignal=TERM
|
||||||
|
stopasgroup=True
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
current_time=$(date +"%Y-%m-%d-%H-%M-%S")
|
||||||
|
ffmpeg -rtsp_transport tcp -i rtsp://admin:123456@192.168.0.123:554/mpeg4 -c:v libx265 -preset fast -crf 31 -c:a aac -vf scale=1920x1280:flags=lanczos -f mp4 segment -segment_time 900 file_$current_time.mp4
|
1
tool.py
1
tool.py
|
@ -12,6 +12,7 @@ def close_stream():
|
||||||
|
|
||||||
def exec_sh(msg):
|
def exec_sh(msg):
|
||||||
cmd = json.loads(msg.payload.decode('utf-8'))["data"]
|
cmd = json.loads(msg.payload.decode('utf-8'))["data"]
|
||||||
|
|
||||||
subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue