Skip to main content

Download videos from a HikVision DVR/NVR

Project description

HikLoad

A collection of short Python scripts that utilize the ISAPI specification for Hikvision DVR/NVRs/Cameras.

Using the UI

If you want to use the new interface written in Qt, you can use the command hikload-qt after installing using one of the recommended methods (only pip and source).

The Startup popup

The Main Window

Using the terminal

To use your own DVR it is usually only needed to change the arguments for the script. The first parameter is the IP, the second one is the username and the third is the password. Here are all of the possible parameters:

usage: hikload [-h] [--server SERVER] [--username USERNAME] [--password PASSWORD] [--starttime STARTTIME] [--endtime ENDTIME]
               [--folders {onepercamera,oneperday,onepermonth,oneperyear}] [--debug | --no-debug] [--videoformat {mkv,mp4,avi}] [--downloads DOWNLOADS] [--frames FRAMES]
               [--force | --no-force] [--skipseconds SKIPSECONDS] [--seconds SECONDS] [--days DAYS] [--skipdownload | --no-skipdownload] [--allrecordings | --no-allrecordings]
               [--cameras CAMERAS] [--localtimefilenames | --no-localtimefilenames] [--yesterday | --no-yesterday] [--ffmpeg | --no-ffmpeg]
               [--forcetranscoding | --no-forcetranscoding] [--photos | --no-photos] [--mock | --no-mock] [--ui | --no-ui]

Download Recordings from a HikVision server, from a range interval

options:
  -h, --help            show this help message and exit
  --server SERVER       the hikvision server's address
  --username USERNAME   the username
  --password PASSWORD   the password
  --starttime STARTTIME
                        the start time in ISO format (default: today at 00:00:00, local time)
  --endtime ENDTIME     the start time in ISO format (default: today at 23:59:59, local time)
  --folders {onepercamera,oneperday,onepermonth,oneperyear}
                        create a separate folder per camera/duration (default: disabled)
  --debug, --no-debug   enable debug mode (default: false)
  --videoformat {mkv,mp4,avi}
                        specify video format (default: mkv)
  --downloads DOWNLOADS
                        the downloads folder (default: "Downloads")
  --frames FRAMES       save a frame for every X frames in the video (default: false)
  --force, --no-force   force saving of files (default: false)
  --skipseconds SKIPSECONDS
                        skip first X seconds for each video (default: 0)
  --seconds SECONDS     save only X seconds for each video (default: inf)
  --days DAYS           download videos for the last X days (ignores --endtime and --starttime)
  --skipdownload, --no-skipdownload
                        do not download anything
  --allrecordings, --no-allrecordings
                        download all recordings saved
  --cameras CAMERAS     camera IDs to search (example: --cameras=201,301)
  --localtimefilenames, --no-localtimefilenames
                        save filenames using date in local time instead of UTC
  --yesterday, --no-yesterday
                        download yesterday's videos
  --ffmpeg, --no-ffmpeg
                        enable ffmpeg and disable downloading directly from server
  --forcetranscoding, --no-forcetranscoding
                        force transcoding if downloading directly from server
  --photos, --no-photos
                        enable experimental downloading of saved photos
  --mock, --no-mock     enable mock mode WARNING! This will not download anything from the server
  --ui, --no-ui         enable UI interface WARNING! Requires Qt5 to be installed (default: False)

The DVR/NVR needs to have ISAPI and RTSP enabled in System/Security and H264+ disabled for every camera.

Installing and running the script

You can install the script from PyPi, run the script directly from the source, or use the Docker image:

docker pull ghcr.io/tedyst/hikload
docker run -v $(pwd)/Downloads:/app/Downloads ghcr.io/tedyst/hikload --server 192.168.10.239 --user admin --password password

If you decide to use the PyPi package, there will be a command called hikload in your PATH, and also a program named hikload-qt for the UI version:

pip install hikload
hikload -h

To run the script from source, you can use this command from the root directory of the project:

python setup.py install
hikload -h

After this command, you will have installed hikload and hikload-qt in your PATH.

If you want to use the default arguments, you can specify only the required arguments:

hikload --server 192.168.10.239 --user username --password password

For more advanced users, you can specify optional arguments like the start and end time for the video search:

hikload --server 192.168.10.239 --user username --password password --starttime 2021-09-19T03:00:00+03:00 --endtime 2021-09-20T04:00:00+00:00

Or just specify the cameras that you want to search(be sure to use the HikVision format - 101 for first camera, 201 for the second one...):

hikload --server 192.168.10.239 --user username --password password --cameras=201,301

Installing Dependencies

Due to common problems found while installing the dependencies needed by this project, it is recommended to use a python virtualenv. Here is how to setup one:

pip install pipenv
pipenv install --dev
pipenv shell

And everytime you restart the terminal and want to use the virtualenv, you need to run these commands:

pipenv shell

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hikload-1.1.4.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

hikload-1.1.4-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

Details for the file hikload-1.1.4.tar.gz.

File metadata

  • Download URL: hikload-1.1.4.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for hikload-1.1.4.tar.gz
Algorithm Hash digest
SHA256 a961ab2211e6421090e8c884b75d0abde35105c2fc6b15ce828add367037149c
MD5 06fdf6a944785bc49d08bb8ca8609ed1
BLAKE2b-256 d202630397b5d440a0461c8a54897b0ecd970ac19a793e1471e82814d3db0db0

See more details on using hashes here.

File details

Details for the file hikload-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: hikload-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for hikload-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 564c4925f0cf6c35e42ebc5c9fb041c495c4b9a403b84fa8cbb9481d7c2afef7
MD5 55837a5716630f553d3dbc4d935e9fa9
BLAKE2b-256 1de3fca9ba18c371df5f3a9ab1d2de3050aeb5855d41ea68c0b3164f1346d097

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page