A Working ZoneMinder Pi Install With PiCam and Creative Optia Webcam in 10 Mins!

Another attempt at ZM on my original white Pi was almost painless! Getting the PiCam and Optia working was easy.

Looks like my last 5 days of solid research has finally paid off. Boy, did I go down some long, unnecessary paths before – but again – I learned a ton of stuff I would not have, just by following a How To like I've done below.

apt-get install zoneminder v4l-utils

ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zm.conf

adduser www-data video

a2enmod cgi

PiCam – Add the v4l2 camera driver to /etc/modules so it loads at boot, then reboot:

echo "bcm2835-v4l2" >> /etc/modules


Check its loaded the v4l2 driver module:

lsmod | grep v4l2

v4l2-ctl -d /dev/video0 –list-formats


v4l2-ctl -d /dev/video1 –list-formats


root@PiBlanc:~# v4l2-ctl -d /dev/video0 –list-framesizes=YUYV


Size: Stepwise 16×16 – 2592×1944 with step 2/2


root@PiBlanc:~# v4l2-ctl -d /dev/video1 –list-framesizes=YUYV


Size: Discrete 640×480

Size: Discrete 320×240

Size: Discrete 160×120

Size: Discrete 352×288

Size: Discrete 176×144

vi /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>

ServerAdmin webmaster@localhost

DocumentRoot /usr/share/zoneminder

<Directory />

Options FollowSymLinks

AllowOverride All


<Directory /usr/share/zoneminder>

Options Indexes FollowSymLinks MultiViews

AllowOverride All

Order allow,deny

allow from all


ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

<Directory "/usr/lib/cgi-bin">

AllowOverride All

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Order allow,deny

Allow from all


ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined


Remove stale sockets and check ownership is www-data (who is in the video group anyway):

ls -als /tmp/zm/
total 8
4 drwx—— 2 www-data www-data 4096 Aug 9 14:10 .
4 drwxrwxrwt 7 root root 4096 Aug 9 14:09 ..

rm -vr /tmp/zm/zmdc.sock

service apache2 stop

service zoneminder start

service apache2 start

Don't use Chrome (except in Mint) or IE browsers. I used KMeleon. Firefox should work.


Add new Monitor1 for the Picam:

NOTE the DEVICE PATH!!! /dev/video needs the 0 and 1 added for each camera.

Depending on your camera model, start conservatively with low fps (say 10), small screen size and grey – unless you know your cam formats for sure from the tests above, and the option exists (e.g. YUYV), before experimenting.


If the Source link stays red there will be no comms so no image.

The Optia uses:

Now get colour on the Picam too:

Note the colour differences between camera types:

Later, changing the fps on the Optia to 15, the Pi crashed permanently on me, so I had to pull the plug.

Go easy on your settings.

Try larger frame sizes first – double to start e.g. from 320 x 240 to 640 x 480, before FPS increases.

Another major point to note is keeping settings uniform between devices if possible, as on a reboot the cameras swapped places in the /dev/video0/1 IDs.

Seems the USB BUS get read first over the PiCam BUS – whatever type it is…?

Also the cameras real time starts to lag badly – now 60 secs behind real time for an uptime of about 15 mins.

The clock times are different in the caption by 10 secs! Surely they should be reading the same Pi clock source?

Maybe that's a function of processing lag too…

I changed the bandwidth to high for my 100MB home network and the clock captions reset equally and the action lag is now about 1 second behind real time waving a hand in front. Much better!

Next major brainache…moving from monitoring to recording…