From 750708a80eb7c50f95ec4c5fe982e5ba954eabf4 Mon Sep 17 00:00:00 2001 From: dv Date: Tue, 14 Apr 2026 15:41:19 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BA=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D1=80=D1=8B=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/services/camera.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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: