This commit is contained in:
邓智航
2026-03-06 17:07:50 +08:00
parent 453273a2c6
commit e5c843334e
2 changed files with 31 additions and 0 deletions

3
reproject/.env Normal file
View 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
View 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": [],
},
)