Coder Social home page Coder Social logo

norkator / hikvision-video-audio-extractor Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 15.09 MB

Hikvision recording video audio extractor component for Open Intelligence

Home Page: https://github.com/norkator/open-intelligence

License: GNU Affero General Public License v3.0

C# 100.00%
hikvision open-intelligence hikvision-video-download hikvision-audio-export ffmpeg csharp

hikvision-video-audio-extractor's Introduction

Hikvision video audio extractor

Hikvision recording video audio extractor app component for Open Intelligence

What it does?

Downloads videos from your Hikvision camera, extracts audio from recording, saves audio under Open Intelligence output audio folder, keeps record of downloaded files on Open Intelligence records table. Repeat process between any given seconds specified at config.xml

To see more look at Open Intelligence Repository

Table of contents

Setup

Describes setup process for development and production sides.

Development

  1. Contents of HCNetSDK.zip are unzipped under VideoAudioExtractor\bin\Debug\bin
  2. Download ffmpeg windows build: https://ffmpeg.zeranoe.com/builds/
  3. Unzip ffmpeg anywhere you like. Example C:\ffmpeg
  4. Open system environmental variable editor and add C:\ffmpeg\bin to your System variables -> Path but with your unzip location including \bin since ffmpeg executable is under that folder.
  5. For me only after system restart ffmpeg started to work. Try with shell ffmpeg if runs without errors.
  6. Create config.xml: ...\VideoAudioExtractor\bin\Debug\netcoreapp3.1\config.xml and use config.xml section example filled with your details.
  7. Run application.

Production

  1. Download latest release from releases section HikvisionVideoAudioExtractor_...zip
  2. Unzip it anywhere you want.
  3. Configure config.xml under /HikvisionVideoAudioExtractor/netcoreapp3.1/ folder.
  4. Download ffmpeg windows build: https://ffmpeg.zeranoe.com/builds/
  5. Unzip ffmpeg anywhere you like. Example C:\ffmpeg
  6. Open system environmental variable editor and add C:\ffmpeg\bin to your System variables -> Path but with your unzip location including \bin since ffmpeg executable is under that folder.
  7. For me only after system restart ffmpeg started to work. Try with shell ffmpeg if runs without errors.
  8. Start using extractor via running VideoAudioExtractor.exe

config.xml

Sample config.xml file and options described.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <appSettings>
        <processSleepSeconds>900</processSleepSeconds>
        <ipAddress>0.0.0.0</ipAddress>
        <port>8000</port>
        <username>camera_user</username>
        <password>camera_password</password>
        <dbConnectionString>Host=localhost;Username=username;Password=password;Database=intelligence</dbConnectionString>
        <outputLocationPath>C:\Users\SomeUser\Example\Path\</outputLocationPath>
        <deleteVideos>true</deleteVideos>
        <audioSilenceRemove>true</audioSilenceRemove>
        <audiodBThreshold>-40dB</audiodBThreshold>
        <audioExportPath>C:\Users\SomeUser\Example\Path\</audioExportPath>
        <cameraName>CameraName</cameraName>
    </appSettings>
</configuration>

processSleepSeconds => Process run/repeat interval
ipAddress => Hikvision camera ip address
port => Camera port (default 8000)
username => Username for camera, suggest creating unique other than admin.
password => Camera created username password.
dbConnectionString => Open Intelligence postgresql database connection details.
outputLocationPath => Output path for videos downloaded.
deleteVideos => Process main task is to extract audio from video but also video can kept. audioSilenceRemove => Enabled will use ffmpeg from cmd to reduce/remove silence. audiodBThreshold => Value which below is considered as silence. audioExportPath => Open intelligence output/audio folder or any other if used with some other purpose.
cameraName => Camera name, meant to be same as Open-Intelligence config.ini specified camera name.

Database table

If you run it without Open Intelligence then you need one table on your PostgreSQL database.

create table recordings
(
	id bigserial not null
		constraint recordings_pkey
			primary key,
	camera_name varchar(255),
	file_name varchar(255),
	start_time timestamp with time zone,
	end_time timestamp with time zone,
	"createdAt" timestamp with time zone default now(),
	"updatedAt" timestamp with time zone default now()
);

alter table recordings owner to postgres;

Insert one line into database having some end_time so process uses it as base for recording lookup.

License

See LICENSE file.

hikvision-video-audio-extractor's People

Contributors

norkator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hikvision-video-audio-extractor's Issues

Make release

  • Write production version deployment instruction on readme
  • Make release

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.