{"id":15674727,"url":"https://github.com/bkbilly/libhikvision","last_synced_at":"2025-10-05T04:23:27.326Z","repository":{"id":62575840,"uuid":"204018179","full_name":"bkbilly/libHikvision","owner":"bkbilly","description":"Extract videos/photos from HikVision camera datadirs","archived":false,"fork":false,"pushed_at":"2023-05-06T19:20:01.000Z","size":21,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-18T11:30:35.555Z","etag":null,"topics":["dvr","hikvision","pypi","video"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/libhikvision/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bkbilly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-23T14:50:34.000Z","updated_at":"2024-05-01T08:14:33.000Z","dependencies_parsed_at":"2024-10-03T15:49:42.593Z","dependency_job_id":"2e2cc36b-1d07-4041-9a9e-7dcaea251dda","html_url":"https://github.com/bkbilly/libHikvision","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"71ac1429fb05f87900c8c96d33ffd6a00abc4f5d"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2FlibHikvision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2FlibHikvision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2FlibHikvision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkbilly%2FlibHikvision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkbilly","download_url":"https://codeload.github.com/bkbilly/libHikvision/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252777207,"owners_count":21802561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dvr","hikvision","pypi","video"],"created_at":"2024-10-03T15:49:37.037Z","updated_at":"2025-10-05T04:23:22.288Z","avatar_url":"https://github.com/bkbilly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LibHikvision\n[![PyPI Version](https://img.shields.io/pypi/v/libHikvision?label=PyPI\u0026logo=pypi)](https://pypi.org/project/libHikvision/)\n\n\nPython library to parse Hikvision datadirs that Hikvision IP cameras store the videos.\nUsing this class you can view details about recordings stored in a datadir and extract video and thumbnails.\n\n\n### Working Example\n\n```python\n#!/usr/bin/python3\n\nfrom libhikvision import libHikvision\nfrom datetime import datetime\nfrom datetime import timedelta\n\ncameradir = '/var/tmp/hikvision/'\nhik = libHikvision(cameradir, 'video')\n\n# Get information about the server\nprint(hik.getNASInfo())\n\n# Extract the segments within a specific range of dates\n# segments = hik.getSegments(\n#    from_time=datetime(2023, 5, 5, 8, 0, 0),\n#    to_time=datetime(2023, 5, 20, 23, 59, 00),\n#)\n\n# Extract last 3 Hours\nsegments = hik.getSegments(\n    from_time=(datetime.now() - timedelta(hours=3)),\n    to_time=(datetime.now()),\n)\n\n# Extract the Videos and Images from segments found above\nfor num, segment in enumerate(segments, start=0):\n    print('{0:4}) {1[cust_filePath]:55} {1[cust_duration]:5} {1[startOffset]:10} {1[endOffset]:10}   {1[cust_startTime]} - {1[cust_endTime]}'.format(\n        num,\n        segment\n    ))\n    oDate = datetime.strptime(\"{0[cust_startTime]}\".format(segment), '%Y-%m-%d %H:%M:%S')\n    sDateFormated=oDate.strftime('%Y%m%d-%H%M%S')\n    print(hik.extractSegmentMP4(num, cachePath='/var/tmp/', filename='/var/tmp/video-{0}.mp4'.format(sDateFormated)))\n    print(hik.extractSegmentJPG(num, cachePath='/var/tmp/', filename='/var/tmp/video-{0}.jpg'.format(sDateFormated)))\n```\n\nYou should also check the documentation of each method for extra options.\n\n### Credits\n\nBased on Dave Hope's PHP code available at https://github.com/davehope/libHikvision\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkbilly%2Flibhikvision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkbilly%2Flibhikvision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkbilly%2Flibhikvision/lists"}