diff --git a/backend/app/services/camera.py b/backend/app/services/camera.py index 7972b9e..9efa2eb 100644 --- a/backend/app/services/camera.py +++ b/backend/app/services/camera.py @@ -136,9 +136,8 @@ async def isapi_snapshot( if frame_url: url = frame_url else: - # Hikvision ISAPI channel format: channel 1 main = 101 - ch = f"{channel:02d}1" - url = f"http://{device.ip}:{port}/ISAPI/Streaming/channels/{ch}/picture" + # Hikvision: channel 1 main stream = 101, channel 2 = 201, etc. + url = f"http://{device.ip}:{port}/ISAPI/Streaming/channels/{channel}01/picture?snapShotImageType=JPEG" log.info("[camera] snapshot GET %s (user=%r)", url, user) try: @@ -182,9 +181,7 @@ async def mjpeg_stream( if stream_url.startswith("http"): url = stream_url else: - # Hikvision ISAPI MJPEG: channel 1 main = 101 - ch = f"{channel:02d}1" - url = f"http://{device.ip}:{port}/ISAPI/Streaming/channels/{ch}/httppreview" + url = f"http://{device.ip}:{port}/ISAPI/Streaming/channels/{channel}01/httppreview" async with httpx.AsyncClient(auth=(user, password), timeout=httpx.Timeout(timeout)) as client: async with client.stream("GET", url) as resp: