Giter Site home page Giter Site logo

hikvision-site's Introduction

README

This Web Application is a nice UI for all your hikvision cameras. It supports Login and it is using native HTML5 without the need to install any other plugin for the client.

Preview of the interface

Configure

.htaccess:

  • At the SetEnv AuthUser & SetEnv AuthPass change it into your own desire.
  • At the SetEnv camPaths add a comma sepperated list of each path to your cameras info.bin files.
  • At the SetEnv camNames add a comma sepperated list of name the camera names which should be the same size as the camPaths.
  • At the SetEnv camIPs add a comma sepperated list of the IPs of each camera.
  • At the SetEnv camAuths add a comma sepperated list of the usernames/passwords for the authentication in this format: "admin:password"
  • At the SetEnv camVersions (optional) add a comma sepperated list of whether the Hikvision/HiLook cameras are on newer firmware and need /ISAPI/ paths. 0 for old, 1 for ISAPI/new - like "0,1" for an old and new camera, or "1,1" for two new cameras.

Dependencies

  • PHP version 5.6 or newer for the unpack to support 64 bit format
  • php-imagick for the image preview
  • php-sqlite3 for reading the new data structure
  • Enable .htaccess support on your http server

Docker

You can install it using docker from here: https://hub.docker.com/r/bkbillybk/hikvision_site

Credits

Used a modified version of libHikvision library by Dave Hope, available at https://github.com/davehope/libHikvision

hikvision-site's People

Contributors

bkbilly avatar ccrlawrence avatar danielo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hikvision-site's Issues

strange issue

hi
i have a strange issie that i missunderstood

the error log (poor)

[Wed Jan 19 15:47:27.591490 2022] [php:error] [pid 731627] [client 127.0.0.1:60716] PHP Fatal error: Uncaught ImagickException: Failed to read the file in /var/www/html/hik/dispatcher.php:152\nStack trace:\n#0 /var/www/html/hik/dispatcher.php(152): Imagick->__construct()\n#1 /var/www/html/hik/dispatcher.php(25): videopicture()\n#2 {main}\n thrown in /var/www/html/hik/dispatcher.php on line 152, referer: http://localhost/hik/
[Wed Jan 19 15:47:31.636795 2022] [php:error] [pid 731627] [client 127.0.0.1:60716] PHP Fatal error: Uncaught ImagickException: Failed to read the file in /var/www/html/hik/dispatcher.php:152\nStack trace:\n#0 /var/www/html/hik/dispatcher.php(152): Imagick->__construct()\n#1 /var/www/html/hik/dispatcher.php(25): videopicture()\n#2 {main}\n thrown in /var/www/html/hik/dispatcher.php on line 152, referer: http://localhost/hik/

this php file (and other) are owned by apache!

Uncaught ImagickException: Failed to read the file

Trying to install today on Fedora FC36. Apache httpd 2.4.54 + PHP 8.1.3.

I see this error trying to fetch /dispatcher.php?action=videopicture in the browser:

<b>Fatal error</b>:  Uncaught ImagickException: Failed to read the file in /usr/share/Hikvision-Site/dispatcher.php:152
  | Stack trace:
  | #0 /usr/share/Hikvision-Site/dispatcher.php(154): Imagick-&gt;__construct()
  | #1 /usr/share/Hikvision-Site/dispatcher.php(25): videopicture()
  | #2 {main}
  | thrown in <b>/usr/share/Hikvision-Site/dispatcher.php</b> on line <b>152</b><br />

Everything in .htaccess configured correctly. Verified as I put logging in the code to print out the URL. Even tried fetching the URL with PHPs file_get_contents which also reported an error: Failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized.

tmp['fileExists'] not set

Like the interface, but I think you must have further versions past this. There are variables in libHikvision.php that are unassigned, resulting in no events being displayed in time line.

I see on line 247 you unpack the key existByte

later on line 260, you refer to two unassigned variables , existByte1 and existByte2 , I'm guessing they are the two bytes in existByte.

When I forced the value of tmp['fileExists'] = Trueafter line 262, I started seeing events.

for reference only, my hikvision firmware is V5.4.5 build 170123

Cannot read properties of undefined (reading 'start') using Prev/Next Event buttons

After the page has loaded, I see blue marks in the camera timelines indicating events. However, trying to use the Prev/Next Event buttons nothing happens.

Looking in the browser's console these errors appear:

Uncaught TypeError: Cannot read properties of undefined (reading 'start')
    at findEvent (myjs.js:189:42)
    at gotoEvent (myjs.js:178:17)
    at document.getElementById.onclick (myjs.js:52:61)

no live view and events

Hi,
I just brought a new DS-2CD2146G2-I cam and tried your project since my computer runs Linux, but have a few issues.
This cams runs firmware version 5.5.160_210108. I configured it to store videos and pictures on my NAS via NFS each time a smart event is detected.
First, there is no index00.bin in datadir[0,1,2,3] directories. The file structure is better like this:
event_db_index00
event_db_index01
HIKWS
...
logCurFile.bin
logMainFile.bin
record_db_index00
record_db_index01
This lead to the following error when I load the page:
PHP Warning: fopen(/mnt/bigbrother01/datadir0/index00.bin): failed to open stream: No such file or directory in /var/www/html/libHikvision.php on line 112
No image or live view is displayed. If I click on the camera name, then a picture from the camera appears but don't go live.
In the timeline no event are reported.
Do you think that the tool could support this camera ?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.