фикс камеры 4
This commit is contained in:
parent
f788067d5a
commit
750708a80e
1 changed files with 3 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue