diff --git a/reproject/.env b/reproject/.env new file mode 100644 index 0000000..e05e650 --- /dev/null +++ b/reproject/.env @@ -0,0 +1,3 @@ +MINIO_ENDPOINT=8.147.233.66:9000 +MINIO_ACCESS_KEY=atc +MINIO_SECRET_KEY=atch1114 \ No newline at end of file diff --git a/reproject/hook_mocker.py b/reproject/hook_mocker.py new file mode 100644 index 0000000..d8a7a73 --- /dev/null +++ b/reproject/hook_mocker.py @@ -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": [], + }, + )