new
This commit is contained in:
3
reproject/.env
Normal file
3
reproject/.env
Normal file
@@ -0,0 +1,3 @@
|
||||
MINIO_ENDPOINT=8.147.233.66:9000
|
||||
MINIO_ACCESS_KEY=atc
|
||||
MINIO_SECRET_KEY=atch1114
|
||||
28
reproject/hook_mocker.py
Normal file
28
reproject/hook_mocker.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import requests
|
||||
|
||||
|
||||
class HookMocker:
|
||||
def __init__(self, alert, web_hook_url):
|
||||
self.alert = alert
|
||||
self.web_hook_url = web_hook_url
|
||||
|
||||
def start(self, width=1920, height=1080, fps=30):
|
||||
print(f"Mocker started with {width}x{height} at {fps} FPS")
|
||||
self.alert.start(width=width, height=height, fps=fps)
|
||||
|
||||
def provide_frame(self, frame):
|
||||
self.alert.provide_frame(frame)
|
||||
|
||||
def end(self):
|
||||
print("Mocker ending")
|
||||
self.alert.end()
|
||||
self.frame_count = self.alert.frame_count
|
||||
self.dropped_frames = self.alert.dropped_frames
|
||||
requests.post(
|
||||
self.web_hook_url,
|
||||
json={
|
||||
"EventName": "s3:ObjectCreated:Put",
|
||||
"Key": f"atc/{self.alert.name}",
|
||||
"Records": [],
|
||||
},
|
||||
)
|
||||
Reference in New Issue
Block a user