Giter Site home page Giter Site logo

dvrstart's Introduction

dvrstart

Dmitry Bachilo's DVR software for FreeBSD
Based on Ivan Avdeev's shell scripts logic

This is a free DVR software for FreeBSD written in Gambas.
This software uses ffmpeg to record video and audio (if available) from a survailance cameras.
The list of supported cameras is limited to what I personally have and can test, but the key feature is that new type of camera is easily added to the supported list, while in all my commercial hardware DVRs this list can't be changed if the device is not supported by vendor anymore, so that's why I wrote this piece of software in the first place.
It records rtsp flow and devides it into 20-minute mp4 files sorted by subdirectories with camera names.

Feel free to contribute.

To run it you obviously need Gambas and FFMpeg installed on your FreeBSD machine (or Linux, or any other system that supports Gambas and FFMpeg) Now, I have a gambas installation script for FreeBSD 12.x AMD64, which is basically a binary distrib I compiled myself: just downwload and run http://allunix.ru/back/gbinst.sh on your FreeBSD fresh installed machine and you are ready to run console Gambas software.

You will also need to create /usr/local/etc/dvr directory and place three files in there.

/usr/local/etc/dvr/cams.conf should contain your cameras, one in a row, in a following format:
<ip>;<login>;<password>;<manufacturer>;<name>

for example:

192.168.10.22;root;admin;Axis;Parking_Lot
192.168.10.23;Admin;Admin;Hikvision;Entrance

and so on.

/usr/local/etc/dvr/storage.conf must cantain full path to the place where you want to store your records

for example: /root/cams/

the last slash is mandatory

In this case Parking_Lot camera will put it's records to /root/cams/Parking_Lot/

recorded files will have a filename based on a time of record, i.e.
/root/cams/Parking_Lot/record-[2020-09-27]-16-20.mp4
The files are 20 minutes long, so you will have three files per hour. This could be ajusted in future releases.
While dvrstart is created to make 20-minute files, it tries to keep the files easily sorted, so that every record starts at eiter 00 or 20 or 40 minutes of the current hour. If dvrstart was lauched, say, at 13:22, it would wait until it's 13:40 and then stop the record and immidiately restart it, so that the next file will be called 13-40, then 14:00, then 14:20 and so on. It happens only at startup. If your server loses the connection with the camera, it will stop the record and would try to regain access. When it would reach the camera again, it would start the recording immediately, making all other records iterate every 20 minutes for now on whatever the time is. However every midnight it adjusts the filenames again. relaunching the recording, so the day always starts at 00:00 and then keeps on recording this way.

In other words, say, you started the recording at 21:38 and lost a connection for a few seconds at 23:03. What you would have in your camera_name directory is:
record-[2020-09-27]-21-38.mp4 - this file would be 2 minutes long
record-[2020-09-27]-21-40.mp4 - this and further files would be 20 minutes long
record-[2020-09-27]-22-00.mp4
record-[2020-09-27]-22-20.mp4
record-[2020-09-27]-22-40.mp4
record-[2020-09-27]-23-00.mp4 - this file would be 3 minutes long
record-[2020-09-27]-23-03.mp4 - this and next file would be 20 minutes long
record-[2020-09-27]-23-23.mp4
record-[2020-09-27]-23-43.mp4 - this file would be 17 minutes long
record-[2020-09-28]-00:00.mp4 - this and further files would be 20 minutes long
record-[2020-09-28]-00:20.mp4
record-[2020-09-28]-00:40.mp4
record-[2020-09-28]-01:00.mp4
and so on.

/usr/local/etc/dvr/storedays.conf must contain the amount of days the records are kept on the server. for example: 25

this means that on september 26 the records made on september 1st will be deleted from the server.

It does not matter, where your dvrstart.gambas file is located, you can run it from anywhere, but it is assumed that you run it from /usr/local/bin during the system startup and it has root priviledges.

It does not have to be run as root as of now, because it does not write it's config files yet. If you have a user, which has write privs to the path of records, then it would work just as good.

dvrstart's People

Contributors

dbachilo avatar

Stargazers

komp avatar  avatar Denys Sedchenko avatar Konstantin Nikulin avatar Yury Martynov avatar

Watchers

 avatar

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.