Parse Hikvision datadirs that Hikvision IP cameras store the videos
Project description
README
Python library to parse Hikvision datadirs that Hikvision IP cameras store the videos. Using this class you can view details about recordings stored in a datadir and extract video and thumbnails.
Working Example
#!/usr/bin/python3
from libhikvision import libHikvision
from datetime import datetime
cameradir = '/var/tmp/hikvision/'
hik = libHikvision(cameradir, 'video')
segments = hik.getSegments(
from_time=datetime(2019, 8, 21, 22, 23, 30),
to_time=datetime(2019, 8, 21, 22, 25, 00),
)
# Gets information about the structure of the files
for file in hik.getFiles():
print(file)
# Extract the Videos and Images from segments found above
for num, segment in enumerate(segments, start=0):
print('{0:4}) {1[cust_filePath]:55} {1[cust_duration]:5} {1[startOffset]:10} {1[endOffset]:10} {1[cust_startTime]} - {1[cust_endTime]}'.format(
num,
segment
))
print(hik.extractSegmentMP4(num, '/var/tmp/'))
print(hik.extractSegmentJPG(num, '/var/tmp/'))
Credits
Based on Dave Hope's PHP code available at https://github.com/davehope/libHikvision
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
libhikvision-0.3.3.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for libhikvision-0.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b97fd652c8f97c478b1b2e07d0418aef093f86049aa3a23d9ec250724969552 |
|
MD5 | 8ebd9acb026d53cd29cdcb6ce01ef13e |
|
BLAKE2b-256 | 32e2ba3e86efbf0f01581d645a368d2810ee63dd01059975a46d73b6a6bbf13b |