Page 1 of 1

How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 9:33
by fantom
Hi

In postman i can call
http://IP:PORT/ISAPI/Streaming/channels/101/picture
with basic or digest auth, and i see a image.

In Domoticz I set this data, and when i click "Test connection" i don't see picture.

In network status i see "(blocked:origin)"

How can I fix it?

Re: How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 14:25
by habahabahaba
I have 3 hikvision cameras. All works fine in Dz (etc. in Dzvents, 'http://<user>:<pass>@192.168.0.85/ISAPI ... 01/picture' - for taking picture)

May be Port number, user, password? https instead of http?

Re: How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 14:29
by fantom
I try set parameters in configuration->Cameras

I am providing exactly the same ones as via postman.

But error is weird. Its not something like 401,404,405 etc. Its "blocked origin".

Re: How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 15:42
by waltervl
Is the ImageURL correct? should be: /ISAPI/Streaming/channels/101/picture
Perhaps strange characters in userID or password?

Re: How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 16:39
by fantom
Yes - url corrected - like in first post.
Zero weird characters in user/password.

Re: How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 17:29
by waltervl
Did you try ImageURL without the first slash?
ISAPI/Streaming/channels/101/picture

Re: How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 18:59
by fantom
I can set anything, and i always see in network:
picture (blocked:origin)

This is problem with CORS or something like that (I think).

Re: How can I add HikVision camera (problem with CORS)?

Posted: Wednesday 10 April 2024 19:02
by habahabahaba
screenshots?

Re: How can I add HikVision camera (problem with CORS)?

Posted: Thursday 11 April 2024 13:07
by fantom
I can change anything (ip, user, path etc) and i have always this same error in network.

In Postman i call http://192.168.1.xx:80/ISAPI/Streaming/ ... 01/picture and I can get picture.

Re: How can I add HikVision camera (problem with CORS)?

Posted: Thursday 11 April 2024 17:29
by habahabahaba
May be try to update the firmware of camera?

And did you try to get image from dzvent-script?

Re: How can I add HikVision camera (problem with CORS)?

Posted: Thursday 11 April 2024 17:32
by fantom
This is problem with routing/proxy or something like that i think

Camera have the newest firmware.

I don't use LUA :(

Re: How can I add HikVision camera (problem with CORS)?

Posted: Thursday 11 April 2024 19:32
by waltervl
This preview is sometimes not working on this page. Perhaps check the normal functionality. Eg add a trigger switch and have the screenshot sent by email.

Re: How can I add HikVision camera (problem with CORS)?

Posted: Thursday 06 June 2024 23:26
by kimot
First - I see your address "/channels/1/pic..." and for me works "/channels/101/pic..."

Second - Hikvision in manual recommends using strong passwords, but beware, you cannot use some characters in the http address.

For example my own painful experience when testing stream with VLC. My password contains a capital letter and a + character and VLC converted everything to lowercase letters before sending the address and removed + character. Therefore, I recommend a simple username and password for testing.