Hikvision recording video audio extractor app component for Open Intelligence
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
Describes setup process for development and production sides.
- Contents of
HCNetSDK.zip
are unzipped underVideoAudioExtractor\bin\Debug\bin
- Download ffmpeg windows build: https://ffmpeg.zeranoe.com/builds/
- Unzip ffmpeg anywhere you like. Example
C:\ffmpeg
- Open system environmental variable editor and add
C:\ffmpeg\bin
to yourSystem variables
->Path
but with your unzip location including\bin
since ffmpeg executable is under that folder. - For me only after system restart ffmpeg started to work. Try with shell
ffmpeg
if runs without errors. - Create config.xml:
...\VideoAudioExtractor\bin\Debug\netcoreapp3.1\config.xml
and use config.xml section example filled with your details. - Run application.
- Download latest release from releases section
HikvisionVideoAudioExtractor_...zip
- Unzip it anywhere you want.
- Configure
config.xml
under/HikvisionVideoAudioExtractor/netcoreapp3.1/
folder. - Download ffmpeg windows build: https://ffmpeg.zeranoe.com/builds/
- Unzip ffmpeg anywhere you like. Example
C:\ffmpeg
- Open system environmental variable editor and add
C:\ffmpeg\bin
to yourSystem variables
->Path
but with your unzip location including\bin
since ffmpeg executable is under that folder. - For me only after system restart ffmpeg started to work. Try with shell
ffmpeg
if runs without errors. - Start using extractor via running
VideoAudioExtractor.exe
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.
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.
See LICENSE file.