This commit is contained in:
Patrice 2019-06-27 21:01:30 +02:00
parent 62cce5d678
commit c5fc04dcd9
3 changed files with 17 additions and 16 deletions

View File

@ -87,12 +87,13 @@ def main():
if detected: if detected:
cam["status"] = True cam["status"] = True
cam["last_detection"] = time.time()
if not clientStatus: if not clientStatus:
try: try:
r = requests.get(clientIp + "/play") r = requests.get(clientIp + "/play")
if r.status_code == 200: if r.status_code == 200:
clients[cam["client_id"]]["status"] = True clients[cam["client_id"]]["status"] = True
cam["last_detection"] = time.time()
except: except:
print("request error") print("request error")
else: else:

View File

@ -16,27 +16,27 @@
"client_id": 2, "client_id": 2,
"status": false, "status": false,
"x":0.4, "x":0.4,
"y":0.2, "y":0.7,
"angle": 190 "angle": 190
}, },
{ {
"id": 3, "id": 2,
"label": "cam4", "label": "cam4",
"ip": "http://82.150.206.177/cgi-bin/faststream.jpg?stream=half&fps=15&rand=COUNTER", "ip": "http://82.150.206.177/cgi-bin/faststream.jpg?stream=half&fps=15&rand=COUNTER",
"client_id": 1, "client_id": 1,
"status": false, "status": false,
"x":0.75, "x":0.7,
"y":0.4, "y":0.2,
"angle": 100 "angle": 210
}, },
{ {
"id": 4, "id": 3,
"label": "cam5", "label": "cam5",
"ip": "http://79.189.131.176:99/videostream.cgi?user=admin&pwd=", "ip": "http://79.189.131.176:99/videostream.cgi?user=admin&pwd=",
"client_id": 2, "client_id": 2,
"status": false, "status": false,
"x":0.8, "x":0.2,
"y":0.8, "y":0.1,
"angle": 90 "angle": 160
} }
] ]

View File

@ -4,23 +4,23 @@
"label": "name1", "label": "name1",
"ip": "", "ip": "",
"status": false, "status": false,
"x":0.11, "x":0.3,
"y":0.8 "y":0.25
}, },
{ {
"id": 1, "id": 1,
"label": "name2", "label": "name2",
"ip": "http://127.0.0.1:81", "ip": "http://127.0.0.1:81",
"status": false, "status": false,
"x":0.3, "x":0.48,
"y":0.3 "y":0.4
}, },
{ {
"id": 2, "id": 2,
"label": "name3", "label": "name3",
"ip": "", "ip": "",
"status": false, "status": false,
"x":0.5, "x":0.38,
"y":0.6 "y":0.9
} }
] ]