Giter Site home page Giter Site logo

hikstract's People

Contributors

iafilatov 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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hikstract's Issues

Extraction fails with "struct.error: unpack requires a bytes object of length 80"

At first, thank you very much for the great script!

But some directories are failed to be processed.

Here is the debug output and the index file.

./hikstract
2018-07-19 11:58:42,743 [15476] DEBUG: Finished loading db: {'cur_datadir': 'datadir0',
 'datadirs': {'datadir0': {'cur_section': 1,
                           'last_vrec': 0,
                           'revision': 15787},
              'datadir1': {'cur_section': 131,
                           'last_vrec': 1,
                           'revision': 16269},
              'datadir2': {'cur_section': 0,
                           'last_vrec': -1,
                           'revision': 15683}}}
2018-07-19 11:58:42,743 [15476] INFO: Entering datadir0
2018-07-19 11:58:42,743 [15476] DEBUG: Making Header at /mnt/transport/vol03/datadir0/index00.bin:0
2018-07-19 11:58:42,744 [15476] DEBUG: cur_sec_idx: 2, rec_sec_num: 186, revision: 14228, total_sec: 2
2018-07-19 11:58:42,744 [15476] INFO: Index revision is 14228
2018-07-19 11:58:42,744 [15476] DEBUG: Making Section at /mnt/transport/vol03/datadir0/index00.bin:500
2018-07-19 11:58:42,744 [15476] DEBUG: end_dt: 2018-02-14 16:14:15, idx: 0, last_vrec_idx: 0, start_dt: 2018-02-14 15:52:02
2018-07-19 11:58:42,744 [15476] DEBUG: Making Section at /mnt/transport/vol03/datadir0/index00.bin:520
2018-07-19 11:58:42,745 [15476] DEBUG: end_dt: 2018-02-22 15:47:50, idx: 1, last_vrec_idx: 0, start_dt: 2018-02-22 15:39:22
2018-07-19 11:58:42,745 [15476] DEBUG: Making CurrentSection at /mnt/transport/vol03/datadir0/index00.bin:30
2018-07-19 11:58:42,745 [15476] DEBUG: end_dt: 1970-01-01 00:00:00, idx: 255, last_vrec_idx: 0, start_dt: 1970-01-01 00:00:00
2018-07-19 11:58:42,745 [15476] DEBUG: Entering section 1
2018-07-19 11:58:42,746 [15476] DEBUG: Making VideoRecord at /mnt/transport/vol03/datadir0/index00.bin:6c40
2018-07-19 11:58:42,746 [15476] DEBUG: duration: 508, end_dt: 2018-02-22 15:47:50, length: 260466216, start_dt: 2018-02-22 15:39:22, start_offset: 0
2018-07-19 11:58:42,746 [15476] DEBUG: Entering section 255
2018-07-19 11:58:42,746 [15476] DEBUG: Making VideoRecord at /mnt/transport/vol03/datadir0/index00.bin:4fcc40
Traceback (most recent call last):
  File "./hikstract", line 50, in <module>
    run()
  File "./hikstract", line 42, in run
    parser.update()
  File "/home/user/git/hikstract/parser.py", line 32, in update
    self.update_datadir(datadir)
  File "/home/user/git/hikstract/parser.py", line 61, in update_datadir
    next_vrecs = u.islice_from(sec.video_records, next_vrec_idx)
  File "/home/user/git/hikstract/items.py", line 104, in video_records
    vrec = VideoRecord.make(self._h_idx_file, idx, start)
  File "/home/user/git/hikstract/items.py", line 58, in make
    fields = struct.unpack(cls.fmt, buf)
struct.error: unpack requires a bytes object of length 80

-- in this case only one video file is created.
index00.bin.gz

Index.db file missing

What is the index.db file? Is it supposed to be autogenerated from the script? Or am I supposed to get it from the hikvision SD Card?

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.