Skip to main content

CLI to extract playable video from EZVIZ/Hikvision SD cards' proprietary round-robin storage format. Works specifically for devices that use hiv<xxxxx>.mp4 and index00.bin files.

Project description

ezhikstract

CLI tool to extract playable video from EZVIZ and Hikvision SD cards' proprietary round-robin storage format.

It works specifically with security camera or video doorbell SD cards that contain files named hiv<xxxxx>.mp4 and an index00.bin metadata/index file. The tool parses the index file, validates video segments, extracts the raw MPEG-PS streams, and remuxes them into standard .mp4 containers, merging segments from the same day into a single daily video file.

No full video re-encoding is performed; video streams (HEVC) are copied directly. Audio streams (e.g., PCM G.711 / Alaw) are re-encoded to Opus to ensure compatibility with standard media players.

Installation

Install the package directly from the repository directory:

pip install ezhikstract

Usage

The CLI provides two main commands: list and extract.

Command: list

Lists all valid recordings found on the SD card without extracting them.

Usage

ezhikstract list INPUT_DIR

Arguments

  • INPUT_DIR (Required): Root directory of the SD card containing index00.bin.

Command: extract

Extracts recording segments from the SD card, filters them by date/time if specified, and merges segments from the same day into a single file named by start time (DDMMYYYY HHMMSS.mp4).

Usage

ezhikstract extract INPUT_DIR [OPTIONS]

Arguments

  • INPUT_DIR (Required): Root directory of the SD card containing index00.bin.

Options

  • -o, --output PATH: Output directory for the extracted and merged .mp4 files. Default is recordings.
  • --from DATETIME: Inclusive start filter, UTC (format: YYYY-MM-DD HH:MM:SS).
  • --to DATETIME: Exclusive end filter, UTC (format: YYYY-MM-DD HH:MM:SS).
  • --replace / --no-replace: Whether to overwrite existing files in the output directory. Default is --replace.

How it Works

The SD cards of these cameras use a pre-allocated round-robin storage file format:

  1. index00.bin (and the backup copy index01.bin) contains pointers, timestamps, offsets, and checksums for the recorded video segments.
  2. The video data is written to pre-allocated hivxxxxx.mp4 files, which are all exactly 268.4 MB (as are the index files).
  3. Within the hivxxxxx.mp4 files, the videos are stored as raw MPEG-PS streams (MPEG Program Stream with HEVC video and G.711/PCM audio).
  4. ezhikstract parses index00.bin, verifies the boundaries and starts of the segments inside hivxxxxx.mp4 (checking for valid MPEG-PS headers), extracts the segments, groups them by day, stream-copies the HEVC video tracks, re-encodes the audio to Opus, and concats the daily segments using the FFmpeg concat demuxer.

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

ezhikstract-0.1.0.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezhikstract-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file ezhikstract-0.1.0.tar.gz.

File metadata

  • Download URL: ezhikstract-0.1.0.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ezhikstract-0.1.0.tar.gz
Algorithm Hash digest
SHA256 daa3d4ce12ad9ddb8792c976a3f11d7caddce03e079a985382eedfb51daf9e91
MD5 2b032bf0985272ec38bb3ab43e163c8d
BLAKE2b-256 3d929758e14c6e1b275bf54e6b256c89501a3b938ef9bd11e85e869a62f32db2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezhikstract-0.1.0.tar.gz:

Publisher: release.yml on damianjude/ezhikstract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ezhikstract-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ezhikstract-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ezhikstract-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff341b18e4a8ef1d3699adc6ff25c3c351dbec56b0644f5afdba7868950b0b96
MD5 cf42a3f1c4838cafe3608627d4ce0806
BLAKE2b-256 4bebe2b7e6594bf2f2862658a560c375986c0556af8f36bec89aa8fc9bb1b7ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for ezhikstract-0.1.0-py3-none-any.whl:

Publisher: release.yml on damianjude/ezhikstract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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