snavtclient =<

Free Open Source AV TECH CCTV DVR Client

README
About

snavtclient is free open source network client program for security surveillance CCTV camera digital video recorders (DVRs) manufactured by the AV TECH Corporation.

The author was unimpressed of the features and the performance of the bundled Video Server E software and the web based Java application included with his AVTECH DVR and decided to write this software instead. At that time there were no alternative client programs than the ones supplied by the manufacturer.

The software currently runs on FreeBSD and some GNU/Linux distributions but should be easily portable to any modern Unix like operating systems.

Much emphasis in the design of the program was put on efficiency and small memory footprint. The aim was to create a program which can be used also on obsolescent hardware to provide remote displays. SDL library which is used for video output is very flexible in the choice of video drivers. You can use SDL with X11 or without X11 on plain console. You can even use it with DEC VT100 by using aalib video driver although the video quality might be slightly degraded then :).

The software is currently functional but still in early stages of development and distributed in source code format only. Please see the list of currently implemented features for more information.

 
Features

The current main functions of snavtclient are:

  • Displaying the DVR video stream.
  • Switching security camera channels and display modes with quick and logical keyboard commands.
  • Controlling most DVR functions with a keyboard (similar fast user experience as when using the infra-red remote control, no clicking around with the mouse).
  • Saving video frames to individual JPEG files.
  • Time synchronization (setting DVR date and time from OS time).
  • Showing information about the DVR device.
  • Storing file attachments in alarm e-mails sent by the device (a separate optional Perl script).

Planned Features

The following features are currently unimplemented and are planned for future releases:

  • Retrieving detailed information about the DVR device.
  • Threads based model (separate threads for network, decoding and user interface).
  • Local visual and audible alarms.
  • Saving the video stream to disk (format TBD).
  • Automatic detection of video modes with interlacing or half-size frames.
  • Arbitrary DVR video display size scaling.
  • Image contrast enhancement mode (useful in low-light conditions with or without infra-red night vision cameras).
  • Retrieving the event log from the device.
  • M$ Windows support.
  • Client based zooming with mouse.
  • Client-based instant replay (keep last N seconds of CCTV video in local memory buffer so that it can be replayed by user request).

The following features may or may not be implemented at some point, contributions are welcome:

  • GUI controls for setting up everything (instead of command-line).
  • OpenGL support (to help architectures where this is the only accelerated mode).
  • Monitoring the DVR for events and performing pre-defined actions based on the events.
  • Showing recent event log entries on display together with CCTV video stream.
  • Receiving and playing audio from the DVR (audio may or may not be available through the network, it is TBD - if not, we can always run an audio cable from the DVR to a computer somewhere nearby...)
  • Trans-coding the video stream for re-transmission over slower network links.
  • DVR configuration control.
  • PTZ control.
  • Backups.
 
Supported DVR Models

The following specific AV TECH CCTV DVR models have been tested and are known to work with the latest release of snavtclient:

  • AV TECH AVC 785
  • AV TECH AVC 760 (old versions)

The following models are likely to work without modifications:

  • AV TECH AVC 783
  • AV TECH AVC 785/785D
  • AV TECH AVC 787
  • AV TECH AVC 787/787D

The following models are likely to work, possibly after minor modifications:

  • AV TECH AVC 732

The following models are known not to work:

  • AV TECH 940 and related models (new protocol)
  • AV TECH AVC 761 ASV
  • AV TECH AVC 760 ZAS
  • pretty much all new models introduced after 2008

The same DVRs are being sold under other brand names as well (for example Swann). You might find out that this software works with other DVR brands too if the OEM is AVTECH. The CCTV video streaming protocol used by these DVR devices is proprietary and there is no public documentation (except the source code) available about it. The protocol support was implemented by performing protocol analysis.

Please report any success or failures with specific brands and models you have tested to the author. Please include the brand name and model number indicated outside of your DVR unit as well as the output of the snavtclient --info command in your report.

Patches for supporting additional DVR models are greatly appreciated.

The author may be available to develop support for your specific DVR model or to implement additional features. In this case please contact the author to discuss your needs.

 
 
Supported Operating Systems

The primary development environment of snavtclient consists of the following operating systems:

The program should compile and run with no modifications on the above or similar modern Linux, BSD and Unix platforms where the required libraries are supported and installed.

So far there are some reports of success on the following additional platforms:

  • Mac OS X (using Mac Xcode IDE, minor modifications required)
  • Nokia N900 (Maemo 5.0)

Please report any success or failure on other platforms to the author.

Apple iPhone is specifically not supported. Apple's licensing model for the iPhone development tools makes it unreasonably difficult to develop free software for the iPhone platform. This is mentioned here because there has been a couple of inquiries about an iPhone version.

The build system is GNU Autotools based but it is known that some older platforms are not currently supported as the author has used some APIs found only on modern operating systems for the sake of convenience.

There are currently no pre-compiled binary packages, but they may be made available at a later time after the high priority features have been implemented.

 
Required Libraries

Simple Directmedia Layer

The program depends heavily on Simple Directmedia Layer library also known as SDL as well as the additional SDL_net and SDL_image libraries. They are freely available. See http://www.libsdl.org/ for more information. I would like to thank Sam Lantinga for his excellent work.

Recent versions of snavtclient have been tested with the following library versions:

  • SDL 1.2.12 and 1.2.13
  • SDL_net 1.2.7
  • SDL_image 1.2.6

The SDL_image library needs to include a support for the JPEG image format. Therefore you will need The Independent JPEG Group's freely available JPEG software libraries as well. The development environment consists of version 6b of this library. See http://www.ijg.org/ for more information.

Perl optional

The optional DVR e-mail handling script requires a relatively modern version of Perl interpreter and also the Email::Simple and Email:MIME modules. See http://www.perl.org/ and http://emailproject.perl.org/ for more information. The prototype of this software was written in Perl, but the author found the Perl SDL API quite lacking, and after all... maybe Perl is still not the best choice for making a video viewer :). For everything else I still use Perl. Thank you Larry Wall!

 
Compilation and Installation

Compilation and installation of snavtclient on supported platforms with required libraries already installed in standard locations should be as simple as this:

  1. ./configure
  2. make
  3. make install

Please see the accompanying INSTALL file for generic installation instructions. If you have problems making the configure script find the SDL library, you can specify the location as follows:

./configure --with-sdl-prefix=/your/odd/sdl/location

 
 
Usage

The snavtclient(1) manual page describes all the command line options and keyboard bindings. It should be available after installation by typing:

man snavtclient

A brief summary of all command line options is available by typing:

snavtclient --help

You may check your snavtclient and SDL version by typing:

snavtclient --version

There is currently no GUI for setting up anything. You need to start the program from command line or from a script.

Video display and camera channel selection

Basic example for showing the output of your DVR on your display would be:

snavtclient -s -H mydvr.example.com -u myuser -p mypass

Or with long, more descriptive options with the same meanings:

snavtclient --show --dvrhost=mydvr.example.com --dvruser=myuser --dvrpass=mypass

You can quit the video display with ESC key. You can switch CCTV camera channels by pressing number or function keys (1 = camera input channel #1, 2 = camera #2, 0 = camera #10, F1 = camera #11, F2 = camera #12, etc.). See the snavtclient(1) manual page for full details.

For some video display settings there is a command-line flag. For other SDL video display related settings, see the documentation about SDL environment variables at http://www.libsdl.org/cgi/docwiki.cgi/SDL_envvars.

For example to make the video window appear at the display coordinates [100,50] you could do the following:

SDL_VIDEO_WINDOW_POS=100,50 snavtclient --show -H dvr.example.com

Video frame recording

You could put this in your crontab to make an image from your DVR updating every minute available for inclusion to your home page:

* * * * * /usr/local/bin/snavtclient -j /your/public_html/dvr.jpg -H 192.168.77.22 -q 0 -u cron -p supersecret

The program makes sure that the output file always exists and is always a complete frame (that is if your operating system implements rename() correctly). If you want the image to update every second, it is better to have snavtclient running in the background:

snavtclient --dumpjpeg=/your/public_html/dvr.jpg --dumpcount=999999 --dumpinterval=1 --dvrhost=yourdvr.example.com --dvruser=foo --dvrpass=bar &

If you want every JPEG frame to go in to a different file, you can specify for example --dumpjpeg=/some/path/foo@.jpg. The @ character in the file name is replaced with an auto-incrementing 6 digit sequence number and you would end up with files named foo000001.jpg, foo000002.jpg, foo000003.jpg and so on in /some/path.

E-mail handling script

You could put the following line in your /etc/mail/aliases:

alarm-email: "| /usr/local/sbin/snavtclient-email"

You should only do the above after manually editing the script and changing the $datadir variable to point to a suitable location. Please note that if anything goes wrong with the script, it will spit its error message to standard output, and thus the From addressee of the e-mail will receive a bounce containing the error message. So please configure your DVR to use a From address which goes back to yourself.

 
Contributions Welcome

If you modify snavtclient to support more DVR models or to have additional functionality, portability or performance, the author would appreciate if you could submit the patches to be included in the next release.

AGPLv3 logo

Because this is free software published under the terms of the GNU Affero General Public License you can of course publish your own modified version under the terms described in the accompanying LICENSE and COPYING files.

 
Author Contact Information

Author contact information:

Janne Snabb
This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Software web site:

http://snavtclient.epipe.com/

This software may be available under different licensing terms. Please contact the author for any inquiries.

The author is not affiliated in any way with AV TECH Corporation and has not asked for nor received any support or information from them in the course of making this program.

 



You are here  : Home README ALL on single page