zoneminder-h264 - Complete security camera solution, fully web based with image analysis, experimental h264 version

Property Value
Distribution FreeBSD 10
Repository FreeBSD Ports Quarterly i386
Package name zoneminder-h264
Package version 1.30.20170222
Package release 7
Package architecture i386
Package type txz
Installed size 27.19 MB
Download size 5.15 MB
Official Mirror
Zoneminder is an all-in-one GPL'd security and surveillance camera solution.
Fully web-based system for viewing and analyzing security camera feeds.
This is an experimental version which has H.264 support.
Categories: multimedia
- DOCS: on
- NLS: on
- V4L: off
ZoneMinder is a free, open source Closed-circuit television software 
application developed for Unix-like operating systems which supports 
IP, USB and Analog cameras. 
New installs
ZoneMinder requires a MySQL (or MySQL forks) database backend and 
a http server, capable to execute PHP and CGI scripts.
To simplify things, we assume, that you use MySQL and NGINX on 
the same server.
1. Preliminary steps
1.1 Install databases/mysql56-server or newer
You may choose your favourite method - ports or packages here. 
FreeBSD default setting use STRICT_TRANS_TABLES sql_mode. It's mandatory to disable it. Edit your my.cnf accordingly
The following SQL mode should be compatible with ZM:
ZoneMinder use very simple queries, however it tends to write to 
the database quite a lot depending on your capture mode and number 
of cameras. So tweak your MySQL instance accordantly
Now, enable and start MySQL
sysrc mysql_server_enable="YES"
service mysql-server start
1.2 Install www/nginx 
We provide an example for an HTTP install, however, you should use 
HTTPS if you plan to expose your installation to the public. There 
are plenty guides how to do it and security/ is a 
good way to get a valid SSL certificate.
Your server block should include the following:
server {
root /usr/local/www/zoneminder;
try_files $uri $uri/ /index.php$is_args$args;
index index.php;
location = /cgi-bin/nph-zms {
include fastcgi_params;
fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass    unix:/var/run/fcgiwrap/fcgiwrap.sock;
location ~ \.php$ { 
include fastcgi_params;
fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
fastcgi_pass    unix:/var/run/php-fpm.sock;
location /api {
rewrite ^/api/(.+)$ /api/index.php?p=$1 last;
1.2.1 ZoneMinder has it's own authentication system, however it's recommend to use NGINX basic 
auth over HTTPS if you don't need fine grain control to ZoneMinder components.
1.2.2 If you choose ZoneMinder authentication, it's recommended to prohibit access to 
image and events folder as it's possible to guess file names inside it.
location ~ ^/(?:images|events)/ {
deny all;
Enable and start NGINX
sysrc nginx_enable="YES"
service nginx start
1.3 Install www/fcgiwrap 
As NGINX lacks it's own CGI wrapper, we need external one. Please 
note that ZoneMinder's montage page use simultaneous access to all 
cameras, so you need to use at least as many fcgiwrap workers as 
your number of cameras. The following example assumes you have 4.
Enable and start FcgiWrap
sysrc fcgiwrap_enable="YES"
sysrc fcgiwrap_user="www"
sysrc fcgiwrap_socket_owner="www"
sysrc fcgiwrap_flags="-c 4"
1.4 PHP is installed as a dependency to ZoneMinder. However, you should 
tweak some of it's settings.
Edit /usr/local/etc/php-fpm.conf and set
listen = /var/run/php-fpm.sock
listen.owner = www = www
env[PATH] = /usr/local/bin:/usr/bin:/bin
If you want to set another path for the socket file, make sure you 
change it in your NGINX config well. The env[PATH] needs to be set 
to locate the zip utility as ZoneMinder's export functions rely on 
exec(). Sorry, chroot folks. 
PHP throws warning if date.timezone option is not set. The best place 
to do it is to create new ini file in /usr/local/etc/php with overrides
date.timezone = "UTC"
Enable and start php-fpm
sysrc php_fpm_enable="YES"
service php-fpm start
1.5 ZoneMinder constantly keeps the last N frames from its cameras to 
preserve them when alarm occurs. This can be a performance hog if 
placed on spindle drive. The best practice is put it on tmpfs.
See for more 
ZoneMinder will use /tmp for default. If you plan to change it, see 
ZM_PATH_MAP setting.
Mapping /tmp to tmpfs is actually a recommended step under FreeBSD.
Edit /etc/fstab and add the following:
tmpfs			/tmp		tmpfs	rw,nosuid,mode=01777	0	0
The size of temporary files depends on your number of cameras 
number and frames you plan to keep. My 12 3Mbit cameras with 25 
last frames consumes 6 GB.
2. ZoneMinder installation
Connect to MySQL under root and create zm user and populate database.
mysql -u root -p
GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';
mysql -u root -p zm < /usr/local/share/zoneminder/db/zm_create.sql
2.1 If you have chosen to change the ZoneMinder MySQL credentials to something
other than zmuser/zmpass then you must now edit /usr/local/etc/zm.conf. Change
ZM_DB_USER and ZM_DB_PASS to the values you created in the previous step.
Enable and start ZoneMinder
sysrc zoneminder_enable="YES"
service zoneminder start
1. Stop ZoneMinder
service zoneminder stop
2. Upgrade database
sudo -u www
3. Start ZoneMinder
service zoneminder start


Package Version Architecture Repository
zoneminder-h264-1.30.20170222_7.txz 1.30.20170222 amd64 FreeBSD Ports Quarterly
zoneminder-h264-1.30.20170222_7.txz 1.30.20170222 i386 FreeBSD Ports Latest
zoneminder-h264-1.30.20170222_7.txz 1.30.20170222 amd64 FreeBSD Ports Latest
zoneminder-h264 - - -


Name Value
ffmpeg = 4.0.2_4,1
gettext-runtime =
jpeg-turbo = 2.0.0 - - - - - - - -
libx264 = 0.155.2917 -
mp4v2 = 1.9.1_3
mysql56-client = 5.6.41
p5-DBD-mysql = 4.048
p5-DBI = 1.641
p5-Data-Dump = 1.23_1
p5-Data-UUID = 1.221
p5-Date-Manip = 6.73
p5-Device-SerialPort = 1.040000_2
p5-IO-Socket-Multicast = 1.12_2
p5-LWP-Protocol-https = 6.07_1
p5-MIME-Tools = 5.509,2
p5-SOAP-WSDL = 3.003
p5-Sys-CPU = 0.61
p5-Sys-MemInfo = 0.99
p5-Sys-Mmap = 0.19
p5-Test-LWP-UserAgent = 0.030
perl5 = 5.26.2
php71 = 7.1.22
php71-ctype = 7.1.22
php71-gd = 7.1.22
php71-json = 7.1.22
php71-pdo_mysql = 7.1.22
php71-session = 7.1.22
php71-sockets = 7.1.22
sudo = 1.8.25p1
zip = 3.0_1


Type URL
Binary Package zoneminder-h264-1.30.20170222_7.txz
Source Package multimedia/zoneminder-h264

Install Howto

Install zoneminder-h264 txz package:

# pkg install zoneminder-h264

See Also

Package Description
zonenotify-0.1_1.txz DNS notify sender written in C
zoo-2.10.1_3.txz Manipulate archives of files in compressed form
zookeeper-3.4.12.txz Coordination Service for Distributed Applications
zoom-1.1.5_3.txz Z-Interpreter for X with full V6 support
zope213-2.13.24_1.txz Object-based web application platform Version 2.13
zopfli-1.0.2.txz Zopfli Compression Algorithm
zorba-2.7.0_22.txz General purpose C++ XQuery processor
zorro-1.1.8_3.txz Simple to-do list manager
zphoto-1.2_14.txz Zooming photo album generator
zpu-binutils-1.0.txz ZPU toolchain
zpu-gcc-1.0.txz ZPU gcc compiler
zrepl-0.0.3.txz ZFS dataset replication tool
zsd-0.0.2014.12.07.txz Destroys ZFS snapshots
zsh-5.6.2.txz The Z shell
zsh-antigen-2.2.3.txz Tool for managing Zshell plugins inspired by Vundle