<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Asker</id>
	<title>ZoneMinder Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Asker"/>
	<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/Special:Contributions/Asker"/>
	<updated>2026-05-03T15:24:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Modifying_ZoneMinder_to_remember_run_state_names&amp;diff=15957</id>
		<title>Modifying ZoneMinder to remember run state names</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Modifying_ZoneMinder_to_remember_run_state_names&amp;diff=15957"/>
		<updated>2020-02-27T21:19:24Z</updated>

		<summary type="html">&lt;p&gt;Asker: Replaced content with &amp;quot;&amp;lt;Home  =Deprecated = As of ZoneMinder 1.28.107, this hack is no longer needed. Zon...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
=Deprecated =&lt;br /&gt;
As of ZoneMinder 1.28.107, this hack is no longer needed.&lt;br /&gt;
ZoneMinder now supports the ability to support remembering and restoring run states &lt;br /&gt;
See https://zoneminder.readthedocs.io/en/latest/userguide/gettingstarted.html and search for &amp;quot;run state&amp;quot; in that page&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15603</id>
		<title>Standalone Zm Frontends</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15603"/>
		<updated>2019-06-30T12:52:37Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Front Ends ==&lt;br /&gt;
&lt;br /&gt;
====Mobile apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] - open source iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
[https://itunes.apple.com/app/surveillance-pro/id1200773811 Surveillance pro] - closed source iPhone app&lt;br /&gt;
&lt;br /&gt;
====Desktop  apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] -  open source iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Apps that seem to be discontinued/not maintained ====&lt;br /&gt;
&lt;br /&gt;
[http://html5-clouds.com/?q=node/55 zmView/zmViewPro] zmView]&lt;br /&gt;
&lt;br /&gt;
[[ZM4MS]]&amp;lt;br&amp;gt; - Complete Windows GUI frontend for ZM (requires ZM!) (Please feel free to add to this anyone![James])&lt;br /&gt;
&lt;br /&gt;
[[zm4ms playback|ZM4MS playback with Mandriva 2006 livecd]]&lt;br /&gt;
&lt;br /&gt;
[[xlib_shm]] - allows you to view live streams from zm on local machine with low cpu usage&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/zmviewer ZMviewer] -  a cross platform Linux/Win/Mac/*nix  client written in Qt(beta)&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/jzmconsole/ JZMconsole] - Java Swing front end for Zoneminder(beata)&lt;br /&gt;
&lt;br /&gt;
[http://www.zoneminder.com/forums/viewtopic.php?t=13396 Blackberry App]&lt;br /&gt;
&lt;br /&gt;
[http://www.eyezm.com eyeZm] - Native iPhone / iPod touch front-end to view and control ZoneMinder (also see: http://www.zoneminder.com/forums/viewtopic.php?t=16695)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ZM skins for mobile ===&lt;br /&gt;
&lt;br /&gt;
Earlier versions of ZM (1.25/1.26) supported XHTML and mobile skins which you could enable via ?skin=xml and ?skin=mobile&lt;br /&gt;
They were meant for application developers to extract information for their apps and run ZM on mobile devices. These skins are no longer maintained&lt;br /&gt;
and instead ZM has a [[http://zoneminder.readthedocs.org/en/latest/api.html REST based API ]] to replace the functionality.&lt;br /&gt;
&lt;br /&gt;
As far as mobile skins are concerned, ZM will likely discontinue support for skin=mobile after 1.29. Mobile users can either use one of the front ends above or use the standard web interface of ZM from a mobile device.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15602</id>
		<title>Standalone Zm Frontends</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15602"/>
		<updated>2019-06-30T12:51:56Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Front Ends ==&lt;br /&gt;
&lt;br /&gt;
====Mobile apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] - open source iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
[https://itunes.apple.com/app/surveillance-pro/id1200773811 Surveillance pro] - closed source iPhone app&lt;br /&gt;
&lt;br /&gt;
====Desktop  apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] -  open source iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====These apps don&amp;#039;t seem to be maintained and will likely not work with new ZM versions =====&lt;br /&gt;
&lt;br /&gt;
[http://html5-clouds.com/?q=node/55 zmView/zmViewPro] zmView]&lt;br /&gt;
&lt;br /&gt;
[[ZM4MS]]&amp;lt;br&amp;gt; - Complete Windows GUI frontend for ZM (requires ZM!) (Please feel free to add to this anyone![James])&lt;br /&gt;
&lt;br /&gt;
[[zm4ms playback|ZM4MS playback with Mandriva 2006 livecd]]&lt;br /&gt;
&lt;br /&gt;
[[xlib_shm]] - allows you to view live streams from zm on local machine with low cpu usage&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/zmviewer ZMviewer] -  a cross platform Linux/Win/Mac/*nix  client written in Qt(beta)&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/jzmconsole/ JZMconsole] - Java Swing front end for Zoneminder(beata)&lt;br /&gt;
&lt;br /&gt;
[http://www.zoneminder.com/forums/viewtopic.php?t=13396 Blackberry App]&lt;br /&gt;
&lt;br /&gt;
[http://www.eyezm.com eyeZm] - Native iPhone / iPod touch front-end to view and control ZoneMinder (also see: http://www.zoneminder.com/forums/viewtopic.php?t=16695)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ZM skins for mobile ===&lt;br /&gt;
&lt;br /&gt;
Earlier versions of ZM (1.25/1.26) supported XHTML and mobile skins which you could enable via ?skin=xml and ?skin=mobile&lt;br /&gt;
They were meant for application developers to extract information for their apps and run ZM on mobile devices. These skins are no longer maintained&lt;br /&gt;
and instead ZM has a [[http://zoneminder.readthedocs.org/en/latest/api.html REST based API ]] to replace the functionality.&lt;br /&gt;
&lt;br /&gt;
As far as mobile skins are concerned, ZM will likely discontinue support for skin=mobile after 1.29. Mobile users can either use one of the front ends above or use the standard web interface of ZM from a mobile device.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15601</id>
		<title>Standalone Zm Frontends</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15601"/>
		<updated>2019-06-30T12:49:10Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Front Ends ==&lt;br /&gt;
&lt;br /&gt;
====Mobile apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] - iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Desktop  apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] - iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====These apps don&amp;#039;t seem to be maintained and will likely not work with new ZM versions =====&lt;br /&gt;
&lt;br /&gt;
[http://html5-clouds.com/?q=node/55 zmView/zmViewPro] zmView]&lt;br /&gt;
[[ZM4MS]]&amp;lt;br&amp;gt; - Complete Windows GUI frontend for ZM (requires ZM!) (Please feel free to add to this anyone![James])&lt;br /&gt;
&lt;br /&gt;
[[zm4ms playback|ZM4MS playback with Mandriva 2006 livecd]]&lt;br /&gt;
&lt;br /&gt;
[[xlib_shm]] - allows you to view live streams from zm on local machine with low cpu usage&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/zmviewer ZMviewer] -  a cross platform Linux/Win/Mac/*nix  client written in Qt(beta)&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/jzmconsole/ JZMconsole] - Java Swing front end for Zoneminder(beata)&lt;br /&gt;
&lt;br /&gt;
[http://www.zoneminder.com/forums/viewtopic.php?t=13396 Blackberry App]&lt;br /&gt;
&lt;br /&gt;
[http://www.eyezm.com eyeZm] - Native iPhone / iPod touch front-end to view and control ZoneMinder (also see: http://www.zoneminder.com/forums/viewtopic.php?t=16695)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ZM skins for mobile ===&lt;br /&gt;
&lt;br /&gt;
Earlier versions of ZM (1.25/1.26) supported XHTML and mobile skins which you could enable via ?skin=xml and ?skin=mobile&lt;br /&gt;
They were meant for application developers to extract information for their apps and run ZM on mobile devices. These skins are no longer maintained&lt;br /&gt;
and instead ZM has a [[http://zoneminder.readthedocs.org/en/latest/api.html REST based API ]] to replace the functionality.&lt;br /&gt;
&lt;br /&gt;
As far as mobile skins are concerned, ZM will likely discontinue support for skin=mobile after 1.29. Mobile users can either use one of the front ends above or use the standard web interface of ZM from a mobile device.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15600</id>
		<title>Standalone Zm Frontends</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Standalone_Zm_Frontends&amp;diff=15600"/>
		<updated>2019-06-30T12:47:56Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Mobile apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Front Ends ==&lt;br /&gt;
&lt;br /&gt;
====Mobile apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] - iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
&amp;lt;s&amp;gt;[http://html5-clouds.com/?q=node/55 zmView/zmViewPro] (uses xml skin, may not work when ZM deprecates xml skin - planned after 1.29 release]&amp;lt;/s&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Desktop  apps====&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja ZmNinja] - iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====These apps don&amp;#039;t seem to be maintained and will likely not work with new ZM versions =====&lt;br /&gt;
[[ZM4MS]]&amp;lt;br&amp;gt; - Complete Windows GUI frontend for ZM (requires ZM!) (Please feel free to add to this anyone![James])&lt;br /&gt;
&lt;br /&gt;
[[zm4ms playback|ZM4MS playback with Mandriva 2006 livecd]]&lt;br /&gt;
&lt;br /&gt;
[[xlib_shm]] - allows you to view live streams from zm on local machine with low cpu usage&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/zmviewer ZMviewer] -  a cross platform Linux/Win/Mac/*nix  client written in Qt(beta)&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/jzmconsole/ JZMconsole] - Java Swing front end for Zoneminder(beata)&lt;br /&gt;
&lt;br /&gt;
[http://www.zoneminder.com/forums/viewtopic.php?t=13396 Blackberry App]&lt;br /&gt;
&lt;br /&gt;
[http://www.eyezm.com eyeZm] - Native iPhone / iPod touch front-end to view and control ZoneMinder (also see: http://www.zoneminder.com/forums/viewtopic.php?t=16695)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== ZM skins for mobile ===&lt;br /&gt;
&lt;br /&gt;
Earlier versions of ZM (1.25/1.26) supported XHTML and mobile skins which you could enable via ?skin=xml and ?skin=mobile&lt;br /&gt;
They were meant for application developers to extract information for their apps and run ZM on mobile devices. These skins are no longer maintained&lt;br /&gt;
and instead ZM has a [[http://zoneminder.readthedocs.org/en/latest/api.html REST based API ]] to replace the functionality.&lt;br /&gt;
&lt;br /&gt;
As far as mobile skins are concerned, ZM will likely discontinue support for skin=mobile after 1.29. Mobile users can either use one of the front ends above or use the standard web interface of ZM from a mobile device.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Doing_your_best_to_get_rid_of_smudging_in_FFMPEG_transcoding_of_RTSP_streams&amp;diff=15599</id>
		<title>Doing your best to get rid of smudging in FFMPEG transcoding of RTSP streams</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Doing_your_best_to_get_rid_of_smudging_in_FFMPEG_transcoding_of_RTSP_streams&amp;diff=15599"/>
		<updated>2019-06-30T12:45:42Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Deprecation Notice ===&lt;br /&gt;
&lt;br /&gt;
* A lot of things have changed&lt;br /&gt;
* As of 2019, don&amp;#039;t use Remote, use FFMPEG&lt;br /&gt;
* Don&amp;#039;t put in any values for Max FPS and Alarm Max FPS - keep it empty. This always causes problems. Change the FPS settings inside the camera UI (not in ZM)&lt;br /&gt;
* Use &amp;quot;TCP&amp;quot; as a method inside FFMPEG, that usually takes care of smearing&lt;br /&gt;
&lt;br /&gt;
Most of the other tips/etc may no longer be valid&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
All my cameras are Foscam HD cameras (1280x960) and support RTSP. Further , 4 out of my 5 cameras are connected via WiFi. &lt;br /&gt;
Zone minder has many options to capture frames, but for Foscam cameras it boils down to:&lt;br /&gt;
* Using the Foscam &amp;quot;snapshot2&amp;quot; URL to capture images instead of live streaming&lt;br /&gt;
* Using RTSP URL &lt;br /&gt;
* Using MJPEG URL (needs a configuration change to Foscam)&lt;br /&gt;
&lt;br /&gt;
I investigated all 3 options. &lt;br /&gt;
* In terms of quality, Option 1 (image snapshot) is the best. No artifacts, no smudging nothing. The downside is there are a high amount of connection drops, even if I dropped the HD stream to 720p.&lt;br /&gt;
* Foscam seems to only stream MJPEG as 640x480. That was not acceptable (and the quality of the stream seemed to have a lot of artifacting)&lt;br /&gt;
* So really, the only option left was RTSP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===RTSP via FFMPEG/VLC/Remote ===&lt;br /&gt;
&lt;br /&gt;
Now that RTSP was the only viable option, there are 3 methods you can use (well, maybe 4, not sure if Curl supports RTSP - never tried)&lt;br /&gt;
* You can use source type as FFMPEG, VLC or (a new addition with ZM 1.28) Remote&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Source Type: Remote====&lt;br /&gt;
&lt;br /&gt;
Based on [https://github.com/ZoneMinder/ZoneMinder/issues/734 this] issue in github, knnniggett writes that starting ZM 1.28, they have built in their own RTSP handler that does not rely on FFMPEG.&lt;br /&gt;
This option may or may not work. For you. It works well for me -no smudging. But if this mode does not work for you, read on&lt;br /&gt;
&lt;br /&gt;
====Source Type: libVLC====&lt;br /&gt;
&lt;br /&gt;
VLC is supposed to be a drop in replacement for FFMPEG. It works, but here is the rub:&lt;br /&gt;
* With 5 cameras capturing HD streams, using FFMPEG, my CPU consumption always hovered between 12% - 30%&lt;br /&gt;
* The moment I changed ONE camera to VLC, my CPU consumption shot up to 67% and stayed there&lt;br /&gt;
* The moment I changed TWO cameras to VLC, I&amp;#039;d hit 97% and then I&amp;#039;d start getting spurts of green screens and other errors&lt;br /&gt;
&lt;br /&gt;
So obviously, VLC was a fail for me.&lt;br /&gt;
&lt;br /&gt;
====Source Type: FFMPEG====&lt;br /&gt;
&lt;br /&gt;
FFMPEG worked, but:&lt;br /&gt;
* I noticed a lot of smearing and smudging while FFMPEG transcoded RTSP to images. The smearing would be random and quite frequent. The problem was that this made ZM think there were large changes in frames and it would trigger all sorts of alarms&lt;br /&gt;
&lt;br /&gt;
This is what I mean by smearing:&lt;br /&gt;
&lt;br /&gt;
[[File:Smearing_example.jpeg]]&lt;br /&gt;
&lt;br /&gt;
===Strategies to solve smearing===&lt;br /&gt;
(credit: PacoLM, source: http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23031)&lt;br /&gt;
&lt;br /&gt;
So there are a few aspects to addressing this problem, based on various other threads I read, and advice from forum members:&lt;br /&gt;
* Make sure RTSP is streaming over TCP not UDP (for whatever reason, there are high packet losses over UDP with Foscam, even within a LAN)&lt;br /&gt;
* Make sure you reduce frame rate of the camera directly inside the camera (via its web interface)&lt;br /&gt;
* Make sure you send key frame rates more frequently (RTSP reduces bandwidth by sending differential image data. Once it a while it sends &amp;quot;key frames&amp;quot; which is the full frame from the camera to resync)&lt;br /&gt;
* &amp;lt;del&amp;gt;Don&amp;#039;t mess with FPS inside ZM. Set what you need inside the camera. Apparently, &amp;lt;/del&amp;gt; Based on testing done by PacoLM, changing FPS at ZM and having the camera send a different FPS causes problems, so:&lt;br /&gt;
* For each camera, I cleared FPS and Alarm FPS inside ZM. &amp;lt;del&amp;gt;Kept them blank&amp;lt;/del&amp;gt;. Inside ZM put in an FPS that is greater than the frame rate of the camera. This is important. You don&amp;#039;t want ZM to reduce FPS - it causes issues. Instead reduce at camera. The reason I recommend you put in a higher FPS Max in ZM is because when the camera goes offline, ZM takes up max CPU trying to keep connecting to the camera and Max FPS helps curtail this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets take them up one by one:&lt;br /&gt;
&lt;br /&gt;
====RTSP streaming over TCP====&lt;br /&gt;
&lt;br /&gt;
Based on threads I read over at Foscam forums, there is no way to &amp;quot;tell&amp;quot; foscam to stream over TCP if UDP is also available. There are various strategies to work around it, but before you try the various options, &lt;br /&gt;
if you set remote method as &amp;quot;RTSP/RTP&amp;quot; in ZoneMinder, ZM forces a TCP connection. You can validate this by checking with netstat while you are streaming. So chances are if you are using this mode, you are already enforcing TCP&lt;br /&gt;
(Note: other mechanisms like routing the source host via you external public IP and setting port forwarding to TCP is unnecessary as I said above, ZM is enforcing TCP. Also adding &amp;quot;?tcp&amp;quot; to the URL caused complete havoc in my system - ZM hung up, DB stopped working due to too many connections)&lt;br /&gt;
&lt;br /&gt;
====Reducing Frame Rate &amp;amp; increasing Key frames in-camera====&lt;br /&gt;
I directly accessed my camera admin web interface, and reduced FPS to 3 and key frame rate interval to 10, Frankly, for the purpose of capturing motion alarms, I think an FPS of 1,2,3 are perfectly fine&lt;br /&gt;
&lt;br /&gt;
==== Not messing with FPS inside ZM ====&lt;br /&gt;
For each camera, I cleared FPS and Alarm FPS inside ZM. &amp;lt;del&amp;gt;Kept them blank&amp;lt;/del&amp;gt;. Inside ZM put in an FPS that is greater than the frame rate of the camera. This is important. You don&amp;#039;t want ZM to reduce FPS - it causes issues. Instead reduce at camera. The reason I recommend you put in a higher FPS Max in ZM is because when the camera goes offline, ZM takes up max CPU trying to keep connecting to the camera and Max FPS helps curtail this.&lt;br /&gt;
&lt;br /&gt;
===Outcome===&lt;br /&gt;
I was at a stage where I was getting smearing once every few minutes. I now reached a stage where I was getting a few smears maybe once in a few hours. BIG IMPROVEMENT&lt;br /&gt;
&lt;br /&gt;
===Further tuning===&lt;br /&gt;
To eliminate the spurious alarms generated by the occasional smear, I changed Misc-&amp;gt;Alarm Frame count -  I put in a minimum number of frames that ZM will count for alarms before actually raising an alarm. I analyzed my alarm stats and noticed that whenever smearing happens, it lasts for a max of 2 frames. So I put in a minimum alarm frame count as 3. This completely eliminated false events due to smearing. Obviously, this value may change based on your in-camera FPS. (credit: user kkroft suggested I use this feature to not record events on Signal loss [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23036 here], which I thought I could apply for the occasional smear too)&lt;br /&gt;
&lt;br /&gt;
Finally, as of April 2015, I stopped using FFMPEG and switched to native RTSP (only av. in 1.28). If it works, it does not smudge at all. But it may not work for you - it seems temperamental; in which case the tips suggested above may help you with FFMPEG&lt;br /&gt;
&lt;br /&gt;
Best of luck!&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Doing_your_best_to_get_rid_of_smudging_in_FFMPEG_transcoding_of_RTSP_streams&amp;diff=15598</id>
		<title>Doing your best to get rid of smudging in FFMPEG transcoding of RTSP streams</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Doing_your_best_to_get_rid_of_smudging_in_FFMPEG_transcoding_of_RTSP_streams&amp;diff=15598"/>
		<updated>2019-06-30T12:45:27Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Deprecation Notice ===&lt;br /&gt;
&lt;br /&gt;
* A lot of things have changed&lt;br /&gt;
* As of 2019, don&amp;#039;t use Remote, use FFMPEG&lt;br /&gt;
* Don&amp;#039;t put in any values for Max FPS and Alarm Max FPS - keep it empty. This always causes problems. Change the FPS settings inside the camera UI (not in ZM)&lt;br /&gt;
* Use &amp;quot;TCP&amp;quot; as a method inside FFMPEG, that usually takes care of smearing&lt;br /&gt;
&lt;br /&gt;
Most of the other tips/etc may no longer be valid&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
All my cameras are Foscam HD cameras (1280x960) and support RTSP. Further , 4 out of my 5 cameras are connected via WiFi. &lt;br /&gt;
Zone minder has many options to capture frames, but for Foscam cameras it boils down to:&lt;br /&gt;
* Using the Foscam &amp;quot;snapshot2&amp;quot; URL to capture images instead of live streaming&lt;br /&gt;
* Using RTSP URL &lt;br /&gt;
* Using MJPEG URL (needs a configuration change to Foscam)&lt;br /&gt;
&lt;br /&gt;
I investigated all 3 options. &lt;br /&gt;
* In terms of quality, Option 1 (image snapshot) is the best. No artifacts, no smudging nothing. The downside is there are a high amount of connection drops, even if I dropped the HD stream to 720p.&lt;br /&gt;
* Foscam seems to only stream MJPEG as 640x480. That was not acceptable (and the quality of the stream seemed to have a lot of artifacting)&lt;br /&gt;
* So really, the only option left was RTSP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===RTSP via FFMPEG/VLC/Remote ===&lt;br /&gt;
&lt;br /&gt;
Now that RTSP was the only viable option, there are 3 methods you can use (well, maybe 4, not sure if Curl supports RTSP - never tried)&lt;br /&gt;
* You can use source type as FFMPEG, VLC or (a new addition with ZM 1.28) Remote&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Source Type: Remote====&lt;br /&gt;
&lt;br /&gt;
Based on [https://github.com/ZoneMinder/ZoneMinder/issues/734 this] issue in github, knnniggett writes that starting ZM 1.28, they have built in their own RTSP handler that does not rely on FFMPEG.&lt;br /&gt;
This option may or may not work. For you. It works well for me -no smudging. But if this mode does not work for you, read on&lt;br /&gt;
&lt;br /&gt;
====Source Type: libVLC====&lt;br /&gt;
&lt;br /&gt;
VLC is supposed to be a drop in replacement for FFMPEG. It works, but here is the rub:&lt;br /&gt;
* With 5 cameras capturing HD streams, using FFMPEG, my CPU consumption always hovered between 12% - 30%&lt;br /&gt;
* The moment I changed ONE camera to VLC, my CPU consumption shot up to 67% and stayed there&lt;br /&gt;
* The moment I changed TWO cameras to VLC, I&amp;#039;d hit 97% and then I&amp;#039;d start getting spurts of green screens and other errors&lt;br /&gt;
&lt;br /&gt;
So obviously, VLC was a fail for me.&lt;br /&gt;
&lt;br /&gt;
====Source Type: FFMPEG====&lt;br /&gt;
&lt;br /&gt;
FFMPEG worked, but:&lt;br /&gt;
* I noticed a lot of smearing and smudging while FFMPEG transcoded RTSP to images. The smearing would be random and quite frequent. The problem was that this made ZM think there were large changes in frames and it would trigger all sorts of alarms&lt;br /&gt;
&lt;br /&gt;
This is what I mean by smearing:&lt;br /&gt;
&lt;br /&gt;
[[File:Smearing_example.jpeg]]&lt;br /&gt;
&lt;br /&gt;
===Strategies to solve smearing===&lt;br /&gt;
(credit: PacoLM, source: http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23031)&lt;br /&gt;
&lt;br /&gt;
So there are a few aspects to addressing this problem, based on various other threads I read, and advice from forum members:&lt;br /&gt;
* Make sure RTSP is streaming over TCP not UDP (for whatever reason, there are high packet losses over UDP with Foscam, even within a LAN)&lt;br /&gt;
* Make sure you reduce frame rate of the camera directly inside the camera (via its web interface)&lt;br /&gt;
* Make sure you send key frame rates more frequently (RTSP reduces bandwidth by sending differential image data. Once it a while it sends &amp;quot;key frames&amp;quot; which is the full frame from the camera to resync)&lt;br /&gt;
* &amp;lt;del&amp;gt;Don&amp;#039;t mess with FPS inside ZM. Set what you need inside the camera. Apparently, &amp;lt;/del&amp;gt; Based on testing done by PacoLM, changing FPS at ZM and having the camera send a different FPS causes problems, so:&lt;br /&gt;
* For each camera, I cleared FPS and Alarm FPS inside ZM. &amp;lt;del&amp;gt;Kept them blank&amp;lt;/del&amp;gt;. Inside ZM put in an FPS that is greater than the frame rate of the camera. This is important. You don&amp;#039;t want ZM to reduce FPS - it causes issues. Instead reduce at camera. The reason I recommend you put in a higher FPS Max in ZM is because when the camera goes offline, ZM takes up max CPU trying to keep connecting to the camera and Max FPS helps curtail this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets take them up one by one:&lt;br /&gt;
&lt;br /&gt;
====RTSP streaming over TCP====&lt;br /&gt;
&lt;br /&gt;
Based on threads I read over at Foscam forums, there is no way to &amp;quot;tell&amp;quot; foscam to stream over TCP if UDP is also available. There are various strategies to work around it, but before you try the various options, &lt;br /&gt;
if you set remote method as &amp;quot;RTSP/RTP&amp;quot; in ZoneMinder, ZM forces a TCP connection. You can validate this by checking with netstat while you are streaming. So chances are if you are using this mode, you are already enforcing TCP&lt;br /&gt;
(Note: other mechanisms like routing the source host via you external public IP and setting port forwarding to TCP is unnecessary as I said above, ZM is enforcing TCP. Also adding &amp;quot;?tcp&amp;quot; to the URL caused complete havoc in my system - ZM hung up, DB stopped working due to too many connections)&lt;br /&gt;
&lt;br /&gt;
====Reducing Frame Rate &amp;amp; increasing Key frames in-camera====&lt;br /&gt;
I directly accessed my camera admin web interface, and reduced FPS to 3 and key frame rate interval to 10, Frankly, for the purpose of capturing motion alarms, I think an FPS of 1,2,3 are perfectly fine&lt;br /&gt;
&lt;br /&gt;
==== Not messing with FPS inside ZM ====&lt;br /&gt;
For each camera, I cleared FPS and Alarm FPS inside ZM. &amp;lt;del&amp;gt;Kept them blank&amp;lt;/del&amp;gt;. Inside ZM put in an FPS that is greater than the frame rate of the camera. This is important. You don&amp;#039;t want ZM to reduce FPS - it causes issues. Instead reduce at camera. The reason I recommend you put in a higher FPS Max in ZM is because when the camera goes offline, ZM takes up max CPU trying to keep connecting to the camera and Max FPS helps curtail this.&lt;br /&gt;
&lt;br /&gt;
===Outcome===&lt;br /&gt;
I was at a stage where I was getting smearing once every few minutes. I now reached a stage where I was getting a few smears maybe once in a few hours. BIG IMPROVEMENT&lt;br /&gt;
&lt;br /&gt;
===Further tuning===&lt;br /&gt;
To eliminate the spurious alarms generated by the occasional smear, I changed Misc-&amp;gt;Alarm Frame count -  I put in a minimum number of frames that ZM will count for alarms before actually raising an alarm. I analyzed my alarm stats and noticed that whenever smearing happens, it lasts for a max of 2 frames. So I put in a minimum alarm frame count as 3. This completely eliminated false events due to smearing. Obviously, this value may change based on your in-camera FPS. (credit: user kkroft suggested I use this feature to not record events on Signal loss [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23036 here], which I thought I could apply for the occasional smear too)&lt;br /&gt;
&lt;br /&gt;
Finally, as of April 2015, I stopped using FFMPEG and switched to native RTSP (only av. in 1.28). If it works, it does not smudge at all. But it may not work for you - it seems temperamental; in which case the tips suggested above may help you with FFMPEG&lt;br /&gt;
&lt;br /&gt;
Best of luck!&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15597</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15597"/>
		<updated>2019-06-30T12:41:18Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a flexible (albeit hard to easily configure) zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
===Real object detection===&lt;br /&gt;
People often ask if ZM supports &amp;quot;object detection&amp;quot;. The &amp;#039;&amp;#039;core&amp;#039;&amp;#039; ZM engine only detects change in pixels (motion), which is what this article is about. That being said,  incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]. Note that object detection works &amp;#039;&amp;#039;after&amp;#039;&amp;#039; ZM detects motion  change, so this article applies either way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here.&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Got the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To some, the latter makes much more sense. However, if you really want more fine grained control, you should use pixels. I used percent when I first started off, but then realized that pixels was more powerful when you are trying to eliminate false alarms.&lt;br /&gt;
&lt;br /&gt;
(Pixels are especially useful if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Selecting the right values====&lt;br /&gt;
&lt;br /&gt;
=====Using percents=====&lt;br /&gt;
(As of 2019, I recommend pixels, but I&amp;#039;ve kept this here for those who prefer percents)&lt;br /&gt;
&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* One of the advantages of using percents is that if you were to change your zone size, the percent settings will likely remain consistent (as they will be percentages of your zone area). In pixel mode, any change to the zone polygon will require updating the other values&lt;br /&gt;
&lt;br /&gt;
* This is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like, using percents:&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Using pixels=====&lt;br /&gt;
(This is what I ended up using once I got comfortable with zones)&lt;br /&gt;
* This was updated Jun 2019, I don&amp;#039;t have that basement camera any more, so I am going to use a different image&lt;br /&gt;
* I usually start with a Min/Max pixel threshold of 35 (that is, consider pixels alarmed only if the color different between the old pixel and the new one is 35 or more)&lt;br /&gt;
* For the min/max alarmed area, I draw a box inside my zone that represents an object size I think is appropriate. In the image below, I am trying to estimate what the size of a person would be in the zone. I use a mac - I simply hit Cmd+Shift+4 - that brings up a screen capture cross hair and as I draw the box, I see its width and height. Once I have a box with the dimension that I think is appropriate, I hit escape and simply fill in Min/Max Area = W*H of that box I used as a visual tool (the image shows a green box, just as a representation). In this case, my box was 42X67 pixels, so I fill in a min area of 2800&lt;br /&gt;
* You should also look at filling in a &amp;quot;max&amp;quot; area - this is to avoid sudden &amp;quot;blast of light changes&amp;quot; that raise an alarm. For example, if most of my zone pixels changed, it is unlikely its an object of interest. It is more likely the sun just blasted light on my driveway or a big shadow situation occurred. ZM helpfully tells you your zone area- in this case 92271. You could choose to put in a pixel value that is some large fraction of this value (maybe 90% of it = 83,000 or simply draw another rectangle to represent the largest object that is of interest to you and use that area value)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip: Don&amp;#039;t try to get super precise in your first round: Use less aggressive values to begin with - that is, lesser area values. Keep increasing and testing till you reach a good threshold between bogus detections and real detections. Pixel based detections have a limit.&amp;#039;&amp;#039;&amp;#039; You&amp;#039;ll never get it perfect. For real object detection as an &amp;#039;add-on&amp;#039; to motion, look at [https://github.com/pliablepixels/zmeventnotification zmeventnotification], the machine learning based alarm detection extension to ZM&lt;br /&gt;
&lt;br /&gt;
[[File:pixel_area.jpg|800px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Note 1:  the image is not to scale, so measurements will not tally if you are trying to draw boxes around the example image above)&lt;br /&gt;
* (Note 2: when you are measuring sizes, make sure you have not reduced browser scale. If you did, obviously, your pixel markings will be wrong because the image will be scaled)&lt;br /&gt;
* I then think about what might be the area inside that rectangle I drew that will have a continuous change in pixels. My guess here was 9x9 which is what I put into the Filter Pixels&lt;br /&gt;
* Finally, since I put a value of 2800 in the alarmed pixel area, obviously Min Alarmed Area &amp;gt; Min Filtered Area &amp;gt; Min Blob Area. So I set Min Filtered Area to around 35% of 2800 = 1000 and blob area to around 90% of filtered area (approx 900), the reason being in my estimate blob area should closely match filtered area of contiguous pixels for humans. This is my guess *shrug*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(While the example below refers to percents, the same logic applies to pixels)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do:&lt;br /&gt;
* Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
* As I wrote earlier, use maximum values in the zone definition to reduce &amp;#039;change bursts&amp;#039; (significant pixel coloration changes due to spikes of light/shadows)&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15596</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15596"/>
		<updated>2019-06-30T12:39:39Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a flexible (albeit hard to easily configure) zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
===Real object detection===&lt;br /&gt;
People often ask if ZM supports &amp;quot;object detection&amp;quot;. The &amp;#039;&amp;#039;core&amp;#039;&amp;#039; ZM engine only detects change in pixels (motion), which is what this article is about. That being said,  incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]. Note that object detection works &amp;#039;&amp;#039;after&amp;#039;&amp;#039; ZM detects motion  change, so this article applies either way.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here.&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Got the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To some, the latter makes much more sense. However, if you really want more fine grained control, you should use pixels. I used percent when I first started off, but then realized that pixels was more powerful when you are trying to eliminate false alarms.&lt;br /&gt;
&lt;br /&gt;
(Pixels are especially useful if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Selecting the right values====&lt;br /&gt;
&lt;br /&gt;
=====Using percents=====&lt;br /&gt;
(As of 2019, I recommend pixels, but I&amp;#039;ve kept this here for those who prefer percents)&lt;br /&gt;
&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* One of the advantages of using percents is that if you were to change your zone size, the percent settings will likely remain consistent (as they will be percentages of your zone area). In pixel mode, any change to the zone polygon will require updating the other values&lt;br /&gt;
&lt;br /&gt;
* This is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like, using percents:&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Using pixels=====&lt;br /&gt;
(This is what I ended up using once I got comfortable with zones)&lt;br /&gt;
* This was updated Jun 2019, I don&amp;#039;t have that basement camera any more, so I am going to use a different image&lt;br /&gt;
* I usually start with a Min/Max pixel threshold of 35 (that is, consider pixels alarmed only if the color different between the old pixel and the new one is 35 or more)&lt;br /&gt;
* For the min/max alarmed area, I draw a box inside my zone that represents an object size I think is appropriate. In the image below, I am trying to estimate what the size of a person would be in the zone. I use a mac - I simply hit Cmd+Shift+4 - that brings up a screen capture cross hair and as I draw the box, I see its width and height. Once I have a box with the dimension that I think is appropriate, I hit escape and simply fill in Min/Max Area = W*H of that box I used as a visual tool (the image shows a green box, just as a representation). In this case, my box was 42X67 pixels, so I fill in a min area of 2800&lt;br /&gt;
* You should also look at filling in a &amp;quot;max&amp;quot; area - this is to avoid sudden &amp;quot;blast of light changes&amp;quot; that raise an alarm. For example, if most of my zone pixels changed, it is unlikely its an object of interest. It is more likely the sun just blasted light on my driveway or a big shadow situation occurred. ZM helpfully tells you your zone area- in this case 92271. You could choose to put in a pixel value that is some large fraction of this value (maybe 90% of it = 83,000 or simply draw another rectangle to represent the largest object that is of interest to you and use that area value)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip: Don&amp;#039;t try to get super precise in your first round: Use less aggressive values to begin with - that is, lesser area values. Keep increasing and testing till you reach a good threshold between bogus detections and real detections. Pixel based detections have a limit. You&amp;#039;ll never get it perfect. For real object detection, look at [https://github.com/pliablepixels/zmeventnotification zmeventnotification], the machine learning based alarm detection extension to ZM&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pixel_area.jpg|800px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Note 1:  the image is not to scale, so measurements will not tally if you are trying to draw boxes around the example image above)&lt;br /&gt;
* (Note 2: when you are measuring sizes, make sure you have not reduced browser scale. If you did, obviously, your pixel markings will be wrong because the image will be scaled)&lt;br /&gt;
* I then think about what might be the area inside that rectangle I drew that will have a continuous change in pixels. My guess here was 9x9 which is what I put into the Filter Pixels&lt;br /&gt;
* Finally, since I put a value of 2800 in the alarmed pixel area, obviously Min Alarmed Area &amp;gt; Min Filtered Area &amp;gt; Min Blob Area. So I set Min Filtered Area to around 35% of 2800 = 1000 and blob area to around 90% of filtered area (approx 900), the reason being in my estimate blob area should closely match filtered area of contiguous pixels for humans. This is my guess *shrug*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(While the example below refers to percents, the same logic applies to pixels)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do:&lt;br /&gt;
* Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
* As I wrote earlier, use maximum values in the zone definition to reduce &amp;#039;change bursts&amp;#039; (significant pixel coloration changes due to spikes of light/shadows)&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15595</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15595"/>
		<updated>2019-06-30T12:30:40Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a powerful zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Updated on Apr 2019===&lt;br /&gt;
&lt;br /&gt;
Incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Yawn. Forget the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To some, the latter makes much more sense. However, if you really want more fine grained control, you should use pixels. I used percent when I first started off, but then realized that pixels was more powerful when you are trying to eliminate false alarms.&lt;br /&gt;
&lt;br /&gt;
(Pixels are especially useful if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Selecting the right values====&lt;br /&gt;
&lt;br /&gt;
=====Using percents=====&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Percent vs. Pixels:&amp;#039;&amp;#039;&amp;#039; Back to my previous point -if you specify alarmed areas in pixels, in addition to being able to visualize better (at least for me) the added advantage is the setting scales as zone sizes changes.  For example the % of space the person takes in my far end &amp;quot;Door&amp;quot; zone is quite similar to the % of space the person takes in my couch area (in other words, both the zone and person have scaled up in size, so relative % is still the same)&lt;br /&gt;
&lt;br /&gt;
* So having said all of this, this is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like:&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Using pixels=====&lt;br /&gt;
(This is what I ended up using once I got comfortable with zones)&lt;br /&gt;
* This was updated Jun 2019, I don&amp;#039;t have that basement camera any more, so I am going to use a different image&lt;br /&gt;
* I usually start with a Min/Max pixel threshold of 35 (that is, consider pixels alarmed only if the color different between the old pixel and the new one is 35 or more)&lt;br /&gt;
* For the min/max alarmed area, I draw a box inside my zone that represents an object size I think is appropriate. In the image below, I am trying to estimate what the size of a person would be in the zone. I use a mac - I simply hit Cmd+Shift+4 - that brings up a screen capture cross hair and as I draw the box, I see its width and height. Once I have a box with the dimension that I think is appropriate, I hit escape and simply fill in Min/Max Area = W*H of that box I used as a visual tool (the image shows a green box, just as a representation). In this case, my box was 42X67 pixels, so I fill in a min area of 2800&lt;br /&gt;
* You should also look at filling in a &amp;quot;max&amp;quot; area - this is to avoid sudden &amp;quot;blast of light changes&amp;quot; that raise an alarm. For example, if most of my zone pixels changed, it is unlikely its an object of interest. It is more likely the sun just blasted light on my driveway or a big shadow situation occurred. ZM helpfully tells you your zone area- in this case 92271. You could choose to put in a pixel value that is some large fraction of this value (maybe 90% of it = 83,000 or simply draw another rectangle to represent the largest object that is of interest to you and use that area value)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip: Don&amp;#039;t try to get super precise in your first round: Use less aggressive values to begin with - that is, lesser area values. Keep increasing and testing till you reach a good threshold between bogus detections and real detections. Pixel based detections have a limit. You&amp;#039;ll never get it perfect. For real object detection, look at zmeventnotification, the machine learning based alarm detection extension to ZM&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pixel_area.jpg|800px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Note 1:  the image is not to scale, so measurements will not tally if you are trying to draw boxes around the example image above)&lt;br /&gt;
* (Note 2: when you are measuring sizes, make sure you have not reduced browser scale. If you did, obviously, your pixel markings will be wrong because the image will be scaled)&lt;br /&gt;
* I then think about what might be the area inside that rectangle I drew that will have a continuous change in pixels. My guess here was 9x9 which is what I put into the Filter Pixels&lt;br /&gt;
* Finally, since I put a value of 2800 in the alarmed pixel area, obviously Min Alarmed Area &amp;gt; Min Filtered Area &amp;gt; Min Blob Area. So I set Min Filtered Area to around 35% of 2800 = 1000 and blob area to around 90% of filtered area (approx 900), the reason being in my estimate blob area should closely match filtered area of contiguous pixels for humans. This is my guess *shrug*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(While the example below refers to percents, the same logic applies to pixels)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note the percentages I describe above seem lesser than the visual percentages when you look at the image. First, my image is not to scale. Second, I guess I could increase the percentages, but these values are working quite well for me, but in reality I guess I could easily increase, say, 6% to 10%. In general, I&amp;#039;d recommend using the least value that is not triggered by small things - keep raising it till you stop getting 90% of spurious alarms, but no further. If you try and eliminate all spurious events, then its likely you will also miss some valid motion (that&amp;#039;s a non scientific anecdotal statement, so feel free to challenge me here)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do:&lt;br /&gt;
* Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
* As I wrote earlier, use maximum values in the zone definition to reduce &amp;#039;change bursts&amp;#039; (significant pixel coloration changes due to spikes of light/shadows)&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15594</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15594"/>
		<updated>2019-06-30T12:28:38Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a powerful zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Updated on Apr 2019===&lt;br /&gt;
&lt;br /&gt;
Incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Yawn. Forget the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To some, the latter makes much more sense. However, if you really want more fine grained control, you should use pixels. I used percent when I first started off, but then realized that pixels was more powerful when you are trying to eliminate false alarms.&lt;br /&gt;
&lt;br /&gt;
(Pixels are especially useful if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Selecting the right values====&lt;br /&gt;
&lt;br /&gt;
=====Using percents=====&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Percent vs. Pixels:&amp;#039;&amp;#039;&amp;#039; Back to my previous point -if you specify alarmed areas in pixels, in addition to being able to visualize better (at least for me) the added advantage is the setting scales as zone sizes changes.  For example the % of space the person takes in my far end &amp;quot;Door&amp;quot; zone is quite similar to the % of space the person takes in my couch area (in other words, both the zone and person have scaled up in size, so relative % is still the same)&lt;br /&gt;
&lt;br /&gt;
* So having said all of this, this is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like:&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Using pixels=====&lt;br /&gt;
(This is what I ended up using once I got comfortable with zones)&lt;br /&gt;
* This was updated Jun 2019, I don&amp;#039;t have that basement camera any more, so I am going to use a different image&lt;br /&gt;
* I usually start with a Min/Max pixel threshold of 35 (that is, consider pixels alarmed only if the color different between the old pixel and the new one is 35 or more)&lt;br /&gt;
* For the min/max alarmed area, I draw a box inside my zone that represents an object size I think is appropriate. In the image below, I am trying to estimate what the size of a person would be in the zone. I use a mac - I simply hit Cmd+Shift+4 - that brings up a screen capture cross hair and as I draw the box, I see its width and height. Once I have a box with the dimension that I think is appropriate, I hit escape and simply fill in Min/Max Area = W*H of that box I used as a visual tool (the image shows a green box, just as a representation). In this case, my box was 42X67 pixels, so I fill in a min area of 2800&lt;br /&gt;
* You should also look at filling in a &amp;quot;max&amp;quot; area - this is to avoid sudden &amp;quot;blast of light changes&amp;quot; that raise an alarm. For example, if most of my zone pixels changed, it is unlikely its an object of interest. It is more likely the sun just blasted light on my driveway or a big shadow situation occurred. ZM helpfully tells you your zone area- in this case 92271. You could choose to put in a pixel value that is some large fraction of this value (maybe 90% of it = 83,000 or simply draw another rectangle to represent the largest object that is of interest to you and use that area value)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip: Don&amp;#039;t try to get super precise in your first round: Use less aggressive values to begin with - that is, lesser area values. Keep increasing and testing till you reach a good threshold between bogus detections and real detections. Pixel based detections have a limit. You&amp;#039;ll never get it perfect. For real object detection, look at zmeventnotification, the machine learning based alarm detection extension to ZM&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pixel_area.jpg|800px ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Note 1:  the image is not to scale, so measurements will not tally if you are trying to draw boxes around the example image above)&lt;br /&gt;
* (Note 2: when you are measuring sizes, make sure you have not reduced browser scale. If you did, obviously, your pixel markings will be wrong because the image will be scaled)&lt;br /&gt;
* I then think about what might be the area inside that rectangle I drew that will have a continuous change in pixels. My guess here was 9x9 which is what I put into the Filter Pixels&lt;br /&gt;
* Finally, since I put a value of 2800 in the alarmed pixel area, obviously Min Alarmed Area &amp;gt; Min Filtered Area &amp;gt; Min Blob Area. So I set Min Filtered Area to around 35% of 2800 = 1000 and blob area to around 90% of filtered area (approx 900), the reason being in my estimate blob area should closely match filtered area of contiguous pixels for humans. This is my guess *shrug*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(While the example below refers to percents, the same logic applies to pixels)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note the percentages I describe above seem lesser than the visual percentages when you look at the image. First, my image is not to scale. Second, I guess I could increase the percentages, but these values are working quite well for me, but in reality I guess I could easily increase, say, 6% to 10%. In general, I&amp;#039;d recommend using the least value that is not triggered by small things - keep raising it till you stop getting 90% of spurious alarms, but no further. If you try and eliminate all spurious events, then its likely you will also miss some valid motion (that&amp;#039;s a non scientific anecdotal statement, so feel free to challenge me here)&lt;br /&gt;
&lt;br /&gt;
====Door Zone====&lt;br /&gt;
Here is my zone setting for the door (Edit note: the max alarmed/filtered area was changed to 70% - the image shows 90%)&lt;br /&gt;
&lt;br /&gt;
[[File:Door.png]]&lt;br /&gt;
&lt;br /&gt;
The logic is similar to the foyer area - plus, I&amp;#039;ve used the overload frame count -- basically the sun blasts through the blinds and in those cases the % change is very large (around 75+%) which triggers my max % spec and in that case, I tell zoneminder to ignore the next 2 frames so that this excessive lighting condition does not raise lots of alarms. BTW, this is one zone where I still get 4-5 false events in a day. I am fine with it and prefer to live with it.&lt;br /&gt;
&lt;br /&gt;
====Ah, I get it. But hey what&amp;#039;s that preclusive zone in your image at the start of this artlce?====&lt;br /&gt;
Ah, ZM allows us to specify a zone where should an alarm occur, it suppresses alarms in that zone and all other zones in the monitor. I&amp;#039;ve set it to cover my recess lights. &lt;br /&gt;
So if someone turns our lights on, I won&amp;#039;t get an alarm. Does it work? Yep pretty well. Does it always work? Mostly. Heh heh.&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do. Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
&lt;br /&gt;
===You&amp;#039;re a dork. None of this mumbo jumbo worked for me. I want my money back===&lt;br /&gt;
Life sucks. Take a break. Drink a glass of wine. Or two. Then get back to your settings. And its possible these don&amp;#039;t work for you - try different values. Think visually.&lt;br /&gt;
Oh, and I&amp;#039;ll need a postage paid envelope to email you a $0 cheque. And a $5 cheque from you to pay for gas to drive to the nearest post box. Labor is free because you did not like my article. There is a lifetime return policy, you see.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15593</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15593"/>
		<updated>2019-06-30T12:26:20Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a powerful zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Updated on Apr 2019===&lt;br /&gt;
&lt;br /&gt;
Incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Yawn. Forget the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To some, the latter makes much more sense. However, if you really want more fine grained control, you should use pixels. I used percent when I first started off, but then realized that pixels was more powerful when you are trying to eliminate false alarms.&lt;br /&gt;
&lt;br /&gt;
(Pixels are especially useful if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Selecting the right values====&lt;br /&gt;
&lt;br /&gt;
=====Using percents=====&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Percent vs. Pixels:&amp;#039;&amp;#039;&amp;#039; Back to my previous point -if you specify alarmed areas in pixels, in addition to being able to visualize better (at least for me) the added advantage is the setting scales as zone sizes changes.  For example the % of space the person takes in my far end &amp;quot;Door&amp;quot; zone is quite similar to the % of space the person takes in my couch area (in other words, both the zone and person have scaled up in size, so relative % is still the same)&lt;br /&gt;
&lt;br /&gt;
* So having said all of this, this is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like:&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Using pixels=====&lt;br /&gt;
(This is what I ended up using once I got comfortable with zones)&lt;br /&gt;
* This was updated Jun 2019, I don&amp;#039;t have that basement camera any more, so I am going to use a different image&lt;br /&gt;
* I usually start with a Min/Max pixel threshold of 35 (that is, consider pixels alarmed only if the color different between the old pixel and the new one is 35 or more)&lt;br /&gt;
* For the min/max alarmed area, I draw a box inside my zone that represents an object size I think is appropriate. In the image below, I am trying to estimate what the size of a person would be in the zone. I use a mac - I simply hit Cmd+Shift+4 - that brings up a screen capture cross hair and as I draw the box, I see its width and height. Once I have a box with the dimension that I think is appropriate, I hit escape and simply fill in Min/Max Area = W*H of that box I used as a visual tool (the image shows a green box, just as a representation). In this case, my box was 42X67 pixels, so I fill in a min area of 2800&lt;br /&gt;
* You should also look at filling in a &amp;quot;max&amp;quot; area - this is to avoid sudden &amp;quot;blast of light changes&amp;quot; that raise an alarm. For example, if most of my zone pixels changed, it is unlikely its an object of interest. It is more likely the sun just blasted light on my driveway or a big shadow situation occurred. ZM helpfully tells you your zone area- in this case 92271. You could choose to put in a pixel value that is some large fraction of this value (maybe 90% of it = 83,000 or simply draw another rectangle to represent the largest object that is of interest to you and use that area value)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip: Don&amp;#039;t try to get super precise in your first round: Use less aggressive values to begin with - that is, lesser area values. Keep increasing and testing till you reach a good threshold between bogus detections and real detections. Pixel based detections have a limit. You&amp;#039;ll never get it perfect. For real object detection, look at zmeventnotification, the machine learning based alarm detection extension to ZM&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pixel_area.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Note 1:  the image is not to scale, so measurements will not tally if you are trying to draw boxes around the example image above)&lt;br /&gt;
* (Note 2: when you are measuring sizes, make sure you have not reduced browser scale. If you did, obviously, your pixel markings will be wrong because the image will be scaled)&lt;br /&gt;
* I then think about what might be the area inside that rectangle I drew that will have a continuous change in pixels. My guess here was 9x9 which is what I put into the Filter Pixels&lt;br /&gt;
* Finally, since I put a value of 2800 in the alarmed pixel area, obviously Min Alarmed Area &amp;gt; Min Filtered Area &amp;gt; Min Blob Area. So I set Min Filtered Area to around 35% of 2800 = 1000 and blob area to around 90% of filtered area (approx 900), the reason being in my estimate blob area should closely match filtered area of contiguous pixels for humans. This is my guess *shrug*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(While the example below refers to percents, the same logic applies to pixels)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note the percentages I describe above seem lesser than the visual percentages when you look at the image. First, my image is not to scale. Second, I guess I could increase the percentages, but these values are working quite well for me, but in reality I guess I could easily increase, say, 6% to 10%. In general, I&amp;#039;d recommend using the least value that is not triggered by small things - keep raising it till you stop getting 90% of spurious alarms, but no further. If you try and eliminate all spurious events, then its likely you will also miss some valid motion (that&amp;#039;s a non scientific anecdotal statement, so feel free to challenge me here)&lt;br /&gt;
&lt;br /&gt;
====Door Zone====&lt;br /&gt;
Here is my zone setting for the door (Edit note: the max alarmed/filtered area was changed to 70% - the image shows 90%)&lt;br /&gt;
&lt;br /&gt;
[[File:Door.png]]&lt;br /&gt;
&lt;br /&gt;
The logic is similar to the foyer area - plus, I&amp;#039;ve used the overload frame count -- basically the sun blasts through the blinds and in those cases the % change is very large (around 75+%) which triggers my max % spec and in that case, I tell zoneminder to ignore the next 2 frames so that this excessive lighting condition does not raise lots of alarms. BTW, this is one zone where I still get 4-5 false events in a day. I am fine with it and prefer to live with it.&lt;br /&gt;
&lt;br /&gt;
====Ah, I get it. But hey what&amp;#039;s that preclusive zone in your image at the start of this artlce?====&lt;br /&gt;
Ah, ZM allows us to specify a zone where should an alarm occur, it suppresses alarms in that zone and all other zones in the monitor. I&amp;#039;ve set it to cover my recess lights. &lt;br /&gt;
So if someone turns our lights on, I won&amp;#039;t get an alarm. Does it work? Yep pretty well. Does it always work? Mostly. Heh heh.&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do. Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
&lt;br /&gt;
===You&amp;#039;re a dork. None of this mumbo jumbo worked for me. I want my money back===&lt;br /&gt;
Life sucks. Take a break. Drink a glass of wine. Or two. Then get back to your settings. And its possible these don&amp;#039;t work for you - try different values. Think visually.&lt;br /&gt;
Oh, and I&amp;#039;ll need a postage paid envelope to email you a $0 cheque. And a $5 cheque from you to pay for gas to drive to the nearest post box. Labor is free because you did not like my article. There is a lifetime return policy, you see.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=File:Pixel_area.jpg&amp;diff=15592</id>
		<title>File:Pixel area.jpg</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=File:Pixel_area.jpg&amp;diff=15592"/>
		<updated>2019-06-30T12:25:33Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15591</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15591"/>
		<updated>2019-06-30T12:21:47Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a powerful zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Updated on Apr 2019===&lt;br /&gt;
&lt;br /&gt;
Incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Yawn. Forget the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To some, the latter makes much more sense. However, if you really want more fine grained control, you should use pixels. I used percent when I first started off, but then realized that pixels was more powerful when you are trying to eliminate false alarms.&lt;br /&gt;
&lt;br /&gt;
(Pixels are especially useful if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Selecting the right values====&lt;br /&gt;
&lt;br /&gt;
=====Using percents=====&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Percent vs. Pixels:&amp;#039;&amp;#039;&amp;#039; Back to my previous point -if you specify alarmed areas in pixels, in addition to being able to visualize better (at least for me) the added advantage is the setting scales as zone sizes changes.  For example the % of space the person takes in my far end &amp;quot;Door&amp;quot; zone is quite similar to the % of space the person takes in my couch area (in other words, both the zone and person have scaled up in size, so relative % is still the same)&lt;br /&gt;
&lt;br /&gt;
* So having said all of this, this is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like:&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Using pixels=====&lt;br /&gt;
(This is what I ended up using once I got comfortable with zones)&lt;br /&gt;
* This was updated Jun 2019, I don&amp;#039;t have that basement camera any more, so I am going to use a different image&lt;br /&gt;
* I usually start with a Min/Max pixel threshold of 35 (that is, consider pixels alarmed only if the color different between the old pixel and the new one is 35 or more)&lt;br /&gt;
* For the min/max alarmed area, I draw a box inside my zone that represents an object size I think is appropriate. In the image below, I am trying to estimate what the size of a person would be in the zone. I use a mac - I simply hit Cmd+Shift+4 - that brings up a screen capture cross hair and as I draw the box, I see its width and height. Once I have a box with the dimension that I think is appropriate, I hit escape and simply fill in Min/Max Area = W*H of that box I used as a visual tool (the image shows a green box, just as a representation). In this case, my box was 42X67 pixels, so I fill in a min area of 2800&lt;br /&gt;
* You should also look at filling in a &amp;quot;max&amp;quot; area - this is to avoid sudden &amp;quot;blast of light changes&amp;quot; that raise an alarm. For example, if most of my zone pixels changed, it is unlikely its an object of interest. It is more likely the sun just blasted light on my driveway or a big shadow situation occurred. ZM helpfully tells you your zone area- in this case 92271. You could choose to put in a pixel value that is some large fraction of this value (maybe 90% of it = 83,000 or simply draw another rectangle to represent the largest object that is of interest to you and use that area value)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tip: Don&amp;#039;t try to get super precise in your first round: Use less aggressive values to begin with - that is, lesser area values. Keep increasing and testing till you reach a good threshold between bogus detections and real detections. Pixel based detections have a limit. You&amp;#039;ll never get it perfect. For real object detection, look at zmeventnotification, the machine learning based alarm detection extension to ZM&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pixel area.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* (Note 1:  the image is not to scale, so measurements will not tally if you are trying to draw boxes around the example image above)&lt;br /&gt;
* (Note 2: when you are measuring sizes, make sure you have not reduced browser scale. If you did, obviously, your pixel markings will be wrong because the image will be scaled)&lt;br /&gt;
* I then think about what might be the area inside that rectangle I drew that will have a continuous change in pixels. My guess here was 9x9 which is what I put into the Filter Pixels&lt;br /&gt;
* Finally, since I put a value of 2800 in the alarmed pixel area, obviously Min Alarmed Area &amp;gt; Min Filtered Area &amp;gt; Min Blob Area. So I set Min Filtered Area to around 35% of 2800 = 1000 and blob area to around 90% of filtered area (approx 900), the reason being in my estimate blob area should closely match filtered area of contiguous pixels for humans. This is my guess *shrug*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(While the example below refers to percents, the same logic applies to pixels)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note the percentages I describe above seem lesser than the visual percentages when you look at the image. First, my image is not to scale. Second, I guess I could increase the percentages, but these values are working quite well for me, but in reality I guess I could easily increase, say, 6% to 10%. In general, I&amp;#039;d recommend using the least value that is not triggered by small things - keep raising it till you stop getting 90% of spurious alarms, but no further. If you try and eliminate all spurious events, then its likely you will also miss some valid motion (that&amp;#039;s a non scientific anecdotal statement, so feel free to challenge me here)&lt;br /&gt;
&lt;br /&gt;
====Door Zone====&lt;br /&gt;
Here is my zone setting for the door (Edit note: the max alarmed/filtered area was changed to 70% - the image shows 90%)&lt;br /&gt;
&lt;br /&gt;
[[File:Door.png]]&lt;br /&gt;
&lt;br /&gt;
The logic is similar to the foyer area - plus, I&amp;#039;ve used the overload frame count -- basically the sun blasts through the blinds and in those cases the % change is very large (around 75+%) which triggers my max % spec and in that case, I tell zoneminder to ignore the next 2 frames so that this excessive lighting condition does not raise lots of alarms. BTW, this is one zone where I still get 4-5 false events in a day. I am fine with it and prefer to live with it.&lt;br /&gt;
&lt;br /&gt;
====Ah, I get it. But hey what&amp;#039;s that preclusive zone in your image at the start of this artlce?====&lt;br /&gt;
Ah, ZM allows us to specify a zone where should an alarm occur, it suppresses alarms in that zone and all other zones in the monitor. I&amp;#039;ve set it to cover my recess lights. &lt;br /&gt;
So if someone turns our lights on, I won&amp;#039;t get an alarm. Does it work? Yep pretty well. Does it always work? Mostly. Heh heh.&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do. Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
&lt;br /&gt;
===You&amp;#039;re a dork. None of this mumbo jumbo worked for me. I want my money back===&lt;br /&gt;
Life sucks. Take a break. Drink a glass of wine. Or two. Then get back to your settings. And its possible these don&amp;#039;t work for you - try different values. Think visually.&lt;br /&gt;
Oh, and I&amp;#039;ll need a postage paid envelope to email you a $0 cheque. And a $5 cheque from you to pay for gas to drive to the nearest post box. Labor is free because you did not like my article. There is a lifetime return policy, you see.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15590</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15590"/>
		<updated>2019-06-29T21:40:07Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Pixels or percents? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a powerful zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Updated on Apr 2019===&lt;br /&gt;
&lt;br /&gt;
Incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Yawn. Forget the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To some, the latter makes much more sense. However, if you really want more fine grained control, you should use pixels. I used percent when I first started off, but then realized that pixels was more powerful when you are trying to eliminate false alarms.&lt;br /&gt;
&lt;br /&gt;
(Pixels are especially useful if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Right percents. But what values?====&lt;br /&gt;
&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Percent vs. Pixels:&amp;#039;&amp;#039;&amp;#039; Back to my previous point -if you specify alarmed areas in pixels, in addition to being able to visualize better (at least for me) the added advantage is the setting scales as zone sizes changes.  For example the % of space the person takes in my far end &amp;quot;Door&amp;quot; zone is quite similar to the % of space the person takes in my couch area (in other words, both the zone and person have scaled up in size, so relative % is still the same)&lt;br /&gt;
&lt;br /&gt;
* So having said all of this, this is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like:&lt;br /&gt;
&lt;br /&gt;
====Stairs Zone====&lt;br /&gt;
&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note the percentages I describe above seem lesser than the visual percentages when you look at the image. First, my image is not to scale. Second, I guess I could increase the percentages, but these values are working quite well for me, but in reality I guess I could easily increase, say, 6% to 10%. In general, I&amp;#039;d recommend using the least value that is not triggered by small things - keep raising it till you stop getting 90% of spurious alarms, but no further. If you try and eliminate all spurious events, then its likely you will also miss some valid motion (that&amp;#039;s a non scientific anecdotal statement, so feel free to challenge me here)&lt;br /&gt;
&lt;br /&gt;
====Door Zone====&lt;br /&gt;
Here is my zone setting for the door (Edit note: the max alarmed/filtered area was changed to 70% - the image shows 90%)&lt;br /&gt;
&lt;br /&gt;
[[File:Door.png]]&lt;br /&gt;
&lt;br /&gt;
The logic is similar to the foyer area - plus, I&amp;#039;ve used the overload frame count -- basically the sun blasts through the blinds and in those cases the % change is very large (around 75+%) which triggers my max % spec and in that case, I tell zoneminder to ignore the next 2 frames so that this excessive lighting condition does not raise lots of alarms. BTW, this is one zone where I still get 4-5 false events in a day. I am fine with it and prefer to live with it.&lt;br /&gt;
&lt;br /&gt;
====Ah, I get it. But hey what&amp;#039;s that preclusive zone in your image at the start of this artlce?====&lt;br /&gt;
Ah, ZM allows us to specify a zone where should an alarm occur, it suppresses alarms in that zone and all other zones in the monitor. I&amp;#039;ve set it to cover my recess lights. &lt;br /&gt;
So if someone turns our lights on, I won&amp;#039;t get an alarm. Does it work? Yep pretty well. Does it always work? Mostly. Heh heh.&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do. Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
&lt;br /&gt;
===You&amp;#039;re a dork. None of this mumbo jumbo worked for me. I want my money back===&lt;br /&gt;
Life sucks. Take a break. Drink a glass of wine. Or two. Then get back to your settings. And its possible these don&amp;#039;t work for you - try different values. Think visually.&lt;br /&gt;
Oh, and I&amp;#039;ll need a postage paid envelope to email you a $0 cheque. And a $5 cheque from you to pay for gas to drive to the nearest post box. Labor is free because you did not like my article. There is a lifetime return policy, you see.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15528</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15528"/>
		<updated>2019-04-11T15:57:18Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a powerful zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Updated on Apr 2019===&lt;br /&gt;
&lt;br /&gt;
Incase you did not know, ZoneMinder now has support for person, object, face recognition.  So while you can and should optimize your zones, if your real interest is person detection, you can do that using my [https://github.com/pliablepixels/zmeventnotification event server]&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Yawn. Forget the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To me, the latter makes much more sense.&lt;br /&gt;
So I&amp;#039;ve always used percents&lt;br /&gt;
(Updated in 2019: Given a lot of people seem to refer to this article, in some cases, it does make more sense to use pixels, especially if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Right percents. But what values?====&lt;br /&gt;
&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Percent vs. Pixels:&amp;#039;&amp;#039;&amp;#039; Back to my previous point -if you specify alarmed areas in pixels, in addition to being able to visualize better (at least for me) the added advantage is the setting scales as zone sizes changes.  For example the % of space the person takes in my far end &amp;quot;Door&amp;quot; zone is quite similar to the % of space the person takes in my couch area (in other words, both the zone and person have scaled up in size, so relative % is still the same)&lt;br /&gt;
&lt;br /&gt;
* So having said all of this, this is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like:&lt;br /&gt;
&lt;br /&gt;
====Stairs Zone====&lt;br /&gt;
&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note the percentages I describe above seem lesser than the visual percentages when you look at the image. First, my image is not to scale. Second, I guess I could increase the percentages, but these values are working quite well for me, but in reality I guess I could easily increase, say, 6% to 10%. In general, I&amp;#039;d recommend using the least value that is not triggered by small things - keep raising it till you stop getting 90% of spurious alarms, but no further. If you try and eliminate all spurious events, then its likely you will also miss some valid motion (that&amp;#039;s a non scientific anecdotal statement, so feel free to challenge me here)&lt;br /&gt;
&lt;br /&gt;
====Door Zone====&lt;br /&gt;
Here is my zone setting for the door (Edit note: the max alarmed/filtered area was changed to 70% - the image shows 90%)&lt;br /&gt;
&lt;br /&gt;
[[File:Door.png]]&lt;br /&gt;
&lt;br /&gt;
The logic is similar to the foyer area - plus, I&amp;#039;ve used the overload frame count -- basically the sun blasts through the blinds and in those cases the % change is very large (around 75+%) which triggers my max % spec and in that case, I tell zoneminder to ignore the next 2 frames so that this excessive lighting condition does not raise lots of alarms. BTW, this is one zone where I still get 4-5 false events in a day. I am fine with it and prefer to live with it.&lt;br /&gt;
&lt;br /&gt;
====Ah, I get it. But hey what&amp;#039;s that preclusive zone in your image at the start of this artlce?====&lt;br /&gt;
Ah, ZM allows us to specify a zone where should an alarm occur, it suppresses alarms in that zone and all other zones in the monitor. I&amp;#039;ve set it to cover my recess lights. &lt;br /&gt;
So if someone turns our lights on, I won&amp;#039;t get an alarm. Does it work? Yep pretty well. Does it always work? Mostly. Heh heh.&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do. Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
&lt;br /&gt;
===You&amp;#039;re a dork. None of this mumbo jumbo worked for me. I want my money back===&lt;br /&gt;
Life sucks. Take a break. Drink a glass of wine. Or two. Then get back to your settings. And its possible these don&amp;#039;t work for you - try different values. Think visually.&lt;br /&gt;
Oh, and I&amp;#039;ll need a postage paid envelope to email you a $0 cheque. And a $5 cheque from you to pay for gas to drive to the nearest post box. Labor is free because you did not like my article. There is a lifetime return policy, you see.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_18.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15518</id>
		<title>Ubuntu Server 18.04 64-bit with Zoneminder 1.30.4 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_18.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15518"/>
		<updated>2019-03-18T21:20:33Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ubuntu 18.04 with Zoneminder 1.30.4 Install Procedure&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;23JAN19 I have gone over these procedures and made corrections as needed. Tested/verified as long as the download server stays online. &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 18.04 AMD64 with LAMP and Zoneminder 1.30.4 Shell Script===&lt;br /&gt;
&lt;br /&gt;
This will install Zoneminder by using a shell script with one basic command (how easy is that!).&lt;br /&gt;
&lt;br /&gt;
You will need a Ubuntu 18.04 install with LAMP (Apache, MySQL and PHP) installed desktop or server. As an alternate you may use Mariadb in lieu of MySQL&lt;br /&gt;
&lt;br /&gt;
Shell script file contents:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;This script installs Zoneminder 1.30.4 on Ubuntu 18.04 AMD64 with LAMP (MySQL) installed...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;You must be logged in as root using sudo su ...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Next secure MySQL server by entering requested information. Press enter to continue&amp;quot; nothing&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
 read -p &amp;quot;Next we will download the Zoneminder install package and install it.&lt;br /&gt;
 Press enter to continue&amp;quot; nothing&lt;br /&gt;
 wget --no-check-certificate https://173.163.189.225/zoneminder-1.30.4-bionic-amd64.deb -P /tmp/&lt;br /&gt;
 ls /tmp/zoneminder*&lt;br /&gt;
 read -p &amp;quot;Check above to be sure the file downloaded. Should be:&lt;br /&gt;
 /tmp/zoneminder-1.30.4-bionic-amd64.deb (5686708)&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 awk &amp;#039;$0=&amp;quot;date.timezone = &amp;quot;$0&amp;#039; /etc/timezone &amp;gt;&amp;gt; /etc/php/7.2/apache2/php.ini&lt;br /&gt;
 echo &amp;quot;[mysqld]&amp;quot; &amp;gt;&amp;gt; /etc/mysql/my.cnf&lt;br /&gt;
 echo &amp;quot;init_connect = &amp;#039;SET @@sql_mode = CASE CURRENT_USER() WHEN \&amp;#039;zmuser@localhost\&amp;#039; THEN \&amp;#039;NO_ENGINE_SUBSTITUTION\&amp;#039; ELSE @@sql_mode END;&amp;#039;&amp;quot; &amp;gt;&amp;gt; /etc/mysql/my.cnf&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
 apt-get -y install /tmp/zoneminder-1.30.4-bionic-amd64.deb&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Open Zoneminder in a web browser (http://server-ip/zm). &lt;br /&gt;
 Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms &lt;br /&gt;
 Click the Save button. &lt;br /&gt;
 Press enter to continue&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
&lt;br /&gt;
Copy the contents of the script, open a terminal and run:&lt;br /&gt;
&lt;br /&gt;
 nano zm-install&lt;br /&gt;
&lt;br /&gt;
Paste the contents of the script into Nano&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
 Ctrl + o&lt;br /&gt;
 Ctrl + x&lt;br /&gt;
&lt;br /&gt;
Next run:&lt;br /&gt;
&lt;br /&gt;
 chmod 755 zm-install&lt;br /&gt;
&lt;br /&gt;
Start the script by entering:&lt;br /&gt;
&lt;br /&gt;
 ./zm-install&lt;br /&gt;
&lt;br /&gt;
Follow the prompts. Things are pretty simple. The timezone will be detected from the OS and added to the php.ini.&lt;br /&gt;
&lt;br /&gt;
Good Luck! &lt;br /&gt;
&lt;br /&gt;
While this script worked for me I can&amp;#039;t be responsible if you loose data when you run this. It is intended for a new install not an upgrade.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 18.04 AMD64 with LAMP and Zoneminder 1.30.4 Manual Install===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;25APR18 - Zoneminder has been removed from the Ubuntu 18.04, Bionic, repository. PHP updates to version 7.2 also caused some problems which have been resolved (I hope!). This procedure uses a patched install from Zesty along with cakephp and crud updates to work with PHP7.2 &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ubuntu 18.04 Bionic installed with LAMP and OpenSSH Server 64 BIT Ubuntu only!&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
This removes the current symbolic link&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  &lt;br /&gt;
&lt;br /&gt;
This moves the MYSQL Configuration file&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
In the [mysqld] section add the following&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Note: if you are installing on an existing database server you can use the folowing as an alternate (Thanks to &amp;quot;bodom&amp;quot; for this alternate):&lt;br /&gt;
&lt;br /&gt;
 init_connect = &amp;#039;SET @@sql_mode = CASE CURRENT_USER() WHEN \&amp;#039;zmuser@localhost\&amp;#039; THEN \&amp;#039;NO_ENGINE_SUBSTITUTION\&amp;#039; ELSE @@sql_mode END;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Secure MySQL and set root password.  Do not install the password validation plugin as the default Zoneminder password is not strong.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Dowmload the Zoneminder install package:&lt;br /&gt;
&lt;br /&gt;
 wget --no-check-certificate https://173.163.189.225/zoneminder-1.30.4-bionic-amd64.deb -P /tmp/&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder &lt;br /&gt;
&lt;br /&gt;
 apt install /tmp/zoneminder-1.30.4-bionic-amd64.deb&lt;br /&gt;
&lt;br /&gt;
Enable Zoneminder service to start at boot&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Add www-data to the sudo group (to enable use of local video devices)&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Enable CGI and Zoneminder configuration in Apache.&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.2/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Be sure to remove the ; before date.timezone&lt;br /&gt;
&lt;br /&gt;
[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
; http://php.net/date.timezone&lt;br /&gt;
date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Change permissions in /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 restart&lt;br /&gt;
&lt;br /&gt;
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (http://server-ip/zm). Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 18.04 LEMP (NGNIX, Mariadb, PHP)===&lt;br /&gt;
&lt;br /&gt;
Start with a basic Ubuntu 18.04 install. You can use a server or desktop install. Do not install LAMP!&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Install Ngnix, Mariadb and PHP components&lt;br /&gt;
&lt;br /&gt;
 apt install nginx mariadb-server php-fpm php-mysql fcgiwrap&lt;br /&gt;
&lt;br /&gt;
Secure the Mariadb server&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Restart Mariadb&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Edit the php.ini file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.2/fpm/php.ini&lt;br /&gt;
&lt;br /&gt;
Locate (Ctrl+w) cgi.fix_pathinfo=1 and change to&lt;br /&gt;
&lt;br /&gt;
 cgi.fix_pathinfo=0&lt;br /&gt;
&lt;br /&gt;
Remember to remove the leading ;&lt;br /&gt;
&lt;br /&gt;
Also fix date. Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart php-fpm&lt;br /&gt;
&lt;br /&gt;
 systemctl restart php7.2-fpm&lt;br /&gt;
&lt;br /&gt;
Download the Zoneminder install package. This may take a minute to connect&lt;br /&gt;
&lt;br /&gt;
 wget --no-check-certificate https://173.163.189.225/zoneminder-1.30.4-bionic-amd64.deb -P /tmp/&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install /tmp/zoneminder-1.30.4-bionic-amd64.deb&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edit the Ngnix default configuration. &lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/sites-available/default&lt;br /&gt;
&lt;br /&gt;
Locate the line &amp;quot;index index.html index.htm index.nginx-debian.html;&amp;quot; and add index.php&lt;br /&gt;
&lt;br /&gt;
 index index.php index.html index.htm index.nginx-debian.html;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Create a Zoneminder conf file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Enter the following into the zoneminder.conf file (This file was improved by databoy2k)&lt;br /&gt;
&lt;br /&gt;
 location /zm/cgi-bin {&lt;br /&gt;
     gzip off;&lt;br /&gt;
     alias /usr/lib/zoneminder/cgi-bin;&lt;br /&gt;
 &lt;br /&gt;
     include /etc/nginx/fastcgi_params;&lt;br /&gt;
     fastcgi_param SCRIPT_FILENAME $request_filename;&lt;br /&gt;
     fastcgi_pass  unix:/var/run/fcgiwrap.socket;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 location /zm {&lt;br /&gt;
 #   if ($scheme ~ ^http:){&lt;br /&gt;
 #       rewrite ^(.*)$  https://$host$1 permanent;&lt;br /&gt;
 #   }&lt;br /&gt;
 &lt;br /&gt;
     gzip off;&lt;br /&gt;
     alias                   /usr/share/zoneminder/www;&lt;br /&gt;
     index                   index.php;&lt;br /&gt;
 &lt;br /&gt;
     location ~ \.php$ {&lt;br /&gt;
         if (!-f $request_filename) { return 404; }&lt;br /&gt;
         expires             epoch;&lt;br /&gt;
         include             /etc/nginx/fastcgi_params;&lt;br /&gt;
         fastcgi_param       SCRIPT_FILENAME         $request_filename;&lt;br /&gt;
         fastcgi_index       index.php;&lt;br /&gt;
         fastcgi_pass        unix:/var/run/php/php7.2-fpm.sock;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     location ~ \.(jpg|jpeg|gif|png|ico)$ {&lt;br /&gt;
         access_log          off;&lt;br /&gt;
         expires         33d;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     location /zm/api/ {&lt;br /&gt;
         alias                   /usr/share/zoneminder/www/api;&lt;br /&gt;
         rewrite ^/zm/api(.+)$ /zm/api/index.php?p=$1 last;&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Edit the default sites enabled&lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/sites-enabled/default&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;server&amp;quot; section after listen [::] :80 default_Server; add&lt;br /&gt;
&lt;br /&gt;
 include /etc/nginx/zoneminder.conf;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart Ngnix&lt;br /&gt;
&lt;br /&gt;
 service nginx restart&lt;br /&gt;
&lt;br /&gt;
Note: If Nginx gives you an error on restart go back one step and re-enter include /etc/ngnix/zoneminder.conf;&lt;br /&gt;
&lt;br /&gt;
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (http://server-ip/zm). Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
Note: 29JUL18 Thanks to Tiver for this suggestion that seems to work with the fcgiwrap issue.&lt;br /&gt;
&lt;br /&gt;
If it does not exist create &lt;br /&gt;
&lt;br /&gt;
 nano /etc/default/fcgiwrap&lt;br /&gt;
&lt;br /&gt;
and insert (with the number of children -c equal to the number of cameras)&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTS=-c 10&lt;br /&gt;
&lt;br /&gt;
then restart the fcgiwrap service.&lt;br /&gt;
&lt;br /&gt;
 systemctl restart fcgiwrap&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15517</id>
		<title>Ubuntu Server 16.04 64-bit with Zoneminder 1.30.4 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15517"/>
		<updated>2019-03-18T21:20:20Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Temporary install for Zoneminder 1.30.4 on Ubuntu 16.04 64 bit only===&lt;br /&gt;
&lt;br /&gt;
The following is a shell script to install Zoneminder 1.30.4 on Ubuntu 16.04 64 bit.&lt;br /&gt;
&lt;br /&gt;
==Note: if you had Zoneminder installed you can omit the following two commands from the script==&lt;br /&gt;
&lt;br /&gt;
This entry appends the timezone to the php.ini&lt;br /&gt;
&lt;br /&gt;
 awk &amp;#039;$0=&amp;quot;date.timezone = &amp;quot;$0&amp;#039; /etc/timezone &amp;gt;&amp;gt; /etc/php/7.0/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
These add entries to the my.cnf&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;[mysqld]&amp;quot; &amp;gt;&amp;gt; /etc/mysql/my.cnf&lt;br /&gt;
 echo &amp;quot;init_connect = &amp;#039;SET @@sql_mode = CASE CURRENT_USER() WHEN \&amp;#039;zmuser@localhost\&amp;#039; THEN \&amp;#039;NO_ENGINE_SUBSTITUTION\&amp;#039; ELSE @@sql_mode END;&amp;#039;&amp;quot; &amp;gt;&amp;gt; /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Create a file:&lt;br /&gt;
&lt;br /&gt;
 nano install-zm&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following contents into the file&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;This script installs Zoneminder 1.30.4 on Ubuntu 16.04 AMD64 with LAMP (MySQL) installed. This uses install packages that were  downloaded from the Zoneminder PPA...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;You must be logged in as root using sudo su ...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Next we will download the Zoneminder install packages, configure MySQL and PHP and install the downloaded packages.&lt;br /&gt;
 Press enter to continue&amp;quot; nothing&lt;br /&gt;
 wget --no-check-certificate https://173.163.189.225/php-apcu-bc_1.0.3-2xenial2_amd64.deb -P /tmp/&lt;br /&gt;
 wget --no-check-certificate https://173.163.189.225/zoneminder-doc_1.30.4-xenial1_all.deb -P /tmp/&lt;br /&gt;
 wget --no-check-certificate https://173.163.189.225/zoneminder_1.30.4-xenial1_amd64.deb -P /tmp/&lt;br /&gt;
 clear&lt;br /&gt;
 awk &amp;#039;$0=&amp;quot;date.timezone = &amp;quot;$0&amp;#039; /etc/timezone &amp;gt;&amp;gt; /etc/php/7.0/apache2/php.ini&lt;br /&gt;
 echo &amp;quot;[mysqld]&amp;quot; &amp;gt;&amp;gt; /etc/mysql/my.cnf&lt;br /&gt;
 echo &amp;quot;init_connect = &amp;#039;SET @@sql_mode = CASE CURRENT_USER() WHEN \&amp;#039;zmuser@localhost\&amp;#039; THEN \&amp;#039;NO_ENGINE_SUBSTITUTION\&amp;#039; ELSE @@sql_mode END;&amp;#039;&amp;quot; &amp;gt;&amp;gt; /etc/mysql/my.cnf&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
 apt-get -y install /tmp/php-apcu-bc_1.0.3-2xenial2_amd64.deb&lt;br /&gt;
 apt-get -y install /tmp/zoneminder-doc_1.30.4-xenial1_all.deb&lt;br /&gt;
 apt-get -y install /tmp/zoneminder_1.30.4-xenial1_amd64.deb&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Open Zoneminder in a web browser (http://server-ip/zm). &lt;br /&gt;
 Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms &lt;br /&gt;
 Click the Save button. &lt;br /&gt;
 Press enter to continue&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
&lt;br /&gt;
Save the file&lt;br /&gt;
 ctrl + o&lt;br /&gt;
 ctrl + x&lt;br /&gt;
&lt;br /&gt;
Chmod permissions&lt;br /&gt;
 &lt;br /&gt;
 chmod 755 install-zm&lt;br /&gt;
&lt;br /&gt;
run the file&lt;br /&gt;
&lt;br /&gt;
 ./install-zm&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15516</id>
		<title>Ubuntu Server 14.04 64-bit with Zoneminder 1.30.4 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15516"/>
		<updated>2019-03-18T21:20:08Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Zoneminder 1.30.4 on Ubuntu Server 14.04.5&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Install Basic Server (if you used the mini.iso), OpenSSH Server, and LAMP Server&lt;br /&gt;
&lt;br /&gt;
Log in then become root:&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Make sure you are up to date&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add Repository (if you get an error run: apt-get install software-properties-common)&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
Update Sources&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder and php5-apc&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder php5-apc&lt;br /&gt;
&lt;br /&gt;
You may be prompted to set up Nulmailer. You may accept the defaults and set this up later if you want to use it.&lt;br /&gt;
&lt;br /&gt;
Add delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 after the existing &amp;quot;start() {&amp;quot; as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
      sleep 15&lt;br /&gt;
      echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Enable CGI, Zoneminder and rewrite configuration in Apache.&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder if needed (If you get an error Zoneminder is likely running already)&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in a web browser (http://server-ip/zm). &lt;br /&gt;
&lt;br /&gt;
Click on Options - Paths  Change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;(Caution: make sure you enter only /zm/cgi-bin/nph-zms with no space at the end or your video will not work!)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Reboot your server to set the tmp directories for API.&lt;br /&gt;
&lt;br /&gt;
Verified to work as written 14APR17&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_17.10_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15515</id>
		<title>Ubuntu Server 17.10 64-bit with Zoneminder 1.30.4 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_17.10_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15515"/>
		<updated>2019-03-18T21:19:55Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 17.10 with LAMP===&lt;br /&gt;
&lt;br /&gt;
This is an interim procedure to install Zoneminder 1.30.4 on Ubuntu 17.10&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note: There have been several reports of things, like the API, not working with Zoneminder and Ubuntu 17.10. You are better off to use Ubuntu 16.04!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note - installing Zoneminder this way will not prevent it from being overwritten when you do &amp;quot;apt upgrade&amp;quot; To prevent Zoneminder from being upgraded enter &amp;quot;sudo apt-mark hold zoneminder&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There are some issues with the Zoneminder package provided with Ubuntu 17.10. This is an alternate install procedure that uses the install package from the iconnor PPA for Zesty (Ubuntu 17.04)&lt;br /&gt;
&lt;br /&gt;
This assumes you have installed Ubuntu 17.10 with LAMP.&lt;br /&gt;
&lt;br /&gt;
You will need to make a settings change to MySQL as follows:&lt;br /&gt;
&lt;br /&gt;
This removes the current symbolic link&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  &lt;br /&gt;
&lt;br /&gt;
This moves the MYSQL Configuration file&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
In the [mysqld] section add the following&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Note: if you are installing on an existing database server you can use the following as an alternate (Thanks to &amp;quot;bodom&amp;quot; for this alternate):&lt;br /&gt;
&lt;br /&gt;
 init_connect = &amp;#039;SET @@sql_mode = CASE CURRENT_USER() WHEN \&amp;#039;zmuser@localhost\&amp;#039; THEN \&amp;#039;NO_ENGINE_SUBSTITUTION\&amp;#039; ELSE @@sql_mode END;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Download the Zoneminder install package from the iconnor PPA. Note this is for the 64 bit version. &lt;br /&gt;
&lt;br /&gt;
 wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder/+build/12557069/+files/zoneminder_1.30.4-zesty1_amd64.deb&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder - Note: Change (user) to the user in the home directory on your system&lt;br /&gt;
&lt;br /&gt;
 apt install vlc-plugin-base /home/(user)/zoneminder_1.30.4-zesty1_amd64.deb&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note - installing Zoneminder this way will not prevent it from being overwritten when you do &amp;quot;apt upgrade&amp;quot; To prevent Zoneminder from being upgraded enter &amp;quot;sudo apt-mark hold zoneminder&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Enable CGI, Zoneminder and rewrite configuration in Apache.&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.1/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (http://server-ip/zm). Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 17.10 with LEMP (NGINX, Mariadb and PHP)===&lt;br /&gt;
&lt;br /&gt;
Ubuntu 17.10 Nginx Mariadb PHP Zoneminder 1.30.4&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note - installing Zoneminder this way will not prevent it from being overwritten when you do &amp;quot;apt upgrade&amp;quot; To prevent Zoneminder from being upgraded enter &amp;quot;sudo apt-mark hold zoneminder&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Start with an install of Ubuntu 17.10, server, desktop or bare bones basic. Do not install LAMP!&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Install Nginx and Mariadb&lt;br /&gt;
&lt;br /&gt;
 apt install nginx&lt;br /&gt;
&lt;br /&gt;
 apt install mariadb-server&lt;br /&gt;
&lt;br /&gt;
Secure Mariadb&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Remove the symbolic link for Mariadb&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Copy a basic config file to replace the symbolic link&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Edit the Mariadb config file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Locate entries like the following and replace them&lt;br /&gt;
&lt;br /&gt;
 character-set-server = latin1&lt;br /&gt;
 collation-server = latin1_swedish_ci&lt;br /&gt;
&lt;br /&gt;
Note: The above settings are actually the Mariadb default. Changing back to default is necessary to avoid errors when logging into Zoneminder. This was added on 01APR17 but is not an April Fool! It may be necessary to align these settings with your regional language.&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart Mariadb&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Install PHP components&lt;br /&gt;
&lt;br /&gt;
 apt install php-fpm php-mysql fcgiwrap&lt;br /&gt;
&lt;br /&gt;
Edit the PHP ini file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.1/fpm/php.ini&lt;br /&gt;
&lt;br /&gt;
Locate (Ctrl+w) cgi.fix_pathinfo=1 and change to&lt;br /&gt;
&lt;br /&gt;
 cgi.fix_pathinfo=0&lt;br /&gt;
&lt;br /&gt;
Also fix date. Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart php-fm&lt;br /&gt;
&lt;br /&gt;
 systemctl restart php7.1-fpm&lt;br /&gt;
&lt;br /&gt;
Download the Zoneminder .deb file from the iconnor repository&lt;br /&gt;
&lt;br /&gt;
 wget https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder/+build/12557069/+files/zoneminder_1.30.4-zesty1_amd64.deb&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder. Change (user) as shown below to your user name on your Ubuntu install&lt;br /&gt;
&lt;br /&gt;
 apt install vlc-plugin-base /home/(user)/zoneminder_1.30.4-zesty1_amd64.deb&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note - installing Zoneminder this way will not prevent it from being overwritten when you do &amp;quot;apt upgrade&amp;quot; To prevent Zoneminder from being upgraded enter &amp;quot;sudo apt-mark hold zoneminder&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Add a user to enable local cameras&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Change permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Edit the Nginx default config file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/sites-available/default&lt;br /&gt;
&lt;br /&gt;
Locate the line &amp;quot;index index.html index.htm index.nginx-debian.html;&amp;quot; and add &amp;quot;index.php&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 index index.php index.html index.htm index.nginx-debian.html;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
Somewhere in the &amp;quot;server&amp;quot; section add&lt;br /&gt;
&lt;br /&gt;
 include /etc/nginx/zoneminder.conf;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Create a Zoneminder config file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Copy the following into it&lt;br /&gt;
&lt;br /&gt;
 location /zm/cgi-bin {&lt;br /&gt;
     gzip off;&lt;br /&gt;
     alias /usr/lib/zoneminder/cgi-bin;&lt;br /&gt;
 &lt;br /&gt;
     include /etc/nginx/fastcgi_params;&lt;br /&gt;
     fastcgi_param SCRIPT_FILENAME $request_filename;&lt;br /&gt;
     fastcgi_pass  unix:/var/run/fcgiwrap.socket;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 location /zm {&lt;br /&gt;
 #   if ($scheme ~ ^http:){&lt;br /&gt;
 #       rewrite ^(.*)$  https://$host$1 permanent;&lt;br /&gt;
 #   }&lt;br /&gt;
 &lt;br /&gt;
     gzip off;&lt;br /&gt;
     alias                   /usr/share/zoneminder/www;&lt;br /&gt;
     index                   index.php;&lt;br /&gt;
 &lt;br /&gt;
     location ~ \.php$ {&lt;br /&gt;
         if (!-f $request_filename) { return 404; }&lt;br /&gt;
         expires             epoch;&lt;br /&gt;
         include             /etc/nginx/fastcgi_params;&lt;br /&gt;
         fastcgi_param       SCRIPT_FILENAME         $request_filename;&lt;br /&gt;
         fastcgi_index       index.php;&lt;br /&gt;
         fastcgi_pass        unix:/var/run/php/php7.1-fpm.sock;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     location ~ \.(jpg|jpeg|gif|png|ico)$ {&lt;br /&gt;
         access_log          off;&lt;br /&gt;
         expires         33d;&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     location /zm/api/ {&lt;br /&gt;
         alias                   /usr/share/zoneminder/www/api;&lt;br /&gt;
         rewrite ^/zm/api(.+)$ /zm/api/index.php?p=$1 last;&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart Nginx &lt;br /&gt;
&lt;br /&gt;
 service nginx restart&lt;br /&gt;
&lt;br /&gt;
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (http://server-ip/zm). Click on Options - Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
Note: To avoid problems with feeds from multiple cameras &amp;quot;fcgiwrap&amp;quot; should be configured to start at least as many processes as there are cameras. It can be done by adjusting DAEMON_OPTS in &amp;quot;/etc/default/fcgiwrap&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
nano /etc/default/fcgiwrap&lt;br /&gt;
&lt;br /&gt;
Enter (change the 1 to the number of cameras)&lt;br /&gt;
&lt;br /&gt;
DAEMON_OPTS=&amp;quot;-f -c 1&amp;quot; &lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_17.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15514</id>
		<title>Ubuntu Server 17.04 64-bit with Zoneminder 1.30.4 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_17.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&amp;diff=15514"/>
		<updated>2019-03-18T21:19:42Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
Ubuntu Server 17.04 with Zoneminder 1.30.4&lt;br /&gt;
&lt;br /&gt;
Use the instructions for Ubuntu 16.04 with Zoneminder 1.30.4&lt;br /&gt;
&lt;br /&gt;
https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.4_the_easy_way&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_17.04_64-bit_with_Zoneminder_1.30.0_the_easy_way&amp;diff=15513</id>
		<title>Ubuntu Server 17.04 64-bit with Zoneminder 1.30.0 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_17.04_64-bit_with_Zoneminder_1.30.0_the_easy_way&amp;diff=15513"/>
		<updated>2019-03-18T21:19:26Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
Use the procedure for Ubuntu 16.10&lt;br /&gt;
&lt;br /&gt;
[[Ubuntu Server 16.10 64-bit with Zoneminder 1.30.0 the easy way]]&lt;br /&gt;
&lt;br /&gt;
Note: PATH_ZMS is already set to /zm/cgi-bin/nph-zms&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.10_64-bit_server_with_Zoneminder_to_use_systemd&amp;diff=15512</id>
		<title>Ubuntu Server 14.10 64-bit server with Zoneminder to use systemd</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.10_64-bit_server_with_Zoneminder_to_use_systemd&amp;diff=15512"/>
		<updated>2019-03-18T21:19:09Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
This is a how-to for setting up Ubuntu 14.10 server with Zoneminder to use systemd. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note (25APR15): It has been reported that this procedure will work to get ZM 1.28.1 running on Ubuntu 15.04&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
By default, init is enabled in Ubuntu 14.10. You may install and run Zoneminder without making any changes to how programs are started. However, &lt;br /&gt;
&lt;br /&gt;
Ubuntu will, in time, move to systemd. So it is a good idea to know how to make Zoneminder work!&lt;br /&gt;
&lt;br /&gt;
1. Install Ubuntu 14.10 server including LAMP Server and OpenSSH Server.&lt;br /&gt;
&lt;br /&gt;
2. Install Zoneminder. You may use either the install procedures for any of the supported versions but we did this with ZM 1.28.0 from the iconnor &lt;br /&gt;
&lt;br /&gt;
PPA. http://www.zoneminder.com/wiki/index.php/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.28.0_the_easy_way&lt;br /&gt;
&lt;br /&gt;
Note: We will explore installing Zoneminder on a system already running systemd as time permits and post the results in this WIKI.&lt;br /&gt;
&lt;br /&gt;
3. Log into Ubuntu and become root&lt;br /&gt;
&lt;br /&gt;
   sudo su&lt;br /&gt;
&lt;br /&gt;
4. Install additional systemd components&lt;br /&gt;
&lt;br /&gt;
   apt-get install systemd-sysv&lt;br /&gt;
&lt;br /&gt;
5. Re-boot the server. Log back in as root&lt;br /&gt;
&lt;br /&gt;
6. Check that systemd is running&lt;br /&gt;
&lt;br /&gt;
   ps -p 1 -o comm=   should return systemd&lt;br /&gt;
&lt;br /&gt;
7. Create a file called zoneminder.service&lt;br /&gt;
&lt;br /&gt;
   nano /lib/systemd/system/zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Paste or enter the following:&lt;br /&gt;
&lt;br /&gt;
  # ZoneMinder systemd unit file&lt;br /&gt;
  # This file is intended to work with all Linux distributions&lt;br /&gt;
  [Unit]&lt;br /&gt;
  Description=ZoneMinder CCTV recording and security system&lt;br /&gt;
  After=network.target mysql.service apache2.service&lt;br /&gt;
  Requires=mysql.service apache2.service&lt;br /&gt;
  [Service]&lt;br /&gt;
  User=www-data&lt;br /&gt;
  Type=forking&lt;br /&gt;
  ExecStart=/usr/bin/zmpkg.pl start&lt;br /&gt;
  ExecReload=/usr/bin/zmpkg.pl restart&lt;br /&gt;
  ExecStop=/usr/bin/zmpkg.pl stop&lt;br /&gt;
  PIDFile=&amp;quot;/run/zm/zm.pid&amp;quot;&lt;br /&gt;
  [Install]&lt;br /&gt;
  WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
CTRL+o to save the file&lt;br /&gt;
CTRL+x to exit nano&lt;br /&gt;
&lt;br /&gt;
8. Create a file called zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
  nano /etc/tmpfiles.d/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Paste or enter the following&lt;br /&gt;
&lt;br /&gt;
  d /var/run/zm 0755 www-data www-data&lt;br /&gt;
&lt;br /&gt;
CTRL+o to save the file&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit nano&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;IMPORTANT:&amp;#039;&amp;#039;&amp;#039; If ZoneMinder complains on startup that the /var/run/zm folder is missing, that means you have skipped this step!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Change permissions on the file&lt;br /&gt;
&lt;br /&gt;
  chmod 755 /etc/tmpfiles.d/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;IMPORTANT:&amp;#039;&amp;#039;&amp;#039; At this point the /var/run/zm directory has not been created. You may restart the PC which will create the directory or create it manually with the command &amp;quot;mkdir /var/run/zm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
10. Enable Zoneminder&lt;br /&gt;
&lt;br /&gt;
   systemctl enable zoneminder.service&lt;br /&gt;
&lt;br /&gt;
11. Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
   systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
12. Check to see that Zoneminder is running&lt;br /&gt;
&lt;br /&gt;
   systemctl status zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Thanks to Isaac Connor, Andrew Bauer and Carla Schroder for the pieces that allowed this puzzle to go together.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.28.1_the_easy_way&amp;diff=15511</id>
		<title>Ubuntu Server 14.04 64-bit with Zoneminder 1.28.1 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.28.1_the_easy_way&amp;diff=15511"/>
		<updated>2019-03-18T21:18:53Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;As of 05FEB16 this guide is obsolete. Please use the install instruction for Zoneminder 1.29.0&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
https://wiki.zoneminder.com/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.29.0_the_easy_way&lt;br /&gt;
&lt;br /&gt;
Zoneminder 1.28.1 on Ubuntu 14.04. Should also works on Ubuntu 14.10 running init.&lt;br /&gt;
&lt;br /&gt;
22OCT15 Returned this to original version as 1.28.1 has been returned to the iconnor PPA&lt;br /&gt;
&lt;br /&gt;
I did this install on a 64 BIT server but it should work on 32 BIT. As of 20FEB15 I have tested this with a local USB camera and a remote h.264 camera with Ffmpeg and Libvlc.&lt;br /&gt;
&lt;br /&gt;
If you install from CD install Ubuntu Server, OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)&lt;br /&gt;
&lt;br /&gt;
If you use the minimum ISO CD install Basic Server, OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)&lt;br /&gt;
&lt;br /&gt;
Log in then become root:&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
If you used the server install CD&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Optional: Set static IP address&lt;br /&gt;
&lt;br /&gt;
 nano /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Make changes similar to this:&lt;br /&gt;
&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
   address 192.168.1.10&lt;br /&gt;
   netmask 255.255.255.0&lt;br /&gt;
   gateway 192.168.1.1&lt;br /&gt;
   dns-nameservers 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
Note: for Ubuntu 14.04 the resolv.conf is dynamically assigned. The &amp;quot;dns-servers&amp;quot; entry in the interfaces file will set the DNS Multiple DNS server entries can be used.&lt;br /&gt;
&lt;br /&gt;
Reboot server&lt;br /&gt;
&lt;br /&gt;
Log in and become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Suggested changes to MySQL&lt;br /&gt;
&lt;br /&gt;
For most of you Zoneminder will run just fine with the default MySQL settings. There are a couple of settings that may, in time, provide beneficial especially if you have a number of cameras and many events with a lot of files. One setting I recommend is the &amp;quot;innodb_file_per_table&amp;quot; This will be a default setting in MySQL 5.6 but should be added in MySQL 5.5 which comes with Ubuntu 14.04. A description can be found here: http://dev.mysql.com/doc/refman/5.5/en/innodb-multiple-tablespaces.html&lt;br /&gt;
&lt;br /&gt;
To add &amp;quot;innodb_file_per_table&amp;quot; edit the my.cnf file:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Under [mysqld] add&lt;br /&gt;
&lt;br /&gt;
 innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 service mysql restart&lt;br /&gt;
&lt;br /&gt;
As you add cameras to your system and the events build up you may need to increase the size of the &amp;quot;innodb_buffer_pool_size&amp;quot; when this setting runs out of space your system may act like it is out of disk space. One way to check this is to install mysqltuner and run it from the command line. When the results are shown you can edit the my.cnf file and change the buffer size. The default &amp;quot;innodb_buffer_pool_size&amp;quot; is 128M. In the ZM forum I have found a recommended setting of 256M. My production server required a setting greater than 410M. Install and run mysqltuner to determine the recommended size for your system. Be sure to restart MySQL after making changes.&lt;br /&gt;
&lt;br /&gt;
Add Repository&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder&lt;br /&gt;
&lt;br /&gt;
Note: a couple of package configurations will open up. These are to configure Nullmailer. You can just OK them and come back to configure them later.	&lt;br /&gt;
&lt;br /&gt;
Add delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
    sleep 15&lt;br /&gt;
    echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Create a symbolic links&lt;br /&gt;
&lt;br /&gt;
 ln -s /etc/zm/apache.conf /etc/apache2/conf-enabled/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
CGI is not enabled in Ubuntu 14.04 by default. Enable it this way:&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/apache2 force-reload &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 service apache2 restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Cambozola (needed if you use Internet Explorer)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 cd /usr/src &amp;amp;&amp;amp; wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
 tar -xzvf cambozola-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
 replace 936 with cambozola version downloaded&lt;br /&gt;
&lt;br /&gt;
 cp cambozola-0.936/dist/cambozola.jar /usr/share/zoneminder&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the web server using https://servername&lt;br /&gt;
&lt;br /&gt;
NTP Daily Sync&lt;br /&gt;
&lt;br /&gt;
 nano /etc/cron.daily/ntpdate&lt;br /&gt;
&lt;br /&gt;
Copy the following into nano&lt;br /&gt;
&lt;br /&gt;
 !/bin/sh ntpdate ntp.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
 chmod 755 /etc/cron.daily/ntpdate&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in web browser&lt;br /&gt;
&lt;br /&gt;
http://serverip/zm&lt;br /&gt;
&lt;br /&gt;
Click Options&lt;br /&gt;
&lt;br /&gt;
Uncheck: Check with zoneminder.com for updated versions (?) click Save&lt;br /&gt;
&lt;br /&gt;
Click Images tab&lt;br /&gt;
&lt;br /&gt;
check Is the (optional) cambozola java streaming client installed (?) Click Save&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_19.04_Zoneminder_1.32.3&amp;diff=15510</id>
		<title>Ubuntu Server 19.04 Zoneminder 1.32.3</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_19.04_Zoneminder_1.32.3&amp;diff=15510"/>
		<updated>2019-03-18T21:18:28Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This procedure is obsolete. Please see:&lt;br /&gt;
 http://www.zoneminder.com/wiki/index.php/Ubuntu#Guides_for_Ubuntu_Server&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Zoneminder ppa contains version 1.28.107 as of 15OCT15&lt;br /&gt;
&lt;br /&gt;
Zoneminder 1.28.1 on Ubuntu 14.04. Also works on Ubuntu 14.10 running init.&lt;br /&gt;
&lt;br /&gt;
I did this install on a 64 BIT server but it should work on 32 BIT. As of 20OCT14 I have tested this with a local USB camera and a remote h.264 camera with Ffmpeg and Libvlc.&lt;br /&gt;
&lt;br /&gt;
If you install from CD install Ubuntu Server, OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)&lt;br /&gt;
&lt;br /&gt;
If you use the minimum ISO CD install Basic Server, OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)&lt;br /&gt;
&lt;br /&gt;
Log in then become root:&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
If you used the server install CD&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Optional: Set static IP address&lt;br /&gt;
&lt;br /&gt;
 nano /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Make changes similar to this:&lt;br /&gt;
&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
   address 192.168.1.10&lt;br /&gt;
   netmask 255.255.255.0&lt;br /&gt;
   gateway 192.168.1.1&lt;br /&gt;
   dns-nameservers 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
Note: for Ubuntu 14.04 the resolv.conf is dynamically assigned. The &amp;quot;dns-servers&amp;quot; entry in the interfaces file will set the DNS Multiple DNS server entries can be used.&lt;br /&gt;
&lt;br /&gt;
Reboot server&lt;br /&gt;
&lt;br /&gt;
Log in and become root &lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Suggested changes to MySQL&lt;br /&gt;
&lt;br /&gt;
For most of you Zoneminder will run just fine with the default MySQL settings. There are a couple of settings that may, in time, provide beneficial especially if you have a number of cameras and many events with a lot of files. One setting I recommend is the &amp;quot;innodb_file_per_table&amp;quot; This will be a default setting in MySQL 5.6 but should be added in MySQL 5.5 which comes with Ubuntu 14.04. A description can be found here: http://dev.mysql.com/doc/refman/5.5/en/innodb-multiple-tablespaces.html &lt;br /&gt;
&lt;br /&gt;
To add &amp;quot;innodb_file_per_table&amp;quot; edit the my.cnf file:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Under [mysqld] add&lt;br /&gt;
&lt;br /&gt;
 innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 service mysql restart&lt;br /&gt;
&lt;br /&gt;
As you add cameras to your system and the events build up you may need to increase the size of the &amp;quot;innodb_buffer_pool_size&amp;quot; when this setting runs out of space your system may act like it is out of disk space. One way to check this is to install mysqltuner and run it from the command line. When the results are shown you can edit the my.cnf file and change the buffer size. The default &amp;quot;innodb_buffer_pool_size&amp;quot; is 128M. In the ZM forum I have found a recommended setting of 256M. My production server required a setting greater than 410M. Install and run mysqltuner to determine the recommended size for your system. Be sure to restart MySQL after making changes.&lt;br /&gt;
&lt;br /&gt;
CGI is not enabled in Ubuntu 14.04 by default. Enable it this way:&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/apache2 force-reload &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 service apache2 restart&lt;br /&gt;
&lt;br /&gt;
Add Repository&lt;br /&gt;
&lt;br /&gt;
 apt-get install software-properties-common python-software-properties&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder&lt;br /&gt;
&lt;br /&gt;
Note: a couple of package configurations will open up. These are to configure Nullmailer. You can just OK them and come back to configure them later.	&lt;br /&gt;
&lt;br /&gt;
You will need to install &amp;quot;extra&amp;quot; VLC components torun Libvlc (verified 20OCT14)&lt;br /&gt;
&lt;br /&gt;
 apt-get install libvlc-dev libvlccore-dev vlc&lt;br /&gt;
&lt;br /&gt;
Add delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
       sleep 15&lt;br /&gt;
       echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Create a symbolic link to zoneminder&amp;#039;s apache config file.  Since Ubuntu includes tools to enable/disable conf files,&lt;br /&gt;
do so the &amp;#039;Ubuntu way&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 ln -s /etc/zm/apache.conf /etc/apache2/conf-available/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Now, enable the zoneminder apache config file:&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/apache2 force-reload &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 service apache2 restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Cambozola (needed if you use Internet Explorer)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 cd /usr/src &amp;amp;&amp;amp; wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
 tar -xzvf cambozola-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
replace 935 in the next line with cambozola version downloaded&lt;br /&gt;
&lt;br /&gt;
 cp cambozola-0.935/dist/cambozola.jar /usr/share/zoneminder&lt;br /&gt;
&lt;br /&gt;
You should now be able to access the web server using https://servername&lt;br /&gt;
&lt;br /&gt;
NTP Daily Sync&lt;br /&gt;
&lt;br /&gt;
 nano /etc/cron.daily/ntpdate&lt;br /&gt;
&lt;br /&gt;
Copy the following into nano&lt;br /&gt;
&lt;br /&gt;
 !/bin/sh &lt;br /&gt;
 ntpdate ntp.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
 chmod 755 /etc/cron.daily/ntpdate&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in web browser&lt;br /&gt;
&lt;br /&gt;
http://serverip/zm&lt;br /&gt;
&lt;br /&gt;
Click Options&lt;br /&gt;
&lt;br /&gt;
Uncheck: Check with zoneminder.com for updated versions (?) click Save&lt;br /&gt;
&lt;br /&gt;
Click Images tab&lt;br /&gt;
&lt;br /&gt;
check Is the (optional) cambozola java streaming client installed (?) Click Save&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_or_Desktop_Zoneminder_1.36.x&amp;diff=15509</id>
		<title>Ubuntu Server or Desktop Zoneminder 1.36.x</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_or_Desktop_Zoneminder_1.36.x&amp;diff=15509"/>
		<updated>2019-03-18T21:18:07Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
I have tested Zoneminder under the Ubuntu 12.04 and 13.04 64-bit versions. My reason for doing this was to be able to install a remote control package, such as Teamviewer, to access the PC behind firewalls where I was unable to set up dynamic DNS or port forwarding. I was able to connect to the PC, open Firefox and work with all functions of Zoneminder including viewing events.&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder from the desktop CD or DVD or a USB thumbdrive (see http://www.pendrivelinux.com/)&lt;br /&gt;
&lt;br /&gt;
Open the terminal&lt;br /&gt;
&lt;br /&gt;
become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
install tasksel&lt;br /&gt;
&lt;br /&gt;
 apt-get install tasksel&lt;br /&gt;
&lt;br /&gt;
Start tasksel&lt;br /&gt;
&lt;br /&gt;
 tasksel&lt;br /&gt;
&lt;br /&gt;
Check the option to install LAMP&lt;br /&gt;
&lt;br /&gt;
Follow the instructions at:&lt;br /&gt;
&lt;br /&gt;
[[Ubuntu Server 12.04 64-bit with Zoneminder 1.25.0 the easy way]]&lt;br /&gt;
&lt;br /&gt;
Start at Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
[[Ubuntu Server 12.04 64-bit with Zoneminder 1.26.5 the easy way]]&lt;br /&gt;
&lt;br /&gt;
Start at: Install PPA Repository for Zoneminder&lt;br /&gt;
&lt;br /&gt;
When Zoneminder is installed, open Firefox and enter: http://localhost/zm  &lt;br /&gt;
to configure Zoneminder.&lt;br /&gt;
&lt;br /&gt;
Install the remote control package of your choice to access your PC from the internet.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_or_Desktop_Zoneminder_1.38.x&amp;diff=15508</id>
		<title>Ubuntu Server or Desktop Zoneminder 1.38.x</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_or_Desktop_Zoneminder_1.38.x&amp;diff=15508"/>
		<updated>2019-03-18T21:17:48Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This readme file is for the Zoneminder 1.30.0/Lubuntu 16.04 Live DVD/USB system.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
There is a 64 BIT version of the system. File names:&lt;br /&gt;
&lt;br /&gt;
live-cd.iso&lt;br /&gt;
live-cd-readme.txt&lt;br /&gt;
&lt;br /&gt;
Direct download the .iso file: https://1drv.ms/f/s!ApMZyp0q7cregdQO8OI_rIIaS-GTBQ&lt;br /&gt;
&lt;br /&gt;
You can burn the files to DVD, start a PC from the DVD and run/install the system.&lt;br /&gt;
&lt;br /&gt;
You can also make a bootable USB. I recommend using Unetbootin (http://unetbootin.github.io/). This is what I used to&lt;br /&gt;
make a bootable USB. Other programs may work but have not been tested.&lt;br /&gt;
&lt;br /&gt;
When you boot the system Lubuntu will open to the desktop. Should a login page come up enter the user enter &amp;quot;ubuntu&amp;quot; and leave the password blank.&lt;br /&gt;
You must log into Lubuntu to run the installer! This version contains Network Manager to manage network connections.&lt;br /&gt;
&lt;br /&gt;
Apache, Mariadb Server and Zoneminder 1.30.0 will run on startup. &lt;br /&gt;
&lt;br /&gt;
To access Zoneminder open Firefox and enter http://localhost/zm &lt;br /&gt;
You can also access Zoneminder from another PC using the IP-Address of the system: http://IP-Address/zm&lt;br /&gt;
&lt;br /&gt;
If your install does not get the DNS servers via DHCP it is likely that a symbolic link is missing. You can set a static IP address with nameservers or create the symbolic link with this entry:&lt;br /&gt;
&lt;br /&gt;
 sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf&lt;br /&gt;
&lt;br /&gt;
Zoneminder is configured with one monitor set to a public camera and, if the system has internet access, should be viewable. You may reconfigure this camera to one of your own. &lt;br /&gt;
&lt;br /&gt;
This system contains an installer which you can use to install this fully functioning Lubuntu/Zoneminder system to your hard drive. When installed to your hard drive you can access Zoneminder using Firefox or a web browser from another PC. &lt;br /&gt;
I&amp;#039;ve had an issue where the installer will crash and not finish the install. A work around is to run the installer with root privileges from a terminal.&lt;br /&gt;
&lt;br /&gt;
Open a terminal - System Tools - LXTerminal and enter&lt;br /&gt;
&lt;br /&gt;
 sudo sh -c &amp;#039;ubiquity gtk_ui&amp;#039;&lt;br /&gt;
&lt;br /&gt;
and press Enter. Do not check any options when the &amp;#039;Preparing to install Ubuntu&amp;#039; screen appears. &lt;br /&gt;
&lt;br /&gt;
Time Zone: you may have to edit the php.ini to correct the time zone entry. See the WIKI for instructions on editing this file. &lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.0/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Updates: As this is a minimal Lubuntu install the software updater is not provided. To update the installation open a terminal and run:&lt;br /&gt;
&lt;br /&gt;
 sudo apt update&lt;br /&gt;
 sudo apt upgrade&lt;br /&gt;
 sudo apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
About the system:&lt;br /&gt;
&lt;br /&gt;
Install was from Ubuntu 16.04 Minimal CD with Lubuntu Minimal, LAMP with Mariadb Server and OpenSSL. &lt;br /&gt;
&lt;br /&gt;
The root password for MySQL is &amp;quot;Passwordzm&amp;quot; Recommend you change the password after you install to hard drive:&lt;br /&gt;
(http://www.liquidweb.com/kb/change-a-password-for-mysql-on-linux-via-command-line/)&lt;br /&gt;
&lt;br /&gt;
Zoneminder was installed using: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.0_the_easy_way&lt;br /&gt;
&lt;br /&gt;
Lubuntu Minimal Desktop was installed with Forefox and network manager added afterwards.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_18.04_64-bit_with_Zoneminder_1.32.x_the_easy_way&amp;diff=15507</id>
		<title>Ubuntu Server 18.04 64-bit with Zoneminder 1.32.x the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_18.04_64-bit_with_Zoneminder_1.32.x_the_easy_way&amp;diff=15507"/>
		<updated>2019-03-18T21:17:00Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Things to check before installing Zoneminder on Bionic!===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;We recommend you read the release notes to see what has changed in this version. The release notes can be found here: https://github.com/ZoneMinder/zoneminder/releases&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;There have been some reports of the install failing. We feel this is due to missing repositories in the sources.list. You can check this by running&lt;br /&gt;
&lt;br /&gt;
 nano /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Look for the universe repositories of which there should be three, bionic universe, bionic-updates universe and bionic-security universe&lt;br /&gt;
&lt;br /&gt;
See: https://help.ubuntu.com/community/Repositories/CommandLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Install Zoneminder on Ubuntu 18.04 with shell script===&lt;br /&gt;
&lt;br /&gt;
This will install Zoneminder by using a shell script with one basic command (how easy is that!).&lt;br /&gt;
&lt;br /&gt;
You will need a Ubuntu 18.04 install with LAMP (Apache, MySQL and PHP) installed desktop or server. As an alternate you may use Mariadb in lieu of MySQL&lt;br /&gt;
&lt;br /&gt;
Shell script file contents:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;This script installs Zoneminder 1.32.x on Ubuntu 18.04 AMD64 with LAMP (MySQL) installed...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;You must be logged in as root using sudo su ...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Next we will add the PPA repository, install and configure the system to run Zoneminder. &lt;br /&gt;
 Press enter to continue&amp;quot; nothing&lt;br /&gt;
 apt install -y software-properties-common&lt;br /&gt;
 clear&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder-1.32&lt;br /&gt;
 apt update&lt;br /&gt;
 clear&lt;br /&gt;
 awk &amp;#039;$0=&amp;quot;date.timezone = &amp;quot;$0&amp;#039; /etc/timezone &amp;gt;&amp;gt; /etc/php/7.2/apache2/php.ini&lt;br /&gt;
 clear&lt;br /&gt;
 apt install -y zoneminder&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Install complete.Press enter to continue&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
&lt;br /&gt;
Copy the contents of the script, open a terminal and run:&lt;br /&gt;
&lt;br /&gt;
 nano zm-install&lt;br /&gt;
&lt;br /&gt;
Paste the contents of the script into Nano&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
 Ctrl + o&lt;br /&gt;
 Ctrl + x&lt;br /&gt;
&lt;br /&gt;
Next run:&lt;br /&gt;
&lt;br /&gt;
 chmod 755 zm-install&lt;br /&gt;
&lt;br /&gt;
Start the script by entering:&lt;br /&gt;
&lt;br /&gt;
 ./zm-install&lt;br /&gt;
&lt;br /&gt;
Follow the prompts. Things are pretty simple. The timezone will be detected from the OS and added to the php.ini.&lt;br /&gt;
&lt;br /&gt;
Good Luck! &lt;br /&gt;
&lt;br /&gt;
While this script worked for me I can&amp;#039;t be responsible if you loose data when you run this. It is intended for a new install not an upgrade.&lt;br /&gt;
&lt;br /&gt;
===Install Apache2, Mariadb, PHP and Zoneminder on Ubuntu 18.04 with shell script===&lt;br /&gt;
&lt;br /&gt;
I created this to install Zoneminder on a Raspberry Pi 3B+ 64 BIT version of Bionic. Should work with other flavors of Bionic&lt;br /&gt;
&lt;br /&gt;
See above for use&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;This script installs Apache2, Mariadb Server, PHP and Zoneminder 1.32.x on Ubuntu 18.04 ...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;You must be logged in as root using sudo su ...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 apt install -y apache2 php mariadb-server php-mysql libapache2-mod-php7.2&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Next secure MySQL server by entering requested information. Press enter to continue&amp;quot; nothing&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Next we will add the PPA repository, install and configure the system to run Zoneminder. &lt;br /&gt;
 Press enter to continue&amp;quot; nothing&lt;br /&gt;
 apt install -y software-properties-common&lt;br /&gt;
 clear&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder-1.32&lt;br /&gt;
 apt update&lt;br /&gt;
 clear&lt;br /&gt;
 awk &amp;#039;$0=&amp;quot;date.timezone = &amp;quot;$0&amp;#039; /etc/timezone &amp;gt;&amp;gt; /etc/php/7.2/apache2/php.ini&lt;br /&gt;
 clear&lt;br /&gt;
 apt install -y zoneminder&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Install complete.Press enter to continue&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 18.04 LEMP (NGNIX, Mariadb, PHP)===&lt;br /&gt;
&lt;br /&gt;
Thanks to &amp;quot;terdinglage&amp;quot; for the input to get this to work!&lt;br /&gt;
&lt;br /&gt;
Start with a basic Ubuntu 18.04 install. You can use a server or desktop install. Do not install LAMP!&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Install Ngnix, Mariadb and PHP components&lt;br /&gt;
&lt;br /&gt;
 apt install nginx mariadb-server php-fpm php-mysql fcgiwrap&lt;br /&gt;
&lt;br /&gt;
Secure the Mariadb server&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Restart Mariadb&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Edit the php.ini file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.2/fpm/php.ini&lt;br /&gt;
&lt;br /&gt;
Locate (Ctrl+w) cgi.fix_pathinfo=1 and change to&lt;br /&gt;
&lt;br /&gt;
 cgi.fix_pathinfo=0&lt;br /&gt;
&lt;br /&gt;
Remember to remove the leading ;&lt;br /&gt;
&lt;br /&gt;
Also fix date. Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart php-fpm&lt;br /&gt;
&lt;br /&gt;
 systemctl restart php7.2-fpm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add Repository&lt;br /&gt;
&lt;br /&gt;
NOTE:You may need to run: &amp;quot;apt install software-properties-common&amp;quot; if you did the minimal net install of Ubuntu.&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder-1.32&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install zoneminder&lt;br /&gt;
&lt;br /&gt;
Create a new user if you plan to use local (USB or capture card) cameras.&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Change the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/ &lt;br /&gt;
&lt;br /&gt;
 nano /etc/zm/conf.d/01-system-paths.conf&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edit the Ngnix default configuration. &lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/sites-available/default&lt;br /&gt;
&lt;br /&gt;
Locate the line &amp;quot;index index.html index.htm index.nginx-debian.html;&amp;quot; and add index.php&lt;br /&gt;
&lt;br /&gt;
 index index.php index.html index.htm index.nginx-debian.html;&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;server&amp;quot; section after listen [::] :80 default_Server; add&lt;br /&gt;
&lt;br /&gt;
 include /etc/nginx/zoneminder.conf;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Create a Zoneminder conf file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Enter the following into the zoneminder.conf file (This file was improved by databoy2k)&lt;br /&gt;
&lt;br /&gt;
 location /cgi-bin {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         alias /usr/lib/zoneminder/cgi-bin;     &lt;br /&gt;
         include fastcgi_params;&lt;br /&gt;
         fastcgi_param SCRIPT_FILENAME $request_filename;&lt;br /&gt;
         fastcgi_param HTTP_PROXY &amp;quot;&amp;quot;;&lt;br /&gt;
         fastcgi_pass unix:/var/run/fcgiwrap.socket;&lt;br /&gt;
 }&lt;br /&gt;
 location /zm/cache {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         alias /var/cache/zoneminder/cache;&lt;br /&gt;
 }&lt;br /&gt;
 location ~ /zm/api/(css|img|ico) {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         rewrite ^/zm/api(.+)$ /api/app/webroot/$1 break;&lt;br /&gt;
         try_files $uri $uri/ =404;&lt;br /&gt;
 }&lt;br /&gt;
 location /zm {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         alias /usr/share/zoneminder/www;&lt;br /&gt;
         try_files $uri $uri/ /index.php?$args =404;    &lt;br /&gt;
         location /zm/api {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
                 rewrite ^/zm/api(.+)$ /zm/api/app/webroot/index.php?p=$1 last;&lt;br /&gt;
          }&lt;br /&gt;
                 location ~ \.php$ {&lt;br /&gt;
                 auth_basic off;&lt;br /&gt;
                         include fastcgi_params;&lt;br /&gt;
                         fastcgi_param SCRIPT_FILENAME $request_filename;&lt;br /&gt;
                         fastcgi_param HTTP_PROXY &amp;quot;&amp;quot;;&lt;br /&gt;
                 fastcgi_index index.php;&lt;br /&gt;
                         fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart Ngnix&lt;br /&gt;
&lt;br /&gt;
 service nginx restart&lt;br /&gt;
&lt;br /&gt;
Note: If Nginx gives you an error on restart go back one step and re-enter include /etc/ngnix/zoneminder.conf;&lt;br /&gt;
&lt;br /&gt;
Note: 29JUL18 Thanks to Tiver for this suggestion that seems to work with the fcgiwrap issue.&lt;br /&gt;
&lt;br /&gt;
If it does not exist create &lt;br /&gt;
&lt;br /&gt;
 nano /etc/default/fcgiwrap&lt;br /&gt;
&lt;br /&gt;
and insert (with the number of children -c equal to the number of cameras)&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTS=-c 10&lt;br /&gt;
&lt;br /&gt;
then restart the fcgiwrap service.&lt;br /&gt;
&lt;br /&gt;
 systemctl restart fcgiwrap&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.32.x_the_easy_way&amp;diff=15506</id>
		<title>Ubuntu Server 16.04 64-bit with Zoneminder 1.32.x the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.32.x_the_easy_way&amp;diff=15506"/>
		<updated>2019-03-18T21:16:22Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===02OCT18 A new version, 1.32.1 is released.===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;We recommend you read the release notes to see what has changed in this version. The release notes can be found here: https://github.com/ZoneMinder/zoneminder/releases&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
===Install Zoneminder on Ubuntu 16.04 with shell script===&lt;br /&gt;
&lt;br /&gt;
This will install Zoneminder by using a shell script with one basic command (how easy is that!).&lt;br /&gt;
&lt;br /&gt;
You will need a Ubuntu 16.04 install with LAMP (Apache, MySQL and PHP) installed desktop or server. As an alternate you may use Mariadb in lieu of MySQL&lt;br /&gt;
&lt;br /&gt;
Shell script file contents:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;This script installs Zoneminder 1.32.x on Ubuntu 16.04 AMD64 with LAMP (MySQL) installed...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;You must be logged in as root using sudo su ...&lt;br /&gt;
 Press Enter to continue or Ctrl + c to quit&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Next we will add the PPA repository, install and configure the system to run Zoneminder. You will have to press enter twice to load two PPA repositories.&lt;br /&gt;
 Press enter to continue&amp;quot; nothing&lt;br /&gt;
 apt install -y software-properties-common&lt;br /&gt;
 clear&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder-1.32&lt;br /&gt;
 apt update&lt;br /&gt;
 clear&lt;br /&gt;
 awk &amp;#039;$0=&amp;quot;date.timezone = &amp;quot;$0&amp;#039; /etc/timezone &amp;gt;&amp;gt; /etc/php/7.0/apache2/php.ini&lt;br /&gt;
 clear&lt;br /&gt;
 apt install -y zoneminder&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
 clear&lt;br /&gt;
 read -p &amp;quot;Install complete.Press enter to continue&amp;quot; nothing&lt;br /&gt;
 clear&lt;br /&gt;
&lt;br /&gt;
Copy the contents of the script, open a terminal and run:&lt;br /&gt;
&lt;br /&gt;
 nano zm-install&lt;br /&gt;
&lt;br /&gt;
Paste the contents of the script into Nano&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
 Ctrl + o&lt;br /&gt;
 Ctrl + x&lt;br /&gt;
&lt;br /&gt;
Next run:&lt;br /&gt;
&lt;br /&gt;
 chmod 755 zm-install&lt;br /&gt;
&lt;br /&gt;
Start the script by entering:&lt;br /&gt;
&lt;br /&gt;
 ./zm-install&lt;br /&gt;
&lt;br /&gt;
Follow the prompts. Things are pretty simple. The timezone will be detected from the OS and added to the php.ini.&lt;br /&gt;
&lt;br /&gt;
Good Luck! &lt;br /&gt;
&lt;br /&gt;
While this script worked for me I can&amp;#039;t be responsible if you loose data when you run this. It is intended for a new install not an upgrade.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04 LEMP (NGNIX, Mariadb, PHP)===&lt;br /&gt;
&lt;br /&gt;
This is not quite ready to use. Figuring out why video does not display... 09JAN19&lt;br /&gt;
&lt;br /&gt;
Thanks to &amp;quot;terdinglage&amp;quot; for the input to get this to work!&lt;br /&gt;
&lt;br /&gt;
Start with a basic Ubuntu 18.04 install. You can use a server or desktop install. Do not install LAMP!&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Install Ngnix, Mariadb and PHP components&lt;br /&gt;
&lt;br /&gt;
 apt install nginx mariadb-server php-fpm php-mysql fcgiwrap&lt;br /&gt;
&lt;br /&gt;
Secure the Mariadb server&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Restart Mariadb&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Edit the php.ini file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.0/fpm/php.ini&lt;br /&gt;
&lt;br /&gt;
Locate (Ctrl+w) cgi.fix_pathinfo=1 and change to&lt;br /&gt;
&lt;br /&gt;
 cgi.fix_pathinfo=0&lt;br /&gt;
&lt;br /&gt;
Remember to remove the leading ;&lt;br /&gt;
&lt;br /&gt;
Also fix date. Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart php-fpm&lt;br /&gt;
&lt;br /&gt;
 systemctl restart php7.0-fpm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add two iconnor/Zoneminder Repository&amp;#039;s (to pick up dependencies)&lt;br /&gt;
&lt;br /&gt;
NOTE:You may need to run: &amp;quot;apt install software-properties-common&amp;quot; if you did the minimal net install of Ubuntu.&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder-1.32&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install zoneminder&lt;br /&gt;
&lt;br /&gt;
Create a new user if you plan to use local (USB or capture card) cameras.&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Change the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/ &lt;br /&gt;
&lt;br /&gt;
 nano /etc/zm/conf.d/01-system-paths.conf&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Edit the Ngnix default configuration. &lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/sites-available/default&lt;br /&gt;
&lt;br /&gt;
Locate the line &amp;quot;index index.html index.htm index.nginx-debian.html;&amp;quot; and add index.php&lt;br /&gt;
&lt;br /&gt;
 index index.php index.html index.htm index.nginx-debian.html;&lt;br /&gt;
&lt;br /&gt;
In the &amp;quot;server&amp;quot; section after listen [::] :80 default_Server; add&lt;br /&gt;
&lt;br /&gt;
 include /etc/nginx/zoneminder.conf;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Create a Zoneminder conf file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/nginx/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Enter the following into the zoneminder.conf file (This file was improved by databoy2k)&lt;br /&gt;
&lt;br /&gt;
 location /cgi-bin {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         alias /usr/lib/zoneminder/cgi-bin;     &lt;br /&gt;
         include fastcgi_params;&lt;br /&gt;
         fastcgi_param SCRIPT_FILENAME $request_filename;&lt;br /&gt;
         fastcgi_param HTTP_PROXY &amp;quot;&amp;quot;;&lt;br /&gt;
         fastcgi_pass unix:/var/run/fcgiwrap.socket;&lt;br /&gt;
 }&lt;br /&gt;
 location /zm/cache {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         alias /var/cache/zoneminder/cache;&lt;br /&gt;
 }&lt;br /&gt;
 location ~ /zm/api/(css|img|ico) {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         rewrite ^/zm/api(.+)$ /api/app/webroot/$1 break;&lt;br /&gt;
         try_files $uri $uri/ =404;&lt;br /&gt;
 }&lt;br /&gt;
 location /zm {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
         alias /usr/share/zoneminder/www;&lt;br /&gt;
         try_files $uri $uri/ /index.php?$args =404;    &lt;br /&gt;
         location /zm/api {&lt;br /&gt;
 auth_basic off;&lt;br /&gt;
                 rewrite ^/zm/api(.+)$ /zm/api/app/webroot/index.php?p=$1 last;&lt;br /&gt;
          }&lt;br /&gt;
                 location ~ \.php$ {&lt;br /&gt;
                 auth_basic off;&lt;br /&gt;
                         include fastcgi_params;&lt;br /&gt;
                         fastcgi_param SCRIPT_FILENAME $request_filename;&lt;br /&gt;
                         fastcgi_param HTTP_PROXY &amp;quot;&amp;quot;;&lt;br /&gt;
                 fastcgi_index index.php;&lt;br /&gt;
                         fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart Ngnix&lt;br /&gt;
&lt;br /&gt;
 service nginx restart&lt;br /&gt;
&lt;br /&gt;
Note: If Nginx gives you an error on restart go back one step and re-enter include /etc/ngnix/zoneminder.conf;&lt;br /&gt;
&lt;br /&gt;
Note: 29JUL18 Thanks to Tiver for this suggestion that seems to work with the fcgiwrap issue.&lt;br /&gt;
&lt;br /&gt;
If it does not exist create &lt;br /&gt;
&lt;br /&gt;
 nano /etc/default/fcgiwrap&lt;br /&gt;
&lt;br /&gt;
and insert (with the number of children -c equal to the number of cameras)&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTS=-c 10&lt;br /&gt;
&lt;br /&gt;
then restart the fcgiwrap service.&lt;br /&gt;
&lt;br /&gt;
 systemctl restart fcgiwrap&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_or_Desktop_Zoneminder_1.34.x&amp;diff=15505</id>
		<title>Ubuntu Server or Desktop Zoneminder 1.34.x</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_or_Desktop_Zoneminder_1.34.x&amp;diff=15505"/>
		<updated>2019-03-18T21:15:43Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
Zoneminder 1.30.4 made it into the &amp;quot;official&amp;quot; Ubuntu 18.10 repositories. You will need to install LAMP then secure MySQL before installing Zoneminder. I use a very minimum install from the 18.10 mini.iso.&lt;br /&gt;
&lt;br /&gt;
Here are the basic commands you will need. As always start from a root (sudo su) prompt.&lt;br /&gt;
&lt;br /&gt;
Secure MySQL or Mariadb&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Add entry into my.cnf&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Add the following to the end of the file&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
CTRL + o&lt;br /&gt;
CTRL +x&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install zoneminder&lt;br /&gt;
&lt;br /&gt;
The database is not created automatically. Create the database with&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p &amp;lt; /usr/share/zoneminder/db/zm_create.sql&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p reload&lt;br /&gt;
&lt;br /&gt;
Fix permissions&lt;br /&gt;
&lt;br /&gt;
 chmod 740 /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
 chown root:www-data /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Enable Zoneminder service&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Add a user for local cameras&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Enable Apache Features&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.2/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
[Date]&lt;br /&gt;
; Defines the default timezone used by the date functions&lt;br /&gt;
; http://php.net/date.timezone&lt;br /&gt;
date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Zoneminder should work! Open Zoneminder in a web browser (http://server-ip/zm).&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.32.x_the_easy_way&amp;diff=15504</id>
		<title>Ubuntu Server 14.04 64-bit with Zoneminder 1.32.x the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.32.x_the_easy_way&amp;diff=15504"/>
		<updated>2019-03-18T21:15:28Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===02OCT18 A new version, 1.32.1 is released.===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Zoneminder 1.32.1 on Ubuntu Server 14.04&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;We recommend you read the release notes to see what has changed in this version. The release notes can be found here: https://github.com/ZoneMinder/zoneminder/releases&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Install Basic Server (if you used the mini.iso), OpenSSH Server, and LAMP Server&lt;br /&gt;
&lt;br /&gt;
Log in then become root:&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Make sure you are up to date&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add Repository (if you get an error run: apt-get install software-properties-common)&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder-1.32&lt;br /&gt;
&lt;br /&gt;
Update Sources&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder&lt;br /&gt;
&lt;br /&gt;
You may be prompted to set up Nulmailer. You may accept the defaults and set this up later if you want to use it.&lt;br /&gt;
&lt;br /&gt;
Add delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 after the existing &amp;quot;start() {&amp;quot; as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
      sleep 15&lt;br /&gt;
      echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Enable CGI, Zoneminder and rewrite configuration in Apache.&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder if needed (If you get an error Zoneminder is likely running already)&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in a web browser (http://server-ip/zm).&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Common_Issues_with_Zoneminder_Installation_on_Ubuntu&amp;diff=15503</id>
		<title>Common Issues with Zoneminder Installation on Ubuntu</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Common_Issues_with_Zoneminder_Installation_on_Ubuntu&amp;diff=15503"/>
		<updated>2019-03-18T21:15:09Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
08AUG16&lt;br /&gt;
&lt;br /&gt;
With some changes “in-the-works” for Ubuntu installs by the hard working volunteers who keep Zoneminder up-to-date, it was recommended that we post fixes/instructions for some issues that continue to surface. This document will likely grow over time but may become obsolete as procedures become better documented.&lt;br /&gt;
&lt;br /&gt;
The upgrade procedures to 1.30.0 have not been fully tested for Ubuntu 15x but have been written with the knowledge of the behavior of the 1.30.0 install package. Post concerns or failures on the forum.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Zoneminder &amp;quot;Master&amp;quot; PPA&amp;#039;&amp;#039;&amp;#039; This is to remind you that software installed from the iconnor zoneminder-master PPA is BETA software and NOT recommended for production systems! BETA software may have some features that do not work correctly! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Zoneminder Database==&lt;br /&gt;
See Database Tips and Tricks for more topics: http://www.zoneminder.com/wiki/index.php/General_Notes#Database_Tricks.2FTips&lt;br /&gt;
&lt;br /&gt;
===Enable and convert MySQL to innodb_file_per_table for Zoneminder===&lt;br /&gt;
 &lt;br /&gt;
Note: You may wish to convert MyISAM tables to InnoDB tables before you proceed. Upgrading Zoneminder to 1.26 or newer should do this for you.&lt;br /&gt;
&lt;br /&gt;
innodb_file_per_table is by default ON Mysql 5.6.6 and onwards. There is plenty of stuff on Google about pros &amp;amp; cons of innodb_file_per_table.&lt;br /&gt;
This post details how to enable innodb_file_per_table on an existing database. Because innodb_file_per_table affects new tables only, created after innodb_file_per_table is enabled, we need to recreate old databases to force innodb_file_per_table on old tables and reclaim some disk space.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Backup First&lt;br /&gt;
Create a dir to take backups:&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Note: I found it helpful to create a file which contained the MySQL user and password. Otherwise you will have to enter the user and password for every operation.&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=mysqlpass&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make backup directory&lt;br /&gt;
 mkdir backup&lt;br /&gt;
&lt;br /&gt;
 cd backup&lt;br /&gt;
&lt;br /&gt;
Copy MySQL data files (raw)&lt;br /&gt;
(If all goes well, we will not need this)&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
If you have other services that use MySQL you will want to stop them and possibly Apache.&lt;br /&gt;
&lt;br /&gt;
 service mysql stop &amp;amp;&amp;amp; cp -ra /var/lib/mysql mysqldata &amp;amp;&amp;amp; service mysql start&lt;br /&gt;
&lt;br /&gt;
Take mysqldump&lt;br /&gt;
As soon as above line completes, take a mysqldump of all databases&lt;br /&gt;
&lt;br /&gt;
 mysqldump --routines --events --flush-privileges --all-databases &amp;gt; all-db.sql&lt;br /&gt;
&lt;br /&gt;
Drop Databases&lt;br /&gt;
Create a sql file to drop all databases EXCEPT mysql database&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;SELECT DISTINCT CONCAT (&amp;#039;DROP DATABASE &amp;#039;,TABLE_SCHEMA,&amp;#039; ;&amp;#039;) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA &amp;lt;&amp;gt; &amp;#039;mysql&amp;#039; AND TABLE_SCHEMA &amp;lt;&amp;gt; &amp;#039;information_schema&amp;#039;;&amp;quot; | tail -n+2 &amp;gt; drop.sql&lt;br /&gt;
&lt;br /&gt;
Verify if drop.sql has correct database names and then execute drop.sql queries.&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; drop.sql&lt;br /&gt;
&lt;br /&gt;
Verify all InnoDB tables gone&lt;br /&gt;
&lt;br /&gt;
 SELECT table_name, table_schema, engine FROM information_schema.tables WHERE engine = &amp;#039;InnoDB&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
Remove InnoDB files&lt;br /&gt;
Stop mysql server first&lt;br /&gt;
&lt;br /&gt;
 service mysql stop&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&lt;br /&gt;
 rm /var/lib/mysql/ibdata1 &amp;amp;&amp;amp; rm /var/lib/mysql/ib_logfile0 &amp;amp;&amp;amp; rm /var/lib/mysql/ib_logfile1&lt;br /&gt;
&lt;br /&gt;
At this point most likely you will have only /var/lib/mysql/mysql directory only.&lt;br /&gt;
&lt;br /&gt;
Enable innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Open my.cnf file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Add following line after [mysqld]&lt;br /&gt;
&lt;br /&gt;
 innodb_file_per_table&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Time to import from mysqldump&lt;br /&gt;
Start mysql server now&lt;br /&gt;
&lt;br /&gt;
 service mysql start&lt;br /&gt;
&lt;br /&gt;
Run mysql import&lt;br /&gt;
&lt;br /&gt;
 mysql &amp;lt; all-db.sql&lt;br /&gt;
&lt;br /&gt;
Force mysql_upgrade (to generate performance_schema)&lt;br /&gt;
 &lt;br /&gt;
 mysql_upgrade --force&lt;br /&gt;
&lt;br /&gt;
That’s All!&lt;br /&gt;
&lt;br /&gt;
Restart Zoneminder (and any other services you have stopped)&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Check for proper operation and that all your events are present. &lt;br /&gt;
&lt;br /&gt;
When you are satisfied that all is worling well remove the backup directory and password filr=e&lt;br /&gt;
&lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
 rm -r backup&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
You are finished!&lt;br /&gt;
&lt;br /&gt;
This procedure has been adopted from https://rtcamp.com/tutorials/mysql/enable-innodb-file-per-table. Thanks to Rahul Bansal!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding Permissions to allow Database Upgrade===&lt;br /&gt;
Versions of Zoneminder up to and including 1.28.1 in Ubuntu would automatically add the zm database to MySQL. Beginning about August &lt;br /&gt;
2015 the development version from the iconnor-master PPA omitted this step becoming like the Debian install process. Manually adding the &lt;br /&gt;
database to MySQL will be necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install the zm database (after doing apt-get install zoneminder)&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)&lt;br /&gt;
&lt;br /&gt;
This next step creates a file which contained the MySQL user and password. Otherwise you will have to enter the user and password on the &lt;br /&gt;
command line which is not secure!&lt;br /&gt;
&lt;br /&gt;
Go to the root directory&lt;br /&gt;
 &lt;br /&gt;
 cd ~&lt;br /&gt;
&lt;br /&gt;
Create a hidden password file&lt;br /&gt;
&lt;br /&gt;
 nano .my.cnf&lt;br /&gt;
&lt;br /&gt;
Enter this content (but use your MySQL root password!)&lt;br /&gt;
&lt;br /&gt;
 [client]&lt;br /&gt;
 user=root&lt;br /&gt;
 password=(mysqlpass)&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Create database permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -e &amp;quot;grant select,insert,update,delete,create,alter,lock tables on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove password file&lt;br /&gt;
&lt;br /&gt;
 rm .my.cnf&lt;br /&gt;
&lt;br /&gt;
Continue with the Zoneminder installation&lt;br /&gt;
&lt;br /&gt;
==Upgrades==&lt;br /&gt;
===Ubuntu 14.04 with MySQL 5.6 and Zoneminder from PPA===&lt;br /&gt;
&lt;br /&gt;
This procedure starts with Ubuntu Server 14.04-3 with LAMP added. Zoneminder is not installed. It is possible to upgrade a system running Zoneminder but it is not covered in this procedure.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Stop MySQL&lt;br /&gt;
&lt;br /&gt;
 service mysql stop&lt;br /&gt;
&lt;br /&gt;
Remove MySQL&lt;br /&gt;
&lt;br /&gt;
 apt-get purge mysql&lt;br /&gt;
&lt;br /&gt;
Install MySQL 5.6 (will upgrade the MySQL client)&lt;br /&gt;
&lt;br /&gt;
 apt-get install mysql-server-5.6&lt;br /&gt;
&lt;br /&gt;
Note: You may need to edit my.cnf and change the value: sql_mode= to sql_mode=NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Follow the install instructions: https://wiki.zoneminder.com/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.29.0_the_easy_way&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 14.04 - ZM 1.26.5 or later to 1.30.x or the latest PPA version===&lt;br /&gt;
&lt;br /&gt;
Note: this has been tested with ZM 1.30.2 RC1 11FEB17 using the repository ppa:iconnor/zoneminder-master&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository &lt;br /&gt;
&lt;br /&gt;
Note: if you need to remove a repository use: add-apt-repository --remove ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation&lt;br /&gt;
&lt;br /&gt;
 apt-get upgrade  (may return nothing to upgrade)&lt;br /&gt;
&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
You will be asked if you want to replace /etc/init.d/zoneminder. Choose &amp;quot;Y&amp;quot;&lt;br /&gt;
&lt;br /&gt;
With ZM 1.30.3 the database will automatically upgrade.&lt;br /&gt;
&lt;br /&gt;
Add back the delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add sleep 15 as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
      sleep 15&lt;br /&gt;
      echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
And add the following after mkdir -p &amp;quot;$TMPDIR&amp;quot; &amp;amp;&amp;amp; chown www-data:www-data &amp;quot;$TMPDIR&amp;quot; to allow the API to work&lt;br /&gt;
&lt;br /&gt;
 mkdir /tmp/zm/cache&lt;br /&gt;
 mkdir /tmp/zm/cache/models&lt;br /&gt;
 mkdir /tmp/zm/cache/persistent&lt;br /&gt;
 chown -R www-data:www-data /tmp/zm/cache&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Remove symbolic link&lt;br /&gt;
&lt;br /&gt;
 rm /etc/apache2/conf-enabled/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Set permissions of /etc/zm/zm.conf to root:www-data 740&lt;br /&gt;
&lt;br /&gt;
 chmod 740 /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
 chown root:www-data /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Enable Zoneminder and rewrite &lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder (Note: Zoneminder may have started automatically after the dist-upgrade)&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php5/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 restart&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder. Click on Options - Paths &lt;br /&gt;
&lt;br /&gt;
Change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
Reboot the server to set the API tmp directories.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04 - ZM 1.30.x Upgrade===&lt;br /&gt;
Ubuntu 16.04 contains Zoneminder 1.29.0.&lt;br /&gt;
&lt;br /&gt;
Note: 31MAR17 This was tested with ZM 1.30.2 from ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
To upgrade to Zoneminder 1.30.2&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Add Repository. Note:You may need to run: &amp;quot;apt install software-properties-common&amp;quot; if you did the minimal net install of Ubuntu. &lt;br /&gt;
&lt;br /&gt;
 add-apt-repository ppa:iconnor/zoneminder&lt;br /&gt;
&lt;br /&gt;
Update package list&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl stop zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Note: It may be a good idea to backup your database. This procedure was tested with MySQL 5.7 but should work with Mariadb 10.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upgrade the installation (Zoneminder will upgrade with the &amp;quot;apt upgrade&amp;quot; command. Your database will automatically be upgraded.&lt;br /&gt;
&lt;br /&gt;
 apt upgrade &lt;br /&gt;
&lt;br /&gt;
 apt dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder if necessary&lt;br /&gt;
&lt;br /&gt;
 systemctl start zoneminder.service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Ubuntu 14.04 with ZM 1.29.0 from the PPA to Ubuntu 16.04====&lt;br /&gt;
&lt;br /&gt;
02MAY16  This upgrade procedure has been tested successfully! It may not be necessary to take a dump of your zm database but I did it just-in-case MySQL messed something up. &lt;br /&gt;
&lt;br /&gt;
Make sure your install is up to date!&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
 sudo apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Reboot if needed&lt;br /&gt;
&lt;br /&gt;
Login to a console and stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 sudo service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Take a dump of the Zoneminder (zm) database (the zm.sql will be saved in your &amp;quot;home&amp;quot; directory)&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p zm &amp;gt; zm.sql &lt;br /&gt;
&lt;br /&gt;
Drop the &amp;quot;zm&amp;quot; database&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p drop zm&lt;br /&gt;
&lt;br /&gt;
Run the Ubuntu upgrade (note: the &amp;quot;-d&amp;quot; is required until Ubuntu 16.04-1 is released)&lt;br /&gt;
&lt;br /&gt;
 sudo do-release-upgrade -d&lt;br /&gt;
&lt;br /&gt;
When prompted, overwrite the zoneminder configuration with the package maintainers version. &lt;br /&gt;
&lt;br /&gt;
My upgrade informed me MySQL server upgrade failed. I had to continue and reboot (Ctrl+Alt+Del) the server manually.&lt;br /&gt;
&lt;br /&gt;
Log in and become root&lt;br /&gt;
&lt;br /&gt;
 sudo su &lt;br /&gt;
&lt;br /&gt;
Clean up packages that were not removed when the upgrade failed (may not be needed in the future)&lt;br /&gt;
&lt;br /&gt;
 apt-get autoremove&lt;br /&gt;
&lt;br /&gt;
Install PHP7&lt;br /&gt;
&lt;br /&gt;
 apt-get install php php-gd libapache2-mod-php php7.0-mysql&lt;br /&gt;
&lt;br /&gt;
Secure MySQL&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder (zm) database in MySQL&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p create zm&lt;br /&gt;
&lt;br /&gt;
Import the zm database&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p zm &amp;lt; zm.sql&lt;br /&gt;
&lt;br /&gt;
Set permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
In the [mysqld] section add the following&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Set the Timezone on PHP7 &lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.0/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Fix to allow API to work&lt;br /&gt;
&lt;br /&gt;
 nano /etc/apache2/apache2.conf&lt;br /&gt;
&lt;br /&gt;
Change &amp;quot;AllowOverride None&amp;quot; to &amp;quot;AllowOverride All&amp;quot; two places as shown below&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /usr/share&amp;gt;&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /var/www/&amp;gt;&lt;br /&gt;
         Options Indexes FollowSymLinks&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
You should be able to connect to Zoneminder in your web browser!&lt;br /&gt;
&lt;br /&gt;
====Ubuntu with ZM 1.28.1 or Earlier Upgrade to Ubuntu 16.04====&lt;br /&gt;
&lt;br /&gt;
Upgrade Ubuntu running Zoneminder 1.28.1 or earlier.&lt;br /&gt;
&lt;br /&gt;
05MAY16 This has been run on Ubuntu 14.04 with Zoneminder 1.26.5 and Ubuntu 15.10 with Zoneminder 1.28.1. You have two database options: (1)MySQL 5.7 or (2)Mariadb 10.1. Switching to Mariadb Server is a good thing as it seems to work smoother than MySQL 5.7.&lt;br /&gt;
&lt;br /&gt;
Make sure your install is up to date!&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
 sudo apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
Reboot if needed&lt;br /&gt;
&lt;br /&gt;
Login to a console and stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 sudo service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Take a dump of the Zoneminder (zm) database (the zm.sql will be saved in your &amp;quot;home&amp;quot; directory)You will need this if you choose Mariadb or if something goes wrong with the upgrade.&lt;br /&gt;
&lt;br /&gt;
 mysqldump -u root -p zm &amp;gt; zm.sql &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the Ubuntu upgrade (note: the &amp;quot;-d&amp;quot; is required until Ubuntu 16.04-1 is released)&lt;br /&gt;
&lt;br /&gt;
 sudo do-release-upgrade -d&lt;br /&gt;
&lt;br /&gt;
When prompted, overwrite the zoneminder configuration with the package maintainers version. &lt;br /&gt;
&lt;br /&gt;
If, for some reason, you get an error message that MySQL did not upgrade, continue to reboot, manually if needed, and run on restart&lt;br /&gt;
&lt;br /&gt;
 apt-get autoremove&lt;br /&gt;
&lt;br /&gt;
Log in and become root&lt;br /&gt;
&lt;br /&gt;
 sudo su &lt;br /&gt;
&lt;br /&gt;
Install PHP7&lt;br /&gt;
&lt;br /&gt;
 apt-get install php php-gd libapache2-mod-php php7.0-mysql&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Use the default MySQL 5.7&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To allow the database upgrade to work you will need to edit one sql file&lt;br /&gt;
&lt;br /&gt;
 nano /usr/share/zoneminder/db/zm_update-1.28.99.sql&lt;br /&gt;
&lt;br /&gt;
Search for [ALTER IGNORE TABLE] (Ctrl + w then type ALTER IGNORE TABLE and press Enter. Remove IGNORE then &lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
In the [mysqld] section add the following&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Recommended: Secure MySQL.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Scroll down to Continue Installation and skip Mariadb &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Replace MySQL 5.7 with Mariadb 10&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
&lt;br /&gt;
Secure Mariadb (set root password in Mariadb and etc.)&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder (zm) database in MySQL&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p create zm&lt;br /&gt;
&lt;br /&gt;
Import the zm database&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p zm &amp;lt; zm.sql&lt;br /&gt;
&lt;br /&gt;
Set permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run the database upgrade&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/zmupdate.pl  &lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
When you want to change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Continue Installation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Set permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Run the database upgrade&lt;br /&gt;
&lt;br /&gt;
 /usr/bin/zmupdate.pl  &lt;br /&gt;
&lt;br /&gt;
Set the Timezone on PHP7 &lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.0/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Fix to allow API to work&lt;br /&gt;
&lt;br /&gt;
 nano /etc/apache2/apache2.conf&lt;br /&gt;
&lt;br /&gt;
Change &amp;quot;AllowOverride None&amp;quot; to &amp;quot;AllowOverride All&amp;quot; two places as shown below&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /usr/share&amp;gt;&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /var/www/&amp;gt;&lt;br /&gt;
         Options Indexes FollowSymLinks&lt;br /&gt;
         AllowOverride All&lt;br /&gt;
         Require all granted&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Connect to Zoneminder in your web browser, open Options and set PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04 with ZM 1.30.4 Upgrade to Ubuntu 18.04 with ZM 1.30.4===&lt;br /&gt;
20APR18&lt;br /&gt;
As of this writing Zoneminder is not included in Ubuntu Bionic 18.04 and there is not a Bionic version of Zoneminder 1.30.4 in the PPA. I have repackaged a Zoneminder install for AMD64 processors that contains updates to work with PHP 7.2.&lt;br /&gt;
&lt;br /&gt;
Do a release upgrade (do-release-upgrade -d) to upgrade your 16.04 to 18.04. Make sure your system is up to date first! &lt;br /&gt;
Accept all defaults especially keeping the existing database my.cnf.&lt;br /&gt;
Upon reboot Zoneminder should start but you will not be able to access it via the web gui.&lt;br /&gt;
&lt;br /&gt;
Here is a link to a script that will do the upgrade process for you:&lt;br /&gt;
&lt;br /&gt;
 https://wiki.zoneminder.com/Shell_script_zm-install-bionic#Script_to_patch_upgrade_from_Ubuntu_16.04_to_18.04._Works_with_MySQL_or_Mariadb_.28MySQL.29&lt;br /&gt;
&lt;br /&gt;
Copy the contents to a file and make it executable then run it.&lt;br /&gt;
&lt;br /&gt;
Or, follow these steps.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Enable PHP 7.2&lt;br /&gt;
&lt;br /&gt;
 a2enmod php7.2 &lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.2/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Be sure to remove the ; before date.timezone&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
&lt;br /&gt;
 Defines the default timezone used by the date functions&lt;br /&gt;
 http://php.net/date.timezone&lt;br /&gt;
&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
At this point you can access the Zoneminder web gui. However, the API will not function. To correct this you will need to download and install a patched version of Zoneminder&lt;br /&gt;
&lt;br /&gt;
Download Zoneminder;&lt;br /&gt;
&lt;br /&gt;
 wget --no-check-certificate &amp;#039;https://docs.google.com/uc?export=download&amp;amp;id=1bZhVcBnlW46SwCnSnZ0sdZzwtOcCiisX&amp;#039; -O /tmp/zoneminder-1.30.4-bionic-amd64.deb&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install /tmp/zoneminder-1.30.4-bionic-amd64.deb&lt;br /&gt;
&lt;br /&gt;
Make sure Zoneminder is enabled and start it:&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Make sure Zoneminder is enabled in Apache&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
Check permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 17.10 with ZM 1.30.4 Upgrade to Ubuntu 18.04 with ZM 1.30.4===&lt;br /&gt;
&lt;br /&gt;
I started with Ubuntu 17.10 and installed Zoneminder 1.30.4 per the WIKI instructions with the Zesty Zoneminder install package.&lt;br /&gt;
&lt;br /&gt;
Become root&lt;br /&gt;
 &lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Mark-hold the installed Zoneminder else it will be removed when the Ubuntu upgrade runs&lt;br /&gt;
&lt;br /&gt;
 apt-mark hold zoneminder&lt;br /&gt;
&lt;br /&gt;
Upgrade Ubuntu&lt;br /&gt;
&lt;br /&gt;
 do-release-upgrade -d&lt;br /&gt;
&lt;br /&gt;
Accept the defaults especially keep the installed my.cnf!&lt;br /&gt;
&lt;br /&gt;
After reboot become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Disable PHP7.1 and enable PHP7.2&lt;br /&gt;
&lt;br /&gt;
 a2dismod php7.1&lt;br /&gt;
&lt;br /&gt;
 a2enmod php7.2&lt;br /&gt;
&lt;br /&gt;
 systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.2/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. &amp;#039;&amp;#039;&amp;#039;Make sure to remove the ; from the front of date.timezone&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
 systemctl restart apache2&lt;br /&gt;
&lt;br /&gt;
At this point Zoneminder will work accept for the API functions. Download and install the patched Zoneminder install for Bionic&lt;br /&gt;
&lt;br /&gt;
 wget --no-check-certificate &amp;#039;https://docs.google.com/uc?export=download&amp;amp;id=1bZhVcBnlW46SwCnSnZ0sdZzwtOcCiisX&amp;#039; -O /tmp/zoneminder-1.30.4-bionic-amd64.deb&lt;br /&gt;
&lt;br /&gt;
Install (downgrade) Zoneminder. Don&amp;#039;t worry, you will not lose events&lt;br /&gt;
&lt;br /&gt;
  apt install /tmp/zoneminder-1.30.4-bionic-amd64.deb&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s it! Everything should now work!&lt;br /&gt;
&lt;br /&gt;
===Ubuntu upgrade Zonminder version prior to 1.32.x===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;We recommend you read the release notes to see what has changed in this version. The release notes can be found here: https://github.com/ZoneMinder/zoneminder/releases&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Limited testing has been done upgrading Zoneminder 1.30.4 to the &amp;quot;Beta&amp;quot; version of 1.32.x on Ubuntu 14.04, 16.04 and 18.04. While there were no issues noted with the Beta version I will wait for the PPA to be populated with Zoneminder 1.32.x to write more. READ THE RELEASE NOTES before you upgrade! If you have a lot of events expect the database upgrade to take a while.&lt;br /&gt;
See the Forum for mor information or to ask for help: https://forums.zoneminder.com/viewtopic.php?f=38&amp;amp;t=27502&lt;br /&gt;
&lt;br /&gt;
==18SEP18 Modify MySQL my.cnf==&lt;br /&gt;
Versions of Zoneminder 1.30.4 and earlier that use MySQL required an entry to the my.cnf file. there were two recommended settings:&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
 init_connect = &amp;#039;SET @@sql_mode = CASE CURRENT_USER() WHEN \&amp;#039;zmuser@localhost\&amp;#039; THEN \&amp;#039;NO_ENGINE_SUBSTITUTION\&amp;#039; ELSE @@sql_mode END;&amp;#039;&lt;br /&gt;
either in the [mysqld]section.&lt;br /&gt;
&lt;br /&gt;
Remove this entry for Zoneminder 1.32.x&lt;br /&gt;
&lt;br /&gt;
==Ubuntu Swap File==&lt;br /&gt;
I have been puzzled for some time as to why Ubuntu will write to the swap file when there is plenty of RAM installed. I&amp;#039;ve discovered that writing to the swap file is controlled by the &amp;quot;swappiness&amp;quot; setting! By default, Ubuntu uses a swappiness value of 60 which means that when 40% of memory is used, the system will start swapping data from memory to the swap file. &lt;br /&gt;
Here is some info you can use to check and/or change swappiness:&lt;br /&gt;
&lt;br /&gt;
To check the swappiness value&lt;br /&gt;
&lt;br /&gt;
 cat /proc/sys/vm/swappiness&lt;br /&gt;
&lt;br /&gt;
To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with&lt;br /&gt;
&lt;br /&gt;
 sudo sysctl vm.swappiness=10&lt;br /&gt;
&lt;br /&gt;
To make a change permanent, edit the configuration file with your favorite editor:&lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/sysctl.conf&lt;br /&gt;
&lt;br /&gt;
Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:&lt;br /&gt;
&lt;br /&gt;
 vm.swappiness=10&lt;br /&gt;
&lt;br /&gt;
The more RAM your system has the lower the swappiness value can be. Possibly even &amp;quot;0&amp;quot;  My production system with 16 GIG of RAM works well with a value of &amp;quot;10&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Save the file and reboot.&lt;br /&gt;
&lt;br /&gt;
==Use Systemd to Mount Internal Drive or NAS==&lt;br /&gt;
Mount units with Systemd Ubuntu 16.xx or newer.&lt;br /&gt;
&lt;br /&gt;
Thanks to knnniggett for the effort to make this work!&lt;br /&gt;
&lt;br /&gt;
Background&lt;br /&gt;
One of the first steps the end user must perform after installing ZoneMinder is to dedicate an entire partition, drive, or network share for ZoneMinder&amp;#039;s event storage. The reason being, ZoneMinder will, by design, fill up your hard disk, and you don&amp;#039;t want to do that to your root volume! The traditional method for accomplishing this is documented here, and that method continues to work well.&lt;br /&gt;
&lt;br /&gt;
However, due to the mass adoption of Systemd we now have a new way to accomplish this, which happens to give us something the former method did not. Read on to learn more!&lt;br /&gt;
&lt;br /&gt;
Systemd natively integrates all sorts of system admin functions that the legacy sys v init didn&amp;#039;t have anything to do with. One of those functions is the ability to create mount points, much in the same way one would create a service (a.k.a. unit) file.&lt;br /&gt;
&lt;br /&gt;
Note: This is especially easy on a new system. Just create your mount (/var/cache/zoneminder for Ubuntu) then install Zoneminder. How easy is that?&lt;br /&gt;
&lt;br /&gt;
Collect Information&lt;br /&gt;
We need to know the following before we get started:&lt;br /&gt;
&lt;br /&gt;
    Find the ZoneMinder events and images folders on your filesystem&lt;br /&gt;
    Determine the name of the web account user&lt;br /&gt;
    For local volumes, determine the device name of the volume&lt;br /&gt;
    For local volumes, determine the uuid of the volume&lt;br /&gt;
    For remote volumes, determine the sharing protocol to be used e.g. nfs, smb, etc&lt;br /&gt;
    For remote volumes, determine the share name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The location of the events and images folder will vary by Linux distro. You are looking for an actual folder, NOT a symlink! Debian (Ubuntu) distros prefer /var/cache/zoneminder. These folder locations are chosen by each distros&amp;#039; packaging guidelines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On most Linux distros, you can view the uuid of each of your drives like so:&lt;br /&gt;
&lt;br /&gt;
 ls -l /dev/disk/by-uuid&lt;br /&gt;
&lt;br /&gt;
On my system with two hard drives, the items above are as follows:&lt;br /&gt;
&lt;br /&gt;
    /var/cache/zoneminder&lt;br /&gt;
    www-data&lt;br /&gt;
    /dev/sdb1&lt;br /&gt;
    7ec50da2-fc67-4ade-89c7-6047710afae2&lt;br /&gt;
&lt;br /&gt;
Your configuration will be different. Options to connect to a network share will be noted herein.&lt;br /&gt;
&lt;br /&gt;
Migrate existing data&lt;br /&gt;
I&amp;#039;m not going to get into the details of this since the necessary steps will vary with each system. What you need to do is migrate whatever happens to be in the ZoneMinder events and images folders over to the new partition, disk, or network share. You do this by mounting the target from the command line via the normal fashion to a temporary folder, issue the appropriate move commands, and finally unmount the target.&lt;br /&gt;
&lt;br /&gt;
This procedure has been modified for Ubuntu 16.xx and later&lt;br /&gt;
&lt;br /&gt;
Log in and become root&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Note: The next step will remove the Zoneminder events and images directories! This is safe to do if your system is new and you have not added cameras that have recorded events. &lt;br /&gt;
&lt;br /&gt;
Remove or events and images directories&lt;br /&gt;
&lt;br /&gt;
 rm -r /var/cache/zoneminder/events&lt;br /&gt;
 rm -r /var/cache/zoneminder/images&lt;br /&gt;
&lt;br /&gt;
If you have an operational system you may rename the directories (mv /home/user/oldname /home/user/newname) then move the data to the new drive directories.&lt;br /&gt;
&lt;br /&gt;
 mv /var/cache/zoneminder/events /var/cache/zoneminder/oldevents&lt;br /&gt;
 mv /var/cache/zoneminder/images /var/cache/zoneminder/oldimages&lt;br /&gt;
&lt;br /&gt;
Create the first Systemd Mount Unit&lt;br /&gt;
You will be creating a total of three mount units. The first mount unit mounts the drive or partition to your system. To do that create a new folder. I prefer to put mount points under /mnt and give the name of the subfolder the same name as the device or share. In my case, that would be sdb1.&lt;br /&gt;
&lt;br /&gt;
 mkdir /mnt/sdb1 &lt;br /&gt;
&lt;br /&gt;
When creating mount units with systemd, the filename describing the mount point has to be named in a specific manner.  Since the folder I just created is at /mnt/sdb1, one has to name the mount unit mnt-sdb1.mount. Create that file in the /etc/systemd/system folder. &lt;br /&gt;
&lt;br /&gt;
 nano /etc/systemd/system/mnt-sdb1.mount&lt;br /&gt;
&lt;br /&gt;
Note: the next step you use is dependent upon the use of an internal drive or a network drive. Read carefully!&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
Internal drive: add the following contents, changing the path and uuid to match that of your system:&lt;br /&gt;
&lt;br /&gt;
 # systemd mount unit for ZoneMinder event storage&lt;br /&gt;
  &lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=systemd mount unit for ZoneMinder event storage&lt;br /&gt;
 Before=zoneminder&lt;br /&gt;
  &lt;br /&gt;
 [Mount]&lt;br /&gt;
 What=/dev/disk/by-uuid/7ec50da2-fc67-4ade-89c7-6047710afae2&lt;br /&gt;
 Where=/mnt/sdb1&lt;br /&gt;
 Type=ext4&lt;br /&gt;
 Options=defaults,noatime,commit=120,data=writeback&lt;br /&gt;
  &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Save and close the editor. &lt;br /&gt;
&lt;br /&gt;
Go to *Next&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------------------------------&lt;br /&gt;
Network drive/NAS SMB or CIFS Mount&lt;br /&gt;
&lt;br /&gt;
Note: your network share must recognize symbolic links&lt;br /&gt;
Add the following contents, changing the What= and Options= to match that of your system:&lt;br /&gt;
&lt;br /&gt;
 # systemd mount unit for ZoneMinder event storage&lt;br /&gt;
  &lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=systemd mount unit for ZoneMinder event storage&lt;br /&gt;
 After=networking.service&lt;br /&gt;
 Before=zoneminder&lt;br /&gt;
  &lt;br /&gt;
 [Mount]&lt;br /&gt;
 What=//192.168.50.4/zm&lt;br /&gt;
 Where=/mnt/sdb1&lt;br /&gt;
 Type=&lt;br /&gt;
 Options=credentials=/root/.smbcredentials,uid=33,gid=33,rw&lt;br /&gt;
  &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Save and close the editor.&lt;br /&gt;
&lt;br /&gt;
Install smbclient if you are mounting a Windows or SMB share&lt;br /&gt;
&lt;br /&gt;
 apt install smbclient cifs-utils&lt;br /&gt;
&lt;br /&gt;
Create a file for your remote servers logon credential, This is the user and password you would use to access the Windows share and is located in the /root directory.&lt;br /&gt;
&lt;br /&gt;
 nano ~/.smbcredentials&lt;br /&gt;
&lt;br /&gt;
Enter your Windows username, password and workgroup or domain in the file:&lt;br /&gt;
&lt;br /&gt;
 username=msusername&lt;br /&gt;
 password=mspassword&lt;br /&gt;
 domain=workgroup&lt;br /&gt;
&lt;br /&gt;
Save the file, exit the editor.&lt;br /&gt;
&lt;br /&gt;
Change the permissions of the file to prevent unwanted access to your credentials:&lt;br /&gt;
&lt;br /&gt;
 chmod 600 ~/.smbcredentials&lt;br /&gt;
--------------------------------------------------------------------------------------------------------------&lt;br /&gt;
*Next&lt;br /&gt;
&lt;br /&gt;
Now enable and start the unit:&lt;br /&gt;
&lt;br /&gt;
 systemctl enable mnt-sdb1.mount&lt;br /&gt;
 systemctl start mnt-sdb1.mount &lt;br /&gt;
&lt;br /&gt;
Make and Set Folder Permissions&lt;br /&gt;
We&amp;#039;ve created our primary mount point, but we aren&amp;#039;t done yet. First, let&amp;#039;s create some folders and set the correct permissions:&lt;br /&gt;
&lt;br /&gt;
 mkdir -p /mnt/sdb1/zoneminder/events&lt;br /&gt;
 mkdir -p /mnt/sdb1/zoneminder/images&lt;br /&gt;
 chown -R www-data:www-data /mnt/sdb1/zoneminder&lt;br /&gt;
    &lt;br /&gt;
Remember that, if you are not running a Ubuntu distro, the web user account might be named something other than www-data on your system.&lt;br /&gt;
&lt;br /&gt;
Create two Systemd Bind Mount Units&lt;br /&gt;
With the events and images folders created, we want to create two mount units, which bind mount those folders into the desired places.&lt;br /&gt;
&lt;br /&gt;
Create the file /etc/systemd/system/var-cache-zoneminder-events.mount &lt;br /&gt;
&lt;br /&gt;
 nano /etc/systemd/system/var-cache-zoneminder-events.mount&lt;br /&gt;
&lt;br /&gt;
Next add the following content to it:&lt;br /&gt;
&lt;br /&gt;
 # systemd bind mount unit for ZoneMinder event storage&lt;br /&gt;
 &lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=systemd bind mount unit for ZoneMinder event storage&lt;br /&gt;
 After=mnt-sdb1.mount&lt;br /&gt;
 Requires=mnt-sdb1.mount&lt;br /&gt;
 &lt;br /&gt;
 [Mount]&lt;br /&gt;
 What=/mnt/sdb1/zoneminder/events&lt;br /&gt;
 Where=/var/cache/zoneminder/events&lt;br /&gt;
 Type=none&lt;br /&gt;
 Options=bind&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=local-fs.target&lt;br /&gt;
&lt;br /&gt;
Save and close the editor.&lt;br /&gt;
&lt;br /&gt;
Now enable and start the unit:&lt;br /&gt;
&lt;br /&gt;
 systemctl enable  var-cache-zoneminder-events.mount&lt;br /&gt;
 systemctl start  var-cache-zoneminder-events.mount &lt;br /&gt;
&lt;br /&gt;
We now need to do the same thing to the images folder. Create the file /etc/systemd/system/var-lib-zoneminder-images.mount &lt;br /&gt;
&lt;br /&gt;
 nano /etc/systemd/system/var-cache-zoneminder-images.mount&lt;br /&gt;
&lt;br /&gt;
Next add the following content to it:&lt;br /&gt;
&lt;br /&gt;
 # systemd bind mount unit for ZoneMinder image storage&lt;br /&gt;
 &lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=systemd bind mount unit for ZoneMinder image storage&lt;br /&gt;
 After=mnt-sdb1.mount&lt;br /&gt;
 Requires=mnt-sdb1.mount&lt;br /&gt;
 &lt;br /&gt;
 [Mount]&lt;br /&gt;
 What=/mnt/sdb1/zoneminder/images&lt;br /&gt;
 Where=/var/cache/zoneminder/images&lt;br /&gt;
 Type=none&lt;br /&gt;
 Options=bind&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=local-fs.target&lt;br /&gt;
&lt;br /&gt;
Save and close the editor.&lt;br /&gt;
&lt;br /&gt;
Now enable and start the unit:&lt;br /&gt;
&lt;br /&gt;
 systemctl enable var-cache-zoneminder-images.mount&lt;br /&gt;
 systemctl start var-cache-zoneminder-images.mount&lt;br /&gt;
&lt;br /&gt;
Now reboot and verify all three mount points were successful:&lt;br /&gt;
&lt;br /&gt;
Bonus Points. Leverage the Power of Systemd&lt;br /&gt;
If you recall, I mentioned that using systemd to manage your mount points has an advantage over the previous method. With your mount points configured with systemd, you can easily prevent ZoneMinder from starting, should the mount point fail for any reason. Anyone who has ever started ZoneMinder without realizing there was a problem reading from the events folder can tell you what happens when this occurs. You lose all your events, and yes this is by design.&lt;br /&gt;
&lt;br /&gt;
To prevent that from happening we need to modify our zoneminder service file. But first make a copy just in case..&lt;br /&gt;
&lt;br /&gt;
 cp /lib/systemd/system/zoneminder.service /lib/systemd/system/zoneminder.service.sav&lt;br /&gt;
&lt;br /&gt;
 nano /lib/systemd/system/zoneminder.service&lt;br /&gt;
&lt;br /&gt;
Add entries to the After= and Requires=&lt;br /&gt;
&lt;br /&gt;
 # ZoneMinder systemd unit file&lt;br /&gt;
 # This file is intended to work with Debian distributions&lt;br /&gt;
 &lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=ZoneMinder CCTV recording and surveillance system&lt;br /&gt;
 After=network.target mysql.service mnt-sdb1.mount var-cache-zoneminder-images.mount var-cache-zoneminder-events.mount&lt;br /&gt;
 # Remarked out so that it will start ZM on machines that don&amp;#039;t have mysql installed&lt;br /&gt;
 #Requires=mysql.service&lt;br /&gt;
 Requires=mnt-sdb1.mount var-cache-zoneminder-images.mount var-cache-zoneminder-events.mount&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 #User=www-data&lt;br /&gt;
 Type=forking&lt;br /&gt;
 ExecStart=/usr/bin/zmpkg.pl start&lt;br /&gt;
 ExecReload=/usr/bin/zmpkg.pl restart&lt;br /&gt;
 ExecStop=/usr/bin/zmpkg.pl stop&lt;br /&gt;
 PIDFile=/var/run/zm/zm.pid&lt;br /&gt;
 Restart=on-abnormal&lt;br /&gt;
&lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
Save and close the editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now issue a daemon reload to tell systemd to pick up the change:&lt;br /&gt;
&lt;br /&gt;
 systemctl daemon-reload&lt;br /&gt;
&lt;br /&gt;
Should the mount point fail during startup, systemd will prevent the ZoneMinder service from starting with a message stating a failed dependency. Your events are saved from deletion!&lt;br /&gt;
&lt;br /&gt;
Oh, restart Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
==Zoneminder Multi Server on Ubuntu==&lt;br /&gt;
&lt;br /&gt;
10MAY18 - Tested this procedure with Ubuntu Bionic 18.04 with Zoneminder 1.30.4, Mariadb, Apache2 and PHP 7.2 installed per the WIKI instructions with the shell script.&lt;br /&gt;
&lt;br /&gt;
I developed this procedure using two Ubuntu 16.04 servers set up with Zoneminder 1.30.4 per the instructions in the WIKI (https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.4_the_easy_way). I used the default MySQL server but Mariadb can also be used with a couple of modifications.&lt;br /&gt;
&lt;br /&gt;
For this procedure my servers were: &lt;br /&gt;
&lt;br /&gt;
Name - u2   IP address 192.168.50.2  This is the storage and database server&lt;br /&gt;
&lt;br /&gt;
Name - u3   IP address 192.168.50.3  This is the remote zoneminder server&lt;br /&gt;
&lt;br /&gt;
It is possible to use a separate database server and a seperate storage server. Your storage server does need to have a Linux file system on it as Zoneminder uses symbolic links and a Windows (NTFS, FAT32) does not know about symbolic links. You can also use Samba to mount the storage drive but this is written to use NFS. &lt;br /&gt;
&lt;br /&gt;
&amp;quot;Official&amp;quot; Multi Server Install is at: http://zoneminder.readthedocs.io/en/stable/installationguide/multiserver.html&lt;br /&gt;
&lt;br /&gt;
I use Putty from a Windows PC to connect to the servers as I can copy the commands from this web page and paste them into Putty. This is the easy way for me!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Database and Storage Server&lt;br /&gt;
&lt;br /&gt;
Stop the Zoneminder service&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Edit the my.conf. Change bind-address to: bind-address = 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Grant remote user access (Note: for additional remote servers add them using their IP address)&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@192.168.50.2 identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@192.168.50.3 identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Install the NFS server&lt;br /&gt;
&lt;br /&gt;
 apt install nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
Add the export directory&lt;br /&gt;
&lt;br /&gt;
 nano /etc/exports&lt;br /&gt;
&lt;br /&gt;
Add to the end of the file (Note: for additional remote servers add additional lines using their IP address)&lt;br /&gt;
&lt;br /&gt;
 /var/cache/zoneminder/events 192.168.50.3(rw,sync,no_subtree_check)&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Restart the NFS server&lt;br /&gt;
&lt;br /&gt;
 systemctl restart nfs-kernel-server&lt;br /&gt;
&lt;br /&gt;
Edit the Zoneminder config file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Change these two lines&lt;br /&gt;
&lt;br /&gt;
ZM_DB_HOST=192.168.50.2&lt;br /&gt;
&lt;br /&gt;
ZM_SERVER_HOST=u2&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Start Zoneminder service&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Local Zoneminder Server(s)&lt;br /&gt;
&lt;br /&gt;
If you have more than one remote server repeat this procedure on each one adjusting the host name for each.&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Edit the Zoneminder config file&lt;br /&gt;
&lt;br /&gt;
 nano /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Change these two lines&lt;br /&gt;
&lt;br /&gt;
ZM_DB_HOST=192.168.50.2&lt;br /&gt;
&lt;br /&gt;
ZM_SERVER_HOST=u3&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Install NFS client&lt;br /&gt;
&lt;br /&gt;
 apt install nfs-client&lt;br /&gt;
&lt;br /&gt;
 modprobe nfs&lt;br /&gt;
&lt;br /&gt;
 echo NFS | tee -a /etc/modules&lt;br /&gt;
&lt;br /&gt;
Create a systemd file for the mount&lt;br /&gt;
&lt;br /&gt;
 nano /etc/systemd/system/var-cache-zoneminder-events.mount&lt;br /&gt;
&lt;br /&gt;
Copy and paste everything between the lines into the systemd file&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------&lt;br /&gt;
 # systemd mount unit for ZoneMinder event storage&lt;br /&gt;
 &lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=systemd mount unit for ZoneMinder event storage&lt;br /&gt;
 After=network.target&lt;br /&gt;
 Before=zoneminder&lt;br /&gt;
  &lt;br /&gt;
 [Mount]&lt;br /&gt;
 What=192.168.50.2:/var/cache/zoneminder/events&lt;br /&gt;
 Where=/var/cache/zoneminder/events&lt;br /&gt;
 Type=nfs&lt;br /&gt;
  &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
-----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Save and start the mount&lt;br /&gt;
&lt;br /&gt;
 systemctl enable var-cache-zoneminder-events.mount&lt;br /&gt;
&lt;br /&gt;
 systemctl start var-cache-zoneminder-events.mount&lt;br /&gt;
&lt;br /&gt;
Start the Zoneminder service&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
In a web browser open Zoneminder on one of the servers. (Note: you may want to check all your servers to insure Zoneminder is started on each. You may have to reboot each server to get Zoneminder to start)&lt;br /&gt;
&lt;br /&gt;
Click on Options - Servers - Add New Server&lt;br /&gt;
&lt;br /&gt;
In the Name block add a name of one of your servers. In my example the first server name is u2.&lt;br /&gt;
 &lt;br /&gt;
In the Hostname block enter the IP address of the first server. In my example it is 192.168.50.2&lt;br /&gt;
&lt;br /&gt;
Click Save&lt;br /&gt;
&lt;br /&gt;
Add the rest of your servers in the same way. Close the Options window when your servers have been added.&lt;br /&gt;
&lt;br /&gt;
When you add a camera make sure you select a server you want to add it to (Source - General - Server dropdown)&lt;br /&gt;
All of your cameras can be managed and viewed from one server Zoneminder screen.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.29.0_the_easy_way&amp;diff=15502</id>
		<title>Ubuntu Server 16.04 64-bit with Zoneminder 1.29.0 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.29.0_the_easy_way&amp;diff=15502"/>
		<updated>2019-03-18T21:14:46Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ubuntu 16.04 is released and I have verified the Zoneminder install with the default LAMP!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04 with LAMP===&lt;br /&gt;
&lt;br /&gt;
This procedure can be used to install Zoneminder on a basic Ubuntu install, a server install or a desktop install. &lt;br /&gt;
&lt;br /&gt;
Ubuntu basic install can be done from the net install CD (https://www.ubuntu.com/download/alternative-downloads) This is creates a CD from the file mini.iso. When prompted (tasksel) install standard system utilities, OpenSSH Server, and LAMP Server. This is the minimum that is required to set up and run Zoneminder and does not load other apps that are not needed.&lt;br /&gt;
&lt;br /&gt;
Ubuntu Server Install: When prompted by Tasksel install OpenSSH Server, and LAMP Server.&lt;br /&gt;
&lt;br /&gt;
Ubuntu Desktop: You will have to install tasksel in a terminal (sudo apt-get install tasksel) then run tasksel to install OpenSSH Server, and LAMP Server.&lt;br /&gt;
&lt;br /&gt;
If you get a blank screen after installing Ubuntu 16.04 minimal install or server, press Alt + F1 to open a console.&lt;br /&gt;
&lt;br /&gt;
Log in then become root:&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
Make sure you are up to date&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
At this point you should have Ubuntu 16.04 installed with LAMP which includes the default MySQL 5.7. You have the option to use Mariadb Server 10.0 which will replace MySQL 5.7 (Click on Options link in Contents above) or continue with MySQL 5.7..&lt;br /&gt;
&lt;br /&gt;
You may want to set the system swap file usage. See:  https://wiki.zoneminder.com/Common_Issues_with_Zoneminder_Installation_on_Ubuntu#Ubuntu_Swap_File&lt;br /&gt;
&lt;br /&gt;
You will need to make a settings change to MySQL as follows:&lt;br /&gt;
&lt;br /&gt;
Note: The MySQL default configuration file (/etc/mysql/mysql.cnf)is read through several symbolic links beginning with /etc/mysql/my.cnf as follows:&lt;br /&gt;
/etc/mysql/my.cnf -&amp;gt; /etc/alternatives/my.cnf&lt;br /&gt;
/etc/alternatives/my.cnf -&amp;gt; /etc/mysql/mysql.cnf&lt;br /&gt;
&lt;br /&gt;
/etc/mysql/mysql.cnf is a basic file&lt;br /&gt;
&lt;br /&gt;
To better manage the MySQL server I recommend you copy the sample config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change MySQL settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
In the [mysqld] section add the following&lt;br /&gt;
&lt;br /&gt;
 sql_mode = NO_ENGINE_SUBSTITUTION&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Restart MySQL&lt;br /&gt;
&lt;br /&gt;
 systemctl restart mysql&lt;br /&gt;
&lt;br /&gt;
Recommended: Secure MySQL.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional: A tool that you may want to install is mysqltuner. This is handy to see what database parameters need to be adjusted as your ZM system builds up events.&lt;br /&gt;
&lt;br /&gt;
 apt-get install mysqltuner&lt;br /&gt;
&lt;br /&gt;
Once installed, run mysqltuner from a command prompt as root (sudo). Review recommended changes. Edit the configuration file (my.cnf) and make the recommended changes. Stop zoneminder, restart the database server then start zoneminder.&lt;br /&gt;
&lt;br /&gt;
===Install Zoneminder===&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder php-gd&lt;br /&gt;
&lt;br /&gt;
Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p &amp;lt; /usr/share/zoneminder/db/zm_create.sql&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 mysqladmin -uroot -p reload&lt;br /&gt;
&lt;br /&gt;
Set permissions of /etc/zm/zm.conf to root:www-data 740&lt;br /&gt;
&lt;br /&gt;
 chmod 740 /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
 chown root:www-data /etc/zm/zm.conf&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Enable CGI, Zoneminder and rewrite configuration in Apache.&lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
 a2enconf zoneminder&lt;br /&gt;
&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
&lt;br /&gt;
Fix Permissions&lt;br /&gt;
&lt;br /&gt;
 chown -R www-data:www-data /usr/share/zoneminder/&lt;br /&gt;
&lt;br /&gt;
Edit zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
 nano /etc/apache2/conf-available/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
Add a - before Indexes and a + before FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /usr/share/zoneminder/www&amp;gt;&lt;br /&gt;
   Options -Indexes +FollowSymLinks&lt;br /&gt;
&lt;br /&gt;
Make sure the following is at the bottom of the file&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Directory /usr/share/zoneminder/www/api&amp;gt;&lt;br /&gt;
     AllowOverride All&lt;br /&gt;
 &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Enable and start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 systemctl enable zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
Add timezone to PHP&lt;br /&gt;
&lt;br /&gt;
 nano /etc/php/7.0/apache2/php.ini&lt;br /&gt;
&lt;br /&gt;
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [Date]&lt;br /&gt;
 ; Defines the default timezone used by the date functions&lt;br /&gt;
 ; http://php.net/date.timezone&lt;br /&gt;
 date.timezone = America/New_York&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit  &lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 service apache2 reload&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in a web browser (http://server-ip/zm).&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
===Optional Upgrade to MariaDB Server 10.0. before installing Zoneminder===&lt;br /&gt;
&lt;br /&gt;
MariaDB has some enhanced features which do not exist in MySQL and thus migration back to MySQL might not always work.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note: This procedure is to upgrade to Mariadb before installing Zoneminder!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Upgrade the LAMP installed MySQL 5.7 to Mariadb with the command:&lt;br /&gt;
&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
&lt;br /&gt;
Secure Mariadb, create root password et. al.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Note: The MySQL/MariaDB configuration file is located at: /etc/mysql/mysql.conf.d/mysqld.cnf To better manage the MariaDB server I recommend you move the config file and replace the default my.cnf symbolic link (this also works for MySQL 5.6).&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  (this removes the current symbolic link)&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
A tool that you may want to install is mysqltuner. This is handy to see what database paramaters need to be adjusted as your ZM system builds up events.&lt;br /&gt;
&lt;br /&gt;
 apt-get install mysqltuner&lt;br /&gt;
&lt;br /&gt;
Continue installing Zoneminder: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.29.0_the_easy_way#Install_Zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a link to manually install LAMP with Mariadb server  [[Install MariaDB Server 10.0]]&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
===Optional Upgrade to MariaDB Server 10.0. with Zoneminder (or other databases) installed===&lt;br /&gt;
&lt;br /&gt;
Note: This procedure is concerned with backing up and recreating the Zoneminder database. You can use the same commands, with other database names, if your system has other databases running in MySQL.&lt;br /&gt;
&lt;br /&gt;
Stop Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder stop&lt;br /&gt;
&lt;br /&gt;
Backup Zoneminder database (or other databases)&lt;br /&gt;
&lt;br /&gt;
 mysqldump -uroot -p zm &amp;gt; zm.sql&lt;br /&gt;
&lt;br /&gt;
Upgrade the LAMP installed MySQL 5.7 to Mariadb with the command:&lt;br /&gt;
&lt;br /&gt;
 apt-get install mariadb-server&lt;br /&gt;
&lt;br /&gt;
Secure Mariadb, create root password et. al.&lt;br /&gt;
&lt;br /&gt;
 mysql_secure_installation&lt;br /&gt;
&lt;br /&gt;
Note: The MySQL/MariaDB configuration file is located at: /etc/mysql/mysql.conf.d/mysqld.cnf To better manage the MariaDB server I recommend you move the config file and replace the default my.cnf symbolic link.&lt;br /&gt;
&lt;br /&gt;
Remove the current symbolic link&lt;br /&gt;
&lt;br /&gt;
 rm /etc/mysql/my.cnf  &lt;br /&gt;
&lt;br /&gt;
Create new my.cnf&lt;br /&gt;
&lt;br /&gt;
 cp /etc/mysql/mariadb.conf.d/50-server.cnf /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
To change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit &lt;br /&gt;
&lt;br /&gt;
Create new empty zm database&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p&lt;br /&gt;
&lt;br /&gt;
You are now in the Mariadb console&lt;br /&gt;
&lt;br /&gt;
 CREATE DATABASE zm;&lt;br /&gt;
&lt;br /&gt;
Quit Mariadb console&lt;br /&gt;
&lt;br /&gt;
 \q&lt;br /&gt;
&lt;br /&gt;
Restore zm database from backup&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p zm &amp;lt; zm.sql&lt;br /&gt;
&lt;br /&gt;
Set permissions&lt;br /&gt;
&lt;br /&gt;
 mysql -uroot -p -e &amp;quot;grant all on zm.* to &amp;#039;zmuser&amp;#039;@localhost identified by &amp;#039;zmpass&amp;#039;;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Start Zoneminder&lt;br /&gt;
&lt;br /&gt;
 service zoneminder start&lt;br /&gt;
&lt;br /&gt;
You should now be running Mariadb server!&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Any_Version_12.04%2B_64-bit_with_Zoneminder_1.28.1_the_Docker_way_(two_commands)&amp;diff=15501</id>
		<title>Ubuntu Any Version 12.04+ 64-bit with Zoneminder 1.28.1 the Docker way (two commands)</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Any_Version_12.04%2B_64-bit_with_Zoneminder_1.28.1_the_Docker_way_(two_commands)&amp;diff=15501"/>
		<updated>2019-03-18T21:14:28Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;If you grabbed this image prior to 6-18-15 I suggest you repull it to have it work properly with the following command, otherwise continue with the real introduction&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 docker pull hrwebasst/docker-zoneminder&lt;br /&gt;
&lt;br /&gt;
== Real Introduction ==&lt;br /&gt;
&lt;br /&gt;
Docker is amazing, with this you will set up two different &amp;quot;containers&amp;quot; (you can think of these as chroots on steroids or VMs without the VM ;) )&lt;br /&gt;
&lt;br /&gt;
So why docker? Well did you want to deal with dependency issues or weird setup problems? Or did you want to deploy without an internet connection, or possibly download an exact working image at work/home then deploy off-site without internet? &amp;#039;&amp;#039;&amp;#039;No problem&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
= Install Docker =&lt;br /&gt;
&lt;br /&gt;
You can get full instructions [https://docs.docker.com/installation/ here] or this command should work for you.&lt;br /&gt;
&lt;br /&gt;
 wget -qO- https://get.docker.com/ | sh&lt;br /&gt;
&lt;br /&gt;
= Quick and dirty ZM 1.28.x install =&lt;br /&gt;
&lt;br /&gt;
 sudo docker run -d -e MYSQL_ROOT_PASSWORD=uberpass -e MYSQL_DATABASE=zm -e MYSQL_USER=zm -e MYSQL_PASSWORD=my-secret-pass --name=zm-mysql mysql&lt;br /&gt;
 sudo docker run -d --name=zoneminder --link=zm-mysql:mysql -p 443:443 --privileged=true hrwebasst/docker-zoneminder&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;How hard was that? Now you can browse to https://SERVER/zm&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Notice that we don&amp;#039;t need to give the zoneminder docker any information as the ENV vars are passed to it through the link.&lt;br /&gt;
&lt;br /&gt;
= Advanced information =&lt;br /&gt;
&lt;br /&gt;
In those above two commands the Environment Vars with the &amp;#039;-e&amp;#039; flag are creating database and connecting with those so you can modify them to your hearts content before running the commands. &lt;br /&gt;
&lt;br /&gt;
Here is how I run the servers:&lt;br /&gt;
&lt;br /&gt;
 sudo docker run -d --restart=always --name=mysql -v /var/local/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=uberpass -e MYSQL_DATABASE=zm -e MYSQL_USER=zm -e MYSQL_PASSWORD=uberpass mysql&lt;br /&gt;
 sudo docker run -d --restart=always --name=zoneminder -v /var/local/zm/images:/usr/share/zoneminder/images -v /var/local/zm/events:/usr/share/zoneminder/events --link=mysql:mysql -p 443:443 --privileged=true hrwebasst/docker-zoneminder&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ve now passed a few folders into the containers and told them to always restart. The -v flags pass in local directories to destination folders in the containers. We are also telling them to always restart.&lt;br /&gt;
&lt;br /&gt;
If you want to take the containers with you to do remote deploys you can. This gives you a tar of the entire container as created and you can deploy it without internet access on a machine with Docker installed. This is also handy for very slow internet connections.&lt;br /&gt;
&lt;br /&gt;
 docker pull mysql&lt;br /&gt;
 docker pull hrwebasst/docker-zoneminder&lt;br /&gt;
 docker export mysql &amp;gt; mysql.tar.gz &amp;amp;&amp;amp; docker export hrwebasst/docker-zoneminder &amp;gt; zoneminder.tar.gz&lt;br /&gt;
&lt;br /&gt;
then you can import them with:&lt;br /&gt;
 cat mysql.tar.gz | sudo docker import - mysql&lt;br /&gt;
 cat zoneminder.tar.gz | sudo docker import - zoneminder&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;If you get something like: FATA[0000] Error response from daemon: Conflict, The name zoneminder is already assigned to 0eb19f019a4f it means that your for some reason stopped your docker container and can&amp;#039;t reuse the name &amp;quot;zoneminder&amp;quot; to run another container. if this is the case then you should be able to just run &amp;quot;docker start zoneminder&amp;quot; and have it start back up.&amp;#039;&amp;#039;&amp;#039; If for some reason it&amp;#039;s broken and not starting you can run the following.&lt;br /&gt;
&lt;br /&gt;
 docker rm zoneminder&lt;br /&gt;
 docker pull hrwebasst/docker-zoneminder:latest&lt;br /&gt;
&lt;br /&gt;
and then rerun the above run command for zoneminder&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.26.5_the_easy_way&amp;diff=15500</id>
		<title>Ubuntu Server 14.04 64-bit with Zoneminder 1.26.5 the easy way</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.26.5_the_easy_way&amp;diff=15500"/>
		<updated>2019-03-18T21:14:12Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Ubuntu|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
If you are not experienced with Linux and would like a quick way to get Zoneminder running for you, consider Zoneminder on a stick, a per-configured Lubuntu 14.04 with Zoneminder 1.29.0. See: https://wiki.zoneminder.com/Lubuntu_14.04_with_Zoneminder_1.29.0_pre-configured_CD_or_USB &lt;br /&gt;
&lt;br /&gt;
Zoneminder 1.26.5-1 on Ubuntu 14.04 64 BIT and 32 BIT&lt;br /&gt;
&lt;br /&gt;
Note: This procedure is what I got to work after doing an upgrade from Ubuntu 12.04 with ZM 1.25.0 to Ubuntu 14.04 with the Ubuntu ZM package version 1.26.5. I compared the differences in the /etc/apache2 directory&amp;#039;s and the only difference I could find was the successful setup had a zoneminder.conf in /etc/apache2/conf.d. That and enabling the CGI got ZM to work. This was modified on 20APR14 to use a second symbolic link instead of a zoneminder.conf file. Granted, there may be other ways to do this and I welcome input on the ZM forum. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Ubuntu Server&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Basic Server (if you used the mini.iso), OpenSSH Server, and LAMP Server (LAMP installs Apache2, PHP, and MySQL server)&lt;br /&gt;
&lt;br /&gt;
Log in then become root:&lt;br /&gt;
&lt;br /&gt;
 sudo su&lt;br /&gt;
&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
 apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional: Set static IP address&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 nano /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
Make changes similar to this:&lt;br /&gt;
&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
   address 192.168.1.10&lt;br /&gt;
   netmask 255.255.255.0&lt;br /&gt;
   gateway 192.168.1.1&lt;br /&gt;
   dns-nameservers 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
Note: for Ubuntu 14.04 the resolv.conf is dynamically assigned.&lt;br /&gt;
The &amp;quot;dns-servers&amp;quot; entry in the interfaces file will set the DNS&lt;br /&gt;
Multiple DNS server entries can be used. &lt;br /&gt;
&lt;br /&gt;
Reboot server&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 apt-get install zoneminder&lt;br /&gt;
&lt;br /&gt;
Add delay to allow MySQL to start before Zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 nano /etc/init.d/zoneminder&lt;br /&gt;
&lt;br /&gt;
Add  sleep 15 as shown:&lt;br /&gt;
&lt;br /&gt;
 start() {&lt;br /&gt;
     sleep 15&lt;br /&gt;
 	echo -n &amp;quot;Starting $prog: &amp;quot;&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
Create  a directory in apache2&lt;br /&gt;
&lt;br /&gt;
 mkdir /etc/apache2/conf.d&lt;br /&gt;
&lt;br /&gt;
Create two symbolic links&lt;br /&gt;
&lt;br /&gt;
 ln -s /etc/zm/apache.conf /etc/apache2/conf-available/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
 ln -s /etc/apache2/conf-available/zoneminder.conf /etc/apache2/conf-enabled/zoneminder.conf&lt;br /&gt;
&lt;br /&gt;
CGI is not enabled in Ubuntu 14.04 by default. Enable it this way: &lt;br /&gt;
&lt;br /&gt;
 a2enmod cgi&lt;br /&gt;
&lt;br /&gt;
Create a new user&lt;br /&gt;
&lt;br /&gt;
 adduser www-data video&lt;br /&gt;
&lt;br /&gt;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 /etc/init.d/apache2 force-reload &lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
  service apache2 restart&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Cambozola&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 cd /usr/src &amp;amp;&amp;amp; wget http://www.andywilcock.com/code/cambozola/cambozola-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
 tar -xzvf cambozola-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
replace 935 with cambozola version downloaded&lt;br /&gt;
&lt;br /&gt;
 cp cambozola-0.935/dist/cambozola.jar /usr/share/zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NTP Daily Sync&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 nano /etc/cron.daily/ntpdate&lt;br /&gt;
&lt;br /&gt;
Copy the following into nano&lt;br /&gt;
&lt;br /&gt;
!/bin/sh&lt;br /&gt;
ntpdate ntp.ubuntu.com&lt;br /&gt;
&lt;br /&gt;
Ctrl+o Enter to save&lt;br /&gt;
&lt;br /&gt;
CTRL+x to exit&lt;br /&gt;
&lt;br /&gt;
 chmod 755 /etc/cron.daily/ntpdate&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open Zoneminder in web browser&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://serverip/zm&lt;br /&gt;
&lt;br /&gt;
Click Options&lt;br /&gt;
&lt;br /&gt;
Uncheck: Check with zoneminder.com for updated versions (?) click Save&lt;br /&gt;
&lt;br /&gt;
Click Images tab&lt;br /&gt;
&lt;br /&gt;
check 	Is the (optional) cambozola java streaming client installed (?)&lt;br /&gt;
Click Save&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot server to insure Zoneminder starts on boot.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15493</id>
		<title>Understanding ZoneMinder&#039;s Zoning system for Dummies</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=15493"/>
		<updated>2019-03-11T17:05:01Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Pixels or percents? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has a powerful zone detection system using which you can modify how sensitive, precise, accurate your motion alarms are. The official ZM documentation does a good job of describing all the concepts [http://www.zoneminder.com/wiki/index.php/Defining_Zones here]. However, you will see &lt;br /&gt;
gobs of posts in the forum about people complaining that ZM logs all sorts of events (ahem, as did I), ZM&amp;#039;s detection is rubbish and in-camera is better (ahem, as did I) and what not. But once you get the concept, its incredibly powerful.&lt;br /&gt;
&lt;br /&gt;
So instead of giving you a theoretical explanation, lets walk through a live use-case. (Credit: user kkrofft helped a lot in me getting a hang of things [http://www.zoneminder.com/forums/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://www.zoneminder.com/forums/viewtopic.php?f=11&amp;amp;t=22239&amp;amp;p=84476#p84476 here])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Some concepts===&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s take a look at this area below. Lets suppose you want to trigger motion if someone tries to break into your basement. Does it make sense you monitor the full area (pillars/walls/floor)? Probably not. If someone were to break in, they&amp;#039;d break in from some door, some window, or maybe break in from upstairs and climb down the stairs. So doesn&amp;#039;t it make more sense to monitor these areas specifically? I think so. So the first &amp;#039;common sense&amp;#039; logic is delete the default zone that ZM creates for each monitor (which is called All). Monitoring every part of your image may make sense if you are monitoring and outdoor lawn, for example. Not here&lt;br /&gt;
&lt;br /&gt;
[[File:Nph-zms.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Defining the zone areas ===&lt;br /&gt;
So given the explanation above, how about we define zones where motion matters? Any zone you define as &amp;quot;active&amp;quot; is what ZoneMinder will analyze for motion. Ignore the &amp;#039;preclusive for now&amp;#039;. So lets look at the image below. I&amp;#039;ve defined polygons around places that are the &amp;quot;entry points&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:With_zones.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Okay, now how do I specify the sensitivity of the zones? ===&lt;br /&gt;
&lt;br /&gt;
ZoneMinder has pre-sets. We live in a world of pre-sets. I bet you want to select &amp;quot;Best and highly sensitive&amp;quot; don&amp;#039;t you? DON&amp;#039;T.&lt;br /&gt;
Not because that setting is nonsense, but because you should understand some concepts first.&lt;br /&gt;
&lt;br /&gt;
==== Core Concepts ====&lt;br /&gt;
The ZM wiki I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, its important to note:&lt;br /&gt;
&lt;br /&gt;
* ZM does NOT understand objects. It only understands pixel colors. So if you are monitoring a camera that is producing a 1280x960 32bit color depth image, as far as ZM is concerned, it is getting an array of 1280*960*32 bits of data to analyze and compare a previous frame and based on &amp;#039;color differences&amp;#039; between frame X-1 and X along with some algorithms it applies in addition to color differences, it tries and guesses if objects (in ZM speak, a specific pattern of pixels) have come up that were not there previously.&lt;br /&gt;
&lt;br /&gt;
* ZM has 3 methods of detection: Alarmed Pixels, Filtered Pixels and Blobs. Here is a visual explanation of their differences&lt;br /&gt;
&lt;br /&gt;
The first image is a 20x20 grid. Let&amp;#039;s assume this is a zone. And the black circle is some object in this grid.&lt;br /&gt;
The second image shows the next frame of that image, where new &amp;#039;objects&amp;#039; have appeared, or in ZM&amp;#039;s view &amp;#039;new sets of pixel patterns&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s talk about Alarmed Pixels, Filtered Pixels and Blobs&lt;br /&gt;
&lt;br /&gt;
[[File:Reference.jpg]]&lt;br /&gt;
[[File:Reference next frame.jpg]]&lt;br /&gt;
&lt;br /&gt;
=====Alarmed Pixels=====&lt;br /&gt;
Alarmed pixels only deals with pixels changes. If we use the alarmed pixel method and specify a minimum of &amp;quot;5 pixel&amp;quot; changes (lets forget max for now), then &lt;br /&gt;
all the new pixels of set A + B + C + D will count as alarmed pixels and the total alarmed pixel count will be A+B+C+D&lt;br /&gt;
&lt;br /&gt;
=====Filtered Pixels=====&lt;br /&gt;
Now let&amp;#039;s assume we used Filtered pixels and set it to 2x2 pixels. The in addition to computing the alarmed pixels (A+B+C+D), it will also count how many of these sets have at least 2 pixels around them that are also alarmed pixels. This will result in B+C+D (set A will be discarded as they don&amp;#039;t have any pixels surrounded by at least 2 pixels that have changed color from the prev. frame)&lt;br /&gt;
&lt;br /&gt;
=====Blob Pixels=====&lt;br /&gt;
Now lets assume we used Blob and said a blob needs to be at least 10 pixels. Then what it will do is based on the set computed by Filtered pixels, which is B+C+D it will look for contiguous blobs of 10 pixels and that only means D&lt;br /&gt;
&lt;br /&gt;
So, in Alarmed pixels any of A, B, C or D would raise an alarm&lt;br /&gt;
In filtered pixel mode, only B, C or D would raise an alarm&lt;br /&gt;
In blob mode only D would raise an alarm&lt;br /&gt;
&lt;br /&gt;
Okay, that was a simple explanation. And I did not cover more details on min/max. But I hope you get the core idea..&lt;br /&gt;
&lt;br /&gt;
===Yawn. Forget the theory. Let&amp;#039;s get back to your basement image===&lt;br /&gt;
&lt;br /&gt;
Okay, back to my basement and my 3 zones. &lt;br /&gt;
====Which detection type should I use?====&lt;br /&gt;
I personally feel to detect &amp;quot;humans&amp;quot;, blob is the best. As I described above, it combines Alarm + Filtered + ensures that the pixel differences are contiguous and then does an algorithmic analysis to see if it forms &amp;#039;blobs&amp;#039;&lt;br /&gt;
&lt;br /&gt;
====Pixels or percents?====&lt;br /&gt;
What makes more sense to you? &amp;quot;Raise an alarm if 178 pixels are changed&amp;quot; or &amp;quot;Raise an alarm if more than 20% of my zone has changed?&amp;quot;. To me, the latter makes much more sense.&lt;br /&gt;
So I&amp;#039;ve always used percents&lt;br /&gt;
(Updated in 2019: Given a lot of people seem to refer to this article, in some cases, it does make more sense to use pixels, especially if the difference in sizes is small. Example: its not possible to visualize the difference between 10% and 15%)&lt;br /&gt;
&lt;br /&gt;
====Right percents. But what values?====&lt;br /&gt;
&lt;br /&gt;
It helps to think visually  here. Let&amp;#039;s go back to the zones I drew of my basement and try and visually place how a person and a pet would look in each zone. Here is a take:&lt;br /&gt;
[[File:Of_men_and_animals.jpg]]&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Zones and Depths:&amp;#039;&amp;#039;&amp;#039; One of the learning for me was that don&amp;#039;t make zones cover a lot of depth as far as the camera lens goes. Why? Well take a look at the image above. As a person or a pet walks away or towards the camera, it gets significantly bigger or smaller (right, that was not rocket science, but sometimes commonsense 101 helps)&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Percent vs. Pixels:&amp;#039;&amp;#039;&amp;#039; Back to my previous point -if you specify alarmed areas in pixels, in addition to being able to visualize better (at least for me) the added advantage is the setting scales as zone sizes changes.  For example the % of space the person takes in my far end &amp;quot;Door&amp;quot; zone is quite similar to the % of space the person takes in my couch area (in other words, both the zone and person have scaled up in size, so relative % is still the same)&lt;br /&gt;
&lt;br /&gt;
* So having said all of this, this is what my zone definition for the &amp;quot;stairs area&amp;quot; looks like:&lt;br /&gt;
&lt;br /&gt;
====Stairs Zone====&lt;br /&gt;
&lt;br /&gt;
[[File:Stairs foyer.png]]&lt;br /&gt;
&lt;br /&gt;
Lets see how ZM will use these values:&lt;br /&gt;
&lt;br /&gt;
* Use the &amp;quot;blob&amp;quot; method to detect movement (which means first use Alarmed pixels, then use Filtered Pixels, then use Blob)&lt;br /&gt;
&lt;br /&gt;
ZM&amp;#039;s motion detection algorithm for this zone:&lt;br /&gt;
&lt;br /&gt;
#Set A = full zone pixels&lt;br /&gt;
#(Min/Max Pixel Thres) In the *Full* area defined by the zone, check if there are any pixels that have have a 40 count difference in pixel color from a previous. Assign to Set B. If Set B = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest. &lt;br /&gt;
#(Min/Max Alarmed Area) check if Set B is at least 6% of Set A and not more than 75% of Set A. If Set B does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest.&lt;br /&gt;
#(Filter Width/Height) In the set of pixels (Set B) that are different in color value of 40, check if there are pixels that are surrounded by 5 more pixels around them that are also different in color value of 40. Assign to Set C. If Set C = null, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Filtered Area) check if Set C forms at least 4% of Set A but no more than 75% of Set A. If Set C does not fall in this range, don&amp;#039;t raise alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#(Min/Max Blob Area) use Blob logic on Set C to figure out how many Blobs are there. A blob that is at least 4% in size of Set A (full pixels) is considered a blob. Assign this to Set D. &lt;br /&gt;
#(Min/Max Blobs) - If the # of blobs in Set D is less than 1, don&amp;#039;t raise an alarm, don&amp;#039;t proceed with rest&lt;br /&gt;
#&amp;#039;&amp;#039;&amp;#039; Raise Alarm!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Note the percentages I describe above seem lesser than the visual percentages when you look at the image. First, my image is not to scale. Second, I guess I could increase the percentages, but these values are working quite well for me, but in reality I guess I could easily increase, say, 6% to 10%. In general, I&amp;#039;d recommend using the least value that is not triggered by small things - keep raising it till you stop getting 90% of spurious alarms, but no further. If you try and eliminate all spurious events, then its likely you will also miss some valid motion (that&amp;#039;s a non scientific anecdotal statement, so feel free to challenge me here)&lt;br /&gt;
&lt;br /&gt;
====Door Zone====&lt;br /&gt;
Here is my zone setting for the door (Edit note: the max alarmed/filtered area was changed to 70% - the image shows 90%)&lt;br /&gt;
&lt;br /&gt;
[[File:Door.png]]&lt;br /&gt;
&lt;br /&gt;
The logic is similar to the foyer area - plus, I&amp;#039;ve used the overload frame count -- basically the sun blasts through the blinds and in those cases the % change is very large (around 75+%) which triggers my max % spec and in that case, I tell zoneminder to ignore the next 2 frames so that this excessive lighting condition does not raise lots of alarms. BTW, this is one zone where I still get 4-5 false events in a day. I am fine with it and prefer to live with it.&lt;br /&gt;
&lt;br /&gt;
====Ah, I get it. But hey what&amp;#039;s that preclusive zone in your image at the start of this artlce?====&lt;br /&gt;
Ah, ZM allows us to specify a zone where should an alarm occur, it suppresses alarms in that zone and all other zones in the monitor. I&amp;#039;ve set it to cover my recess lights. &lt;br /&gt;
So if someone turns our lights on, I won&amp;#039;t get an alarm. Does it work? Yep pretty well. Does it always work? Mostly. Heh heh.&lt;br /&gt;
&lt;br /&gt;
===Some other optimizations===&lt;br /&gt;
There are other optimizations you can do. Another setting I found useful is to use &amp;quot;Alarm Frame Count&amp;quot;. This is not part of Zones, but part of your monitor definition (Buffers tab). It specifies the minimum amount of alarm frames to trigger an alarm. Most of my cameras are on Wifi and my basement is farthest away from my AP, so I occasionally get smearing. Setting this to 3 reduces almost all smears raising an alarm&lt;br /&gt;
&lt;br /&gt;
===You&amp;#039;re a dork. None of this mumbo jumbo worked for me. I want my money back===&lt;br /&gt;
Life sucks. Take a break. Drink a glass of wine. Or two. Then get back to your settings. And its possible these don&amp;#039;t work for you - try different values. Think visually.&lt;br /&gt;
Oh, and I&amp;#039;ll need a postage paid envelope to email you a $0 cheque. And a $5 cheque from you to pay for gas to drive to the nearest post box. Labor is free because you did not like my article. There is a lifetime return policy, you see.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Various_ZM_thoughts&amp;diff=15355</id>
		<title>Various ZM thoughts</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Various_ZM_thoughts&amp;diff=15355"/>
		<updated>2018-10-26T15:03:05Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Topics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most of these were written when I first discovered ZoneMinder in 2015. ZM 1.28 was the stable release then. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;[[Contents]]&lt;br /&gt;
&lt;br /&gt;
==Topics==&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/zmninja/inside-the-hood-machine-learning-enhanced-real-time-alarms-with-zoneminder-e26c34fe354c ZoneMinder with Machine Learning]&lt;br /&gt;
&lt;br /&gt;
[[Understanding ZoneMinder&amp;#039;s Zoning system for Dummies]] (Illustrated)&lt;br /&gt;
&lt;br /&gt;
[[Ubuntu Server or Ubuntu Desktop?]]&lt;br /&gt;
&lt;br /&gt;
[[How to get ssmtp working with Zoneminder]]&lt;br /&gt;
&lt;br /&gt;
[[Doing your best to get rid of smudging in FFMPEG transcoding of RTSP streams]]&lt;br /&gt;
&lt;br /&gt;
[[How to use your external camera&amp;#039;s motion detection with ZM]] (and a basic explanation of ZM&amp;#039;s trigger architecture)&lt;br /&gt;
&lt;br /&gt;
[[Math for Memory - knowing how much memory you need and how to optimize]]&lt;br /&gt;
&lt;br /&gt;
[[Estimating how much HDD space you need for recording]]&lt;br /&gt;
&lt;br /&gt;
[[How to control your Foscam HD cameras - PTZ]] &lt;br /&gt;
&lt;br /&gt;
[[Using your iPhone&amp;#039;s location to start ZM recording]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;[[Modifying ZoneMinder to remember run state names]] (and why that is very useful)&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[How to use ZoneMinder with cameras it may not directly support]] (but you have some way to extract images from it)&lt;br /&gt;
&lt;br /&gt;
[[Mobile companion apps]]&lt;br /&gt;
&lt;br /&gt;
[[Exporting images to Video]]&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=How_to_use_your_external_camera%27s_motion_detection_with_ZM&amp;diff=15211</id>
		<title>How to use your external camera&#039;s motion detection with ZM</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=How_to_use_your_external_camera%27s_motion_detection_with_ZM&amp;diff=15211"/>
		<updated>2018-08-06T18:40:31Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Source code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
Zone minder has an awesome &amp;#039;trigger&amp;#039; architecture which allows any external event to trigger a recording on ZoneMinder. This section explains the basic architecture and then goes on to describe how you can use your own camera&amp;#039;s HW motion detection to trigger a recording on ZM. You can replace this &amp;#039;trigger&amp;#039; with any other event - such as, for example, triggering your ZM recording when say your Nest thermostat goes to Away mode. The options are limitless&lt;br /&gt;
&lt;br /&gt;
=== Core Trigger Architecture===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
                      +-----------------+                                                                &lt;br /&gt;
                      |  zmtrigger.pl   |  record on/off                                                 &lt;br /&gt;
                      |listening on port|  directives over TCP (and other IPC mechanisms)                                          &lt;br /&gt;
                      |      6802       |&amp;lt;------+                                                        &lt;br /&gt;
                      |                 |       |                          polling or notification   x   &lt;br /&gt;
                      +-+---------------+       |                          - depends on device      / \  &lt;br /&gt;
                        |                       |                          capabilities            /   \ &lt;br /&gt;
                        |                       |                                 +---------------&amp;gt;     |&lt;br /&gt;
                        |                       |                                 |                \   / &lt;br /&gt;
                        |                       |                                 |                 \ /  &lt;br /&gt;
+----------------+      | record                |       +---------+               |                      &lt;br /&gt;
|                |      |                       |       | my own  |               |                device&lt;br /&gt;
|  Rest of Zone  |      |                       +-------| script  |&amp;lt;--------------+                      &lt;br /&gt;
|     Minder     &amp;lt;------+                               +---------+                                      &lt;br /&gt;
|                |                                                                                       &lt;br /&gt;
+----------------+                                                                                       &lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you enable OPT_TRIGGERS in Options-&amp;gt;System, then ZoneMinder starts a process called &amp;quot;zmtrigger.pl&amp;quot; (/usr/bin/zmtrigger.pl). This is a perl script that basically offers an easy to use interface for anyone to send it commands to its default TCP port (6802) to initiate/stop recordings. Note that zmtrigger also offers other means of IPC - I just found the TCP channel easy and reliable. &lt;br /&gt;
&lt;br /&gt;
zmtrigger does not care what caused the event. All it is waiting for is a simple text instruction from anyone capable of sending a command to port 6802. So what that means is I can write any program that monitors anything, and when my program thinks something happened which warrants a recording, all I need to tell zmtrigger is &amp;quot;please record monitor 3&amp;quot; (and optionally specify more parameters)&lt;br /&gt;
&lt;br /&gt;
===Requirements for Triggering===&lt;br /&gt;
* OPT_TRIGGERS need to be enabled&lt;br /&gt;
* Prior to ZoneMinder v1.30.2, the monitor mode MUST be set to Nodect (ZM won&amp;#039;t initiate recordings if in any other mode).&lt;br /&gt;
&lt;br /&gt;
(To combine both ZM normal recording, and say external triggers, with ZoneMinder prior to v1.30.2 you can always add two monitors pointing to the same camera - one in say modect and the other in nodect and use the latter one for external triggers)&lt;br /&gt;
&lt;br /&gt;
===Quick test===&lt;br /&gt;
Lets assume you have a monitor id of 1. As a quick test, just try this &lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
telnet zm_ip 6802&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
And when connected via telnet simply type in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
1|on+20|1|External Motion|External Motion&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should see ZM create a new recording for Monitor ID=1 for 20 seconds with a name and cause of &amp;quot;External Motion&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Implementation Strategy===&lt;br /&gt;
&lt;br /&gt;
* Foscam&amp;#039;s [http://foscam.us/forum/cgi-sdk-for-hd-camera-t6045.html CGI document] shows that if the camera&amp;#039;s motion detection is enabled, then when it detects motion, you can use the getDevState command - if the value of XML tag &amp;lt;motionDetectAlarm&amp;gt; is 2 then motion is detected. It resets back to 1 if there is no motion detect&lt;br /&gt;
* Unfortunately, Foscam does not support posting events/callbacks when motion is detected. Note that there are cameras that support web hooks for motion notifications, like Axis cameras.&lt;br /&gt;
* so I need to poll it once every few seconds and check this value&lt;br /&gt;
* If this value == 2, send a record request to zmtrigger (and thanks to ZM&amp;#039;s ring buffer, I won&amp;#039;t miss the image that caused the alarm)&lt;br /&gt;
&lt;br /&gt;
===Source code===&lt;br /&gt;
Here is the code to do just that (and some other checks for optimization)&lt;br /&gt;
It loops through all my cameras and sends triggers when motion is detected&lt;br /&gt;
&lt;br /&gt;
https://github.com/pliablepixels/ZoneMinderFoscamHDTrigger/blob/master/arc_zm_foscamHDmotion.pl&lt;br /&gt;
uh-oh, looks like I deleted that repo by mistake. I don&amp;#039;t have a copy. But looks like someone else took that code and improved it - see his repo here https://github.com/jshank/ZoneMinderHikvisionTrigger&lt;br /&gt;
&lt;br /&gt;
===Notes===&lt;br /&gt;
* Your imagination is the limit here - you can create triggers for any thing you want - ZM doesn&amp;#039;t care what the trigger is. As long as your script tells zmtrigger to start/stop recording and for which monitor, that is all ZM needs&lt;br /&gt;
* I initially used my camera&amp;#039;s HW motion detection for a few weeks, after getting frustrated trying to configure ZM&amp;#039;s own zone system, but when I understood how to use ZM&amp;#039;s own zone detection, it was better&lt;br /&gt;
* If you are worried if this constant pinging of the foscam may slow it down, it does not. I used it for weeks without any problem&lt;br /&gt;
&lt;br /&gt;
===References I found useful===&lt;br /&gt;
http://www.sparxeng.com/blog/software/zoneminder-network-triggering&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=How_to_control_your_Foscam_HD_cameras_-_PTZ&amp;diff=15206</id>
		<title>How to control your Foscam HD cameras - PTZ</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=How_to_control_your_Foscam_HD_cameras_-_PTZ&amp;diff=15206"/>
		<updated>2018-07-27T19:29:57Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Making PTZ work for Foscam HD cameras (9831W, but should work on all others)===&lt;br /&gt;
Zone minder already comes with a control script called FI9821W_Y2k.pm by Christophe Dapremont that does all the hard work. &lt;br /&gt;
I only had to trivially modify it. the key change I made was that the script hardcodes an authentication login/password in the script. &lt;br /&gt;
I removed it, and made it so that you can use the &amp;quot;Control Device&amp;quot; field of ZM to specify the password&lt;br /&gt;
&lt;br /&gt;
I also noticed he did not add cruise mode - I might do that myself when I have the inclination (which I currently don&amp;#039;t as I never use PTZ within ZM).&lt;br /&gt;
&lt;br /&gt;
=== The updated PTZ script ===&lt;br /&gt;
You can find it here: https://github.com/pliablepixels/zmhacks/blob/master/FI9831W_arc.pm&lt;br /&gt;
&lt;br /&gt;
=== How to set up ZM to recognize the script ===&lt;br /&gt;
&lt;br /&gt;
==== Quick and Dirty way ====&lt;br /&gt;
If you are  trivially modifying an existing script, you don&amp;#039;t need any of the below - you can just modify the script and be done&lt;br /&gt;
I could have just modified the _y2k script since my changes were very small, but I preferred to do a new script and not mess&lt;br /&gt;
with the original&lt;br /&gt;
&lt;br /&gt;
==== The proper way ====&lt;br /&gt;
* Copy to /usr/share/perl5/ZoneMinder/Control&lt;br /&gt;
* Make sure OPT_CONTROL is checked in Options-&amp;gt;System of ZM&lt;br /&gt;
* You also need to make sure you create a new control in ZM. To do this&lt;br /&gt;
** Click on any monitor &amp;quot;source&amp;quot; column. That will bring up your configuration screen for that monitor&lt;br /&gt;
** Click on &amp;quot;Edit&amp;quot; next to Control Type. This brings up a big list of existing controls (you won&amp;#039;t see your new script here)&lt;br /&gt;
** Click on &amp;quot;Add New Control&amp;quot;&lt;br /&gt;
*** Main Tab&lt;br /&gt;
****Name: Foscam 9831W&lt;br /&gt;
****Type: FFmpeg&lt;br /&gt;
****Protocol:FI9831W_arc (IMPORTANT: needs to be exactly the same as the .pm file you just copied, except the .pm extension)&lt;br /&gt;
****Check &amp;quot;Can Reset&amp;quot; leave the rest unchecked&lt;br /&gt;
***Move Tab&lt;br /&gt;
**** Check CAN MOVE, CAN MOVE DIAGONALLY, CAN MOVE CONTINUOUS&lt;br /&gt;
***Pan Tab&lt;br /&gt;
****Check CAN PAN, min pan range =0, max pan range = 360, min pan step = 0, max pan step = 360&lt;br /&gt;
****Check HAS PAN SPEED, min pan speed =0, max pan speed = 4&lt;br /&gt;
***Tilt Tab&lt;br /&gt;
****Check CAN TILT, and min tilt range=0, max tilt range=90; min tilt step=0, min tilt step=90&lt;br /&gt;
****Check HAS TILT SPEED, min speed = 0, max speed = 4&lt;br /&gt;
***Zoom, Focus, White, Iris Tabs -- leave unchecked (though I think it has WB)&lt;br /&gt;
***Preset Tab&lt;br /&gt;
****Check HAS PRESETS, NUM PRESETS=16, Check HAS HOME PRESET and CAN SET PRESETS&lt;br /&gt;
&lt;br /&gt;
=== How to associate a camera to your new control ===&lt;br /&gt;
* Click on the &amp;quot;source&amp;quot; column of your monitor&lt;br /&gt;
* Click on Control Tab&lt;br /&gt;
* Check &amp;quot;Controllable&amp;quot;&lt;br /&gt;
* Control Type: Your new Control (FI9831W_arc) should now be in this list. If not, reboot ZM once, or restart it and it should show up. If not, you messed up something. Review previous section&lt;br /&gt;
* In Control Device type in&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
usr=xxxxx&amp;amp;pwd=xxxxxx&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
replace xxxx with your foscam login and password. IMPORTANT: Remember its &amp;quot;usr&amp;quot; not &amp;quot;user&amp;quot; and &amp;quot;pwd&amp;quot; not &amp;quot;password&amp;quot;&lt;br /&gt;
* In Control Address type in &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 ip:port&lt;br /&gt;
&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
of your camera&lt;br /&gt;
&lt;br /&gt;
I also put in a value of 1 in auto stop timeout (I don&amp;#039;t think it matters)&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s all, click and save&lt;br /&gt;
&lt;br /&gt;
=== How to test ===&lt;br /&gt;
* First off, monitor your logs while testing - it can tell you a lot if things don&amp;#039;t work (I just do tail -f /var/log/syslog)&lt;br /&gt;
* Click on the Name column of your monitor to which you just added PTZ control&lt;br /&gt;
* Click on the &amp;quot;Control&amp;quot; link at the top of the new window showing your live stream&lt;br /&gt;
* Control away (don&amp;#039;t get impatient, ZM sometimes takes some time to process your control commands)&lt;br /&gt;
&lt;br /&gt;
=== More fine tuning ===&lt;br /&gt;
Foscam has released its CGI User Manual - all PTZ controls are listed there. It&amp;#039;s pretty easy to modify your script to make it more accurate and feature rich (example Cruise control)&lt;br /&gt;
You can read the CGI document [http://foscam.us/forum/cgi-sdk-for-hd-camera-t6045.html here]. I&amp;#039;d strongly recommend you read it if you want to tinker.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=MobileDevices&amp;diff=15025</id>
		<title>MobileDevices</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=MobileDevices&amp;diff=15025"/>
		<updated>2018-01-25T20:07:53Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Mobile apps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can opt to use the standard ZoneMinder web console on your mobile devices using mobile browsers. Alternately, there are mobile apps available you can use:&lt;br /&gt;
&lt;br /&gt;
====Mobile apps====&lt;br /&gt;
[http://pliablepixels.github.io/ ZmNinja] - iPhone/Android/Windows/Mac/Linux app for ZoneMinder &lt;br /&gt;
&lt;br /&gt;
[http://html5-clouds.com/?q=node/55 zmView/zmViewPro]  - iPhone/Android app for ZoneMinder&lt;br /&gt;
&lt;br /&gt;
[https://itunes.apple.com/app/surveillance-pro/id1200773811 Surveillance Pro] - IOS App, iPhone, iPod and iPad&lt;br /&gt;
&lt;br /&gt;
Zoneminder, starting with stable version 1.29 (and development snapshot version 1.28.107) support a REST based API. mobile and XHTML skins &lt;br /&gt;
are no longer actively maintained and will be discontinued after 1.29. Any mobile clients not using the API and relying on the skins will stop working.&lt;br /&gt;
Mobile app authors who are still maintaining their code are encouraged to use the new API.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Using_your_iPhone%27s_location_to_start_ZM_recording&amp;diff=14900</id>
		<title>Using your iPhone&#039;s location to start ZM recording</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Using_your_iPhone%27s_location_to_start_ZM_recording&amp;diff=14900"/>
		<updated>2017-12-23T18:31:50Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04|&amp;lt;Home]]&lt;br /&gt;
&lt;br /&gt;
===Why do we need it?===&lt;br /&gt;
&lt;br /&gt;
Your life doesn&amp;#039;t always follow a schedule, does it? So how can you expect your camera to follow the same schedule every day? In this day of Connected Devices, most of us carry our phones with us all the time.&lt;br /&gt;
So wouldn&amp;#039;t it be cool if despite whatever you have in cron, there is a way to check if your smart phone is at home or away and depending on its location, you enable/disable recording?&lt;br /&gt;
&lt;br /&gt;
===Gotchas===&lt;br /&gt;
Ah. super useful. But what&amp;#039;s the big deal?&lt;br /&gt;
* How about I just allocate a permanent lan IP to my phone and ping it every 5 minutes? &lt;br /&gt;
** Great idea. Except it doesn&amp;#039;t work with phones. When phones go to sleep mode, they don&amp;#039;t respond to ICMP. (Apparently Blackberries do respond - how cute)&lt;br /&gt;
* Hmm, how about I arping or arpscan?&lt;br /&gt;
** Now you are getting closer. Unfortunately, that doesn&amp;#039;t work for iPhones - at least for 5. It gives random results - and I can&amp;#039;t seem to use it reliably&lt;br /&gt;
** If your phone does respond reliably to arping or arpscan, check out Christo&amp;#039;s shell script here: http://www.zoneminder.com/forums/viewtopic.php?f=9&amp;amp;t=23026&lt;br /&gt;
&lt;br /&gt;
===Solution for iPhone===&lt;br /&gt;
The only way I found out to reliably  know if your iPhone is in or out of your home is to use the iCloud find my iPhone service and get your phone&amp;#039;s location.&lt;br /&gt;
But how do you get to iCloud? Apple does not expose its APIs to non iOS environments (so far). Well, enter pyicloud: https://github.com/picklepete/pyicloud&lt;br /&gt;
&lt;br /&gt;
This is a 3rd party library that provides you iCloud access. Obviously, it can break in future if Apple decided to change its URL formats. But works great for now.&lt;br /&gt;
&lt;br /&gt;
====Strategy====&lt;br /&gt;
* I check the location of my phone every hour using a script (that uses pyicloud). The reason for this is pyicloud logs into iCloud using its web interface and I don&amp;#039;t want Apple taking any security measures on my account if it detects too many logins. You can try other intervals&lt;br /&gt;
* That script writes the word &amp;#039;in&amp;#039; or &amp;#039;out&amp;#039; to a text file&lt;br /&gt;
* I check the status of that script as a cron job and switch ZM state forcibly if I find it conflicting with ZM&amp;#039;s current run state (I tie this hack into my other hack where I modified ZM to remember run state names - you don&amp;#039;t have to)&lt;br /&gt;
&lt;br /&gt;
====Implementation====&lt;br /&gt;
Here are the files:&lt;br /&gt;
*python file to check for location: https://github.com/pliablepixels/zmhacks/blob/master/arc_zm_iphone.py&lt;br /&gt;
*Cron file to run the location checker every 1 hr, and check generated file status as well: https://github.com/pliablepixels/zmhacks/blob/master/cronfile&lt;br /&gt;
*Other utility scripts that I refer to - https://github.com/pliablepixels/zmhacks&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Foscam_C1&amp;diff=14147</id>
		<title>Foscam C1</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Foscam_C1&amp;diff=14147"/>
		<updated>2016-09-16T11:34:29Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Source Type: FFmpeg&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Source Path: rtsp://&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;@&amp;lt;ip&amp;gt;/videoMain&lt;br /&gt;
* Remote Method: RTP/RTSP&lt;br /&gt;
* Target Colorspace: 32 bit&lt;br /&gt;
* Capture Width: 1280&lt;br /&gt;
* Capture Height: 720&lt;br /&gt;
* Deinterlacing: Disabled&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Controllable: No&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Foscam_C1&amp;diff=14146</id>
		<title>Foscam C1</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Foscam_C1&amp;diff=14146"/>
		<updated>2016-09-16T11:33:16Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Source Type: FFmpeg&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Source Path: rtsp://&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;@&amp;lt;ip&amp;gt;/videoMain&lt;br /&gt;
* Remote Method: RTP/RTSP&lt;br /&gt;
* Target Colorspace: 32 bit&lt;br /&gt;
* Capture Width: 1280&lt;br /&gt;
* Capture Height: 720&lt;br /&gt;
* Deinterlacing: Disabled&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Foscam_C1&amp;diff=14145</id>
		<title>Foscam C1</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Foscam_C1&amp;diff=14145"/>
		<updated>2016-09-16T11:32:32Z</updated>

		<summary type="html">&lt;p&gt;Asker: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039; Source Type: FFmpeg  &amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039; Source Path: rtsp://&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;@&amp;lt;ip&amp;gt;/videoMain Remote Method: RTP/RTSP Target Colorspace: 32 bit Capture Width: 1280 Capt...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Source Type: FFmpeg&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Source Path: rtsp://&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;@&amp;lt;ip&amp;gt;/videoMain&lt;br /&gt;
Remote Method: RTP/RTSP&lt;br /&gt;
Target Colorspace: 32 bit&lt;br /&gt;
Capture Width: 1280&lt;br /&gt;
Capture Height: 720&lt;br /&gt;
Deinterlacing: Disabled&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Foscam&amp;diff=14144</id>
		<title>Foscam</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Foscam&amp;diff=14144"/>
		<updated>2016-09-16T11:29:54Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Model specific wikis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Model specific wikis==&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9831W|Foscam FI9831W Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI8918W|Foscam FI8918W Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI8910W|Foscam FI8910W Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8904W|Foscam FI8904W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8905W|Foscam FI8905W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8602W|Foscam FI8602W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9801/2W|Foscam FI9801/2W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9805W|Foscam FI9805W Megapixel Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9851P|Foscam FI9851P H.264 HD Wireless Indoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9803EP|Foscam FI9803EP POE Outdoor IP Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI9903P |Foscam FI9903P Outdoor IP Camara]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8921P|Foscam FI8921P Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI9821W V2|Foscam FI9821W v2 Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam C1]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam Clones]]&lt;br /&gt;
&lt;br /&gt;
[[Wanscam|Wanscam FR4020A2 (Foscam clone)]]&lt;br /&gt;
&lt;br /&gt;
==General Foscam directions==&lt;br /&gt;
&lt;br /&gt;
(This was very helpful for me, but instead of &amp;#039;videostream&amp;#039; below I believe &lt;br /&gt;
it should be &amp;#039;snapshot&amp;#039;.  Using videostream my wifi, using iptraf to monitor&lt;br /&gt;
it, was fluctuating wildly from zero to 5 mbps and lots of events were missed.&lt;br /&gt;
Now that I&amp;#039;m using the snapshot cgi (/snapshot.cgi?user=mine&amp;amp;pwd=mine) &lt;br /&gt;
iptraf shows a steady stream that behaves as expected, jumps up when alarmed,&lt;br /&gt;
am getting the performance from zoneminder other are, where using the&lt;br /&gt;
videostream as below got nothing but furstration...   Best to y&amp;#039;all, gsx)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Foscam FI8908W IP Camera with PT (no Z) Working in ZM 1.24.2&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Firmware 11_14_2_28 with presets working. --[[User:Lowbayer|Lowbayer]] 21:39, 12 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
(This also works with the Foscam FI8918W camera.  No sound though.)&lt;br /&gt;
&lt;br /&gt;
See here for detail on [[Foscam_FI8918W]] with presets working. [[User:Hdurdle|Hdurdle]] 23:18, 26 February 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Just thought this might be useful for anybody using the Foscam IP FI8908W Cameras.&lt;br /&gt;
&lt;br /&gt;
They can be bought on eBay for around £50 and for that money they are a great buy. (Beware of fakes, see here: http://www.gadgetvictims.com/2009/09/yet-another-firmware-for-foscam-fi8908w.html)&lt;br /&gt;
&lt;br /&gt;
A firmware upgrade can be performed to allow Server Push Mode, for FireFox etc.&lt;br /&gt;
&lt;br /&gt;
See here for a instructions and a link to the firmware file:&lt;br /&gt;
http://www.gadgetvictims.com/2009/07/foscam-ip-camera-part-two.html&lt;br /&gt;
&lt;br /&gt;
I recommend firmware V11.14.1.42 and Web UI V2.4.8.11&lt;br /&gt;
&lt;br /&gt;
Once that is done you can proceed to add the camera into ZoneMinder with the following settings:&lt;br /&gt;
&lt;br /&gt;
;General:&lt;br /&gt;
:Name: x&lt;br /&gt;
:Source Type: Remote&lt;br /&gt;
:Function: Modect (up to you though)&lt;br /&gt;
:Enabled: Tick&lt;br /&gt;
:Maximum FPS: Empty (I had some issues with it lagging when I used values here)&lt;br /&gt;
:Alarm Maximum FPS: Empty&lt;br /&gt;
;Source&lt;br /&gt;
:Remote Protocol: HTTP&lt;br /&gt;
:Remote Method: Simple&lt;br /&gt;
:Remote Host Name: x.x.x.x (The IP of the camera)&lt;br /&gt;
:Remote Host Port: 80&lt;br /&gt;
:Remote Host Path: /videostream.cgi?user=admin&amp;amp;pwd= (assuming you have an admin user on the cam with no password)&lt;br /&gt;
:Remote Image Colours: 24 bit colour&lt;br /&gt;
:Capture Width: 320 (You could use 640 x 480, I found 320 to be better)&lt;br /&gt;
:Capture Height: 240&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Video Stream Url and Parameter&lt;br /&gt;
|-&lt;br /&gt;
|http://&amp;lt;IP-CAM&amp;gt;/||videostream.cgi?||user=A&amp;amp;||pwd=B&amp;amp;||resolution=C||&amp;amp;rate=D&lt;br /&gt;
|-&lt;br /&gt;
| || || User || Password || 8 =&amp;gt; 320x240|| 0 =&amp;gt; maxframe&lt;br /&gt;
|-&lt;br /&gt;
| || || || || 32 =&amp;gt; 640x480|| 1 =&amp;gt; 20 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 3 =&amp;gt; 15 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 6 =&amp;gt; 10 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 11 =&amp;gt; 5 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 12 =&amp;gt; 4 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 15 =&amp;gt; 3 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 14 =&amp;gt; 2 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 15 =&amp;gt; 1 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 17 =&amp;gt; 1 fps/2s&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 19 =&amp;gt; 1 fps/3s&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 21 =&amp;gt; 1 fps/4s&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 23 =&amp;gt; 1 fps/5s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:http://&amp;lt;ip-webcam&amp;gt;/videostream.cgi?user=admin&amp;amp;pwd=geheim&amp;amp;resolution=32&amp;amp;rate=6  &lt;br /&gt;
--[[User:Lowbayer|Lowbayer]] 08:05, 11 April 2011 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other settings are for personal preference only – so I haven’t listed them.&lt;br /&gt;
&lt;br /&gt;
I modified an existing camera control file to create this file which will allow you to pan and tilt the camera from the web interface (working in ZM V1.24.2)&lt;br /&gt;
&lt;br /&gt;
Save the following in the same location as the other .pm files. You can search for “PanasonicIP.pm” on your machine and see where that is. In my case it is:&lt;br /&gt;
&lt;br /&gt;
/usr/share/perl/5.10/ZoneMinder/Control&lt;br /&gt;
&lt;br /&gt;
From a terminal window run:&lt;br /&gt;
&lt;br /&gt;
 sudo gedit&lt;br /&gt;
&lt;br /&gt;
Which will open up your text editor in admin mode. Then paste the following between the +++ (excluding the +++) into the text editor:&lt;br /&gt;
&lt;br /&gt;
 +++&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 #&lt;br /&gt;
 # ZoneMinder Foscam FI8908W IP Control Protocol Module, $Date: 2009-11-25 09:20:00 +0000 (Wed, 04 Nov 2009) $, $Revision: 0001 $&lt;br /&gt;
 # Copyright (C) 2001-2008 Philip Coombes&lt;br /&gt;
 # Modified for use with Foscam FI8908W IP Camera by Dave Harris&lt;br /&gt;
 #&lt;br /&gt;
 # This program is free software; you can redistribute it and/or&lt;br /&gt;
 # modify it under the terms of the GNU General Public License&lt;br /&gt;
 # as published by the Free Software Foundation; either version 2&lt;br /&gt;
 # of the License, or (at your option) any later version.&lt;br /&gt;
 #&lt;br /&gt;
 # This program is distributed in the hope that it will be useful,&lt;br /&gt;
 # but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&lt;br /&gt;
 # GNU General Public License for more details.&lt;br /&gt;
 #&lt;br /&gt;
 # You should have received a copy of the GNU General Public License&lt;br /&gt;
 # along with this program; if not, write to the Free Software&lt;br /&gt;
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.&lt;br /&gt;
 #&lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 #&lt;br /&gt;
 # This module contains the implementation of the Foscam FI8908W IP camera control&lt;br /&gt;
 # protocol&lt;br /&gt;
 #&lt;br /&gt;
 package ZoneMinder::Control::FoscamFI8908W;&lt;br /&gt;
 &lt;br /&gt;
 use 5.006;&lt;br /&gt;
 use strict;&lt;br /&gt;
 use warnings;&lt;br /&gt;
 &lt;br /&gt;
 require ZoneMinder::Base;&lt;br /&gt;
 require ZoneMinder::Control;&lt;br /&gt;
 &lt;br /&gt;
 our @ISA = qw(ZoneMinder::Control);&lt;br /&gt;
 &lt;br /&gt;
 our $VERSION = $ZoneMinder::Base::VERSION;&lt;br /&gt;
 &lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 #&lt;br /&gt;
 # Foscam FI8908W IP Control Protocol&lt;br /&gt;
 #&lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 &lt;br /&gt;
 use ZoneMinder::Debug qw(:all);&lt;br /&gt;
 use ZoneMinder::Config qw(:all);&lt;br /&gt;
 &lt;br /&gt;
  use Time::HiRes qw( usleep );&lt;br /&gt;
 &lt;br /&gt;
 sub new&lt;br /&gt;
 { &lt;br /&gt;
 &lt;br /&gt;
 my $class = shift;&lt;br /&gt;
 my $id = shift;&lt;br /&gt;
 my $self = ZoneMinder::Control-&amp;gt;new( $id );&lt;br /&gt;
 my $logindetails = &amp;quot;&amp;quot;;&lt;br /&gt;
 bless( $self, $class );&lt;br /&gt;
 srand( time() );&lt;br /&gt;
 return $self;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 our $AUTOLOAD;&lt;br /&gt;
 &lt;br /&gt;
 sub AUTOLOAD&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 my $class = ref($self) || croak( &amp;quot;$self not object&amp;quot; );&lt;br /&gt;
 my $name = $AUTOLOAD;&lt;br /&gt;
 $name =~ s/.*://;&lt;br /&gt;
 if ( exists($self-&amp;gt;{$name}) )&lt;br /&gt;
 {&lt;br /&gt;
 return( $self-&amp;gt;{$name} );&lt;br /&gt;
 }&lt;br /&gt;
 Fatal( &amp;quot;Can&amp;#039;t access $name member of object of class $class&amp;quot; );&lt;br /&gt;
 }&lt;br /&gt;
 our $stop_command;&lt;br /&gt;
 &lt;br /&gt;
 sub open&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 &lt;br /&gt;
 $self-&amp;gt;loadMonitor();&lt;br /&gt;
 &lt;br /&gt;
 use LWP::UserAgent;&lt;br /&gt;
 $self-&amp;gt;{ua} = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
 $self-&amp;gt;{ua}-&amp;gt;agent( &amp;quot;ZoneMinder Control Agent/&amp;quot;.ZM_VERSION );&lt;br /&gt;
 &lt;br /&gt;
 $self-&amp;gt;{state} = &amp;#039;open&amp;#039;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub close&lt;br /&gt;
 { &lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $self-&amp;gt;{state} = &amp;#039;closed&amp;#039;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub printMsg&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 my $msg = shift;&lt;br /&gt;
 my $msg_len = length($msg);&lt;br /&gt;
 &lt;br /&gt;
 Debug( $msg.&amp;quot;[&amp;quot;.$msg_len.&amp;quot;]&amp;quot; );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub sendCmd&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 my $cmd = shift;&lt;br /&gt;
 my $result = undef;&lt;br /&gt;
 printMsg( $cmd, &amp;quot;Tx&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 my $req = HTTP::Request-&amp;gt;new( GET=&amp;gt;&amp;quot;http://&amp;quot;.$self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress}.&amp;quot;/$cmd&amp;quot; );&lt;br /&gt;
 my $res = $self-&amp;gt;{ua}-&amp;gt;request($req);&lt;br /&gt;
 &lt;br /&gt;
 if ( $res-&amp;gt;is_success )&lt;br /&gt;
 {&lt;br /&gt;
 $result = !undef;&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 Error( &amp;quot;Error check failed:&amp;#039;&amp;quot;.$res-&amp;gt;status_line().&amp;quot;&amp;#039;&amp;quot; );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 return( $result );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub reset&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 Debug( &amp;quot;Camera Reset&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;reboot.cgi?user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Up Arrow&lt;br /&gt;
 sub moveConUp&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Up&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=0&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Down Arrow&lt;br /&gt;
 sub moveConDown&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Down&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=2&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Left Arrow&lt;br /&gt;
 sub moveConLeft&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Left&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=4&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Right Arrow&lt;br /&gt;
 sub moveConRight&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Right&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=6&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Up Right Arrow&lt;br /&gt;
 sub moveConUpRight&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Up Right&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=91&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Down Right Arrow&lt;br /&gt;
 sub moveConDownRight&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Down Right&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=93&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Up Left Arrow&lt;br /&gt;
 sub moveConUpLeft&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Up Left&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=90&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Down Left Arrow&lt;br /&gt;
 sub moveConDownLeft&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Down Left&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=92&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Stop&lt;br /&gt;
 sub moveStop&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 Debug( &amp;quot;Move Stop&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?user=admin&amp;amp;pwd=&amp;amp;command=1&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Move Camera to Home Position&lt;br /&gt;
 sub presetHome&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 Debug( &amp;quot;Home Preset&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=25&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 1;&lt;br /&gt;
 &lt;br /&gt;
 +++&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Now save that as ‘FoscamFI8908W.pm’ in the same location where you found the PanasonicIP.pm file.&lt;br /&gt;
&lt;br /&gt;
(This file also assumes there is a user with the name admin and no password. If your setup is different, you will need to change this file). This is a first draft working version, I’ll tidy it up once ive learnt a bit more about perl &lt;br /&gt;
&lt;br /&gt;
Next you need to add the Control Type.&lt;br /&gt;
&lt;br /&gt;
Click on edit and add a new control with these details:&lt;br /&gt;
&lt;br /&gt;
Main:&lt;br /&gt;
Name: Foscam FI8908W&lt;br /&gt;
Type: Remote&lt;br /&gt;
Protocol: FoscamFI8908W (No space in there)&lt;br /&gt;
Move:&lt;br /&gt;
Can Move: Tick&lt;br /&gt;
Can Move Diagonally: Tick&lt;br /&gt;
Can Move Continuous: Tick&lt;br /&gt;
Pan:&lt;br /&gt;
Can Pan: Tick&lt;br /&gt;
Tilt:&lt;br /&gt;
Can Tilt: Tick&lt;br /&gt;
Presets:&lt;br /&gt;
Has Presets: Tick&lt;br /&gt;
Num Presets: 0&lt;br /&gt;
Has Home Presets: Tick&lt;br /&gt;
&lt;br /&gt;
Add the IP address of the camera to the &amp;#039;&amp;#039;&amp;#039;Control Address&amp;#039;&amp;#039;&amp;#039; field in the &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; tab of camera settings&lt;br /&gt;
&lt;br /&gt;
Save all that and you should be up and running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
;Here a list of more feature from decoder_control.cgi with the Firmware 11.14.2.28 (found: http://www.gadgetvictims.com/2010/10/fi8908w-old-and-new.html) --[[User:Lowbayer|Lowbayer]] 21:39, 12 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
Example: http://&amp;lt;IP_CAM&amp;gt;/decoder_control.cgi?command=30&amp;amp;user=&amp;lt;user&amp;gt;&amp;amp;pwd=&amp;lt;pass&amp;gt; = Set the preset 0&lt;br /&gt;
&lt;br /&gt;
Parameters value&lt;br /&gt;
&lt;br /&gt;
:0 up&lt;br /&gt;
:1 Stop up&lt;br /&gt;
:2 down&lt;br /&gt;
:3 Stop down&lt;br /&gt;
:4 left&lt;br /&gt;
:5 Stop left&lt;br /&gt;
:6 right&lt;br /&gt;
:7 Stop right&lt;br /&gt;
: ... Reserved&lt;br /&gt;
:25 center&lt;br /&gt;
:26 Vertical patrol&lt;br /&gt;
:27 Stop vertical patrol&lt;br /&gt;
:28 Horizon patrol&lt;br /&gt;
:29 Stop horizon patrol&lt;br /&gt;
:30  Set preset 0&lt;br /&gt;
:31  Go preset 0&lt;br /&gt;
:32  Set preset 1&lt;br /&gt;
:33  Go preset 1&lt;br /&gt;
:34  Set preset 2&lt;br /&gt;
:35  Go preset 2&lt;br /&gt;
:  ....&lt;br /&gt;
:62  Set preset 16&lt;br /&gt;
:63  Go preset 16&lt;br /&gt;
:And the list goes further until preset 16&lt;br /&gt;
:94 IO output high&lt;br /&gt;
:95 IO output low &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
A few more notes that I found useful:&lt;br /&gt;
&lt;br /&gt;
Turning off the annoying green LED: (where x.x.x.x is the IP of your camera)&lt;br /&gt;
&lt;br /&gt;
http://x.x.x.x/set_misc.cgi?led_mode=2&amp;amp;user=admin&amp;amp;pwd=&lt;br /&gt;
&lt;br /&gt;
:led_mode=0 - the green led blinks only once connected.&lt;br /&gt;
:led_mode=1 - the green led blinks while searching for a connection and when connected.&lt;br /&gt;
:led_mode=2 - the green led is always off.&lt;br /&gt;
&lt;br /&gt;
Stop the camera moving around when you reboot it:&lt;br /&gt;
&lt;br /&gt;
http://x.x.x.x/set_misc.cgi?ptz_center_onstart=0&amp;amp;user=admin&amp;amp;pwd=&lt;br /&gt;
&lt;br /&gt;
I initially had some issues with no images displaying in ZM. I found this to be a shared memory issue, see here:&lt;br /&gt;
&lt;br /&gt;
http://www.zoneminder.com/wiki/index.php -&amp;gt;  FAQ#What_does_a_.27Can.27t_shmget:_Invalid_argument.27_error_in_my_logs_mean.3F_and_my_cameras_won.27t_display_video_at_higher_resolutions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Here a list of interesting feature: --[[User:Lowbayer|Lowbayer]] 21:39, 12 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
http://[ipcam]/get_misc.cgi -&amp;gt;Returns all the current values for the functions above.&lt;br /&gt;
&lt;br /&gt;
http://[ipcam]/get_log.cgi -&amp;gt; Displays the visits log&lt;br /&gt;
&lt;br /&gt;
http://[ipcam]/get_params.cgi -&amp;gt;Returns the complete configuration of the camera.&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/fileview?id=0B-yhhBvC0DSlNWExZDU0NTQtMDlmZi00YzkzLWFkNDAtMGU4MTA1MDg2YjMz&amp;amp;hl=en&lt;br /&gt;
&lt;br /&gt;
The feature list from the IPCAM CGI SDK V1.7&lt;br /&gt;
&lt;br /&gt;
http://www.notesco.net/download/ipcamcgisdk21.pdf&lt;br /&gt;
&lt;br /&gt;
The feature list from the IPCAM CGI SDK V2.1&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I found this guide useful for getting ZM 1.24.2 installed in the first place on my ubuntu box:&lt;br /&gt;
&lt;br /&gt;
http://www.howtoforge.com/video_surveillance_zoneminder_ubuntu&lt;br /&gt;
&lt;br /&gt;
I replaced:&lt;br /&gt;
&lt;br /&gt;
ftp://www.northern-ridge.com.au/zoneminder/ubuntu/dapper/zoneminder_1.22.3-8_i386.deb&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
ftp://www.northern-ridge.com.au/zoneminder/1.24/ubuntu/jaunty/zoneminder_1.24.2-1_i386.deb&lt;br /&gt;
&lt;br /&gt;
I have also heard of people replacing the existing lens in the Foscam Camera (it simply unscrews) with a 160° Wide Angle lens to give a better view. (Search eBay for ‘2.1mm CCTV Lens’). I haven’t tried this myself yet, but will at some point in the future.&lt;br /&gt;
&lt;br /&gt;
On more thing to add. Since upgrading to 1.24.2 (I was originally on 1.23) I have had a few issues with apache locking up. I followed the recommended fix in this thread:&lt;br /&gt;
&lt;br /&gt;
http://www.zoneminder.com/forums/viewtopic.php?p=51045&lt;br /&gt;
&lt;br /&gt;
Which has helped a little but I’m still having a few issues. I have to run this command:&lt;br /&gt;
&lt;br /&gt;
sudo apache2ctl restart&lt;br /&gt;
&lt;br /&gt;
every now and then on the box (which I VNC into from my windows box) to restart apache.&lt;br /&gt;
&lt;br /&gt;
Hope this is useful to some people.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
&lt;br /&gt;
DAVE.&lt;br /&gt;
&lt;br /&gt;
PS - As I&amp;#039;m not always on the forum, I tend to update my blog first (and the forum later - sorry!), it&amp;#039;s here: http://dave.harris.net/foscam-fi8908w-ip-camera-with-pt-no-z-working-in-zoneminder/ :)&lt;br /&gt;
&lt;br /&gt;
;Wireless Setup&lt;br /&gt;
How to setup IP camera wirelessly&lt;br /&gt;
http://foscam.us/forum/post15934.html#p15934&lt;br /&gt;
&lt;br /&gt;
;Test and Tweak IP Camera Setup and Configuration&lt;br /&gt;
Make sure your IP Camera is functioning at peak ability&lt;br /&gt;
http://foscam.us/forum/post34164.html#p34164&lt;br /&gt;
&lt;br /&gt;
;Links;&lt;br /&gt;
* http://www.foscam.com&lt;br /&gt;
* [http://foscam.us/forum/free-generic-browser-interface-for-foscam-ip-mjpeg-cameras-t2522.html#p10970 MJPEG Based Foscam Camera Generic Browser Based Interface Example]&lt;br /&gt;
* [http://foscam.us/forum/free-generic-browser-interface-for-foscam-fi9821w-cameras-t4341.html#p20338 H.264 Based Foscam Camera Generic Browser Based Interface Example]&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Foscam&amp;diff=14143</id>
		<title>Foscam</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Foscam&amp;diff=14143"/>
		<updated>2016-09-16T11:29:42Z</updated>

		<summary type="html">&lt;p&gt;Asker: /* Model specific wikis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Model specific wikis==&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9831W|Foscam FI9831W Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI8918W|Foscam FI8918W Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI8910W|Foscam FI8910W Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8904W|Foscam FI8904W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8905W|Foscam FI8905W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8602W|Foscam FI8602W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9801/2W|Foscam FI9801/2W Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9805W|Foscam FI9805W Megapixel Outdoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9851P|Foscam FI9851P H.264 HD Wireless Indoor IP camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam_FI9803EP|Foscam FI9803EP POE Outdoor IP Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI9903P |Foscam FI9903P Outdoor IP Camara]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI8921P|Foscam FI8921P Pan/Tilt Camera]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam FI9821W V2|Foscam FI9821W v2 Pan/Tilt Camera]]&lt;br /&gt;
[[Foscam C1]]&lt;br /&gt;
&lt;br /&gt;
[[Foscam Clones]]&lt;br /&gt;
&lt;br /&gt;
[[Wanscam|Wanscam FR4020A2 (Foscam clone)]]&lt;br /&gt;
&lt;br /&gt;
==General Foscam directions==&lt;br /&gt;
&lt;br /&gt;
(This was very helpful for me, but instead of &amp;#039;videostream&amp;#039; below I believe &lt;br /&gt;
it should be &amp;#039;snapshot&amp;#039;.  Using videostream my wifi, using iptraf to monitor&lt;br /&gt;
it, was fluctuating wildly from zero to 5 mbps and lots of events were missed.&lt;br /&gt;
Now that I&amp;#039;m using the snapshot cgi (/snapshot.cgi?user=mine&amp;amp;pwd=mine) &lt;br /&gt;
iptraf shows a steady stream that behaves as expected, jumps up when alarmed,&lt;br /&gt;
am getting the performance from zoneminder other are, where using the&lt;br /&gt;
videostream as below got nothing but furstration...   Best to y&amp;#039;all, gsx)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Foscam FI8908W IP Camera with PT (no Z) Working in ZM 1.24.2&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Firmware 11_14_2_28 with presets working. --[[User:Lowbayer|Lowbayer]] 21:39, 12 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
(This also works with the Foscam FI8918W camera.  No sound though.)&lt;br /&gt;
&lt;br /&gt;
See here for detail on [[Foscam_FI8918W]] with presets working. [[User:Hdurdle|Hdurdle]] 23:18, 26 February 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Just thought this might be useful for anybody using the Foscam IP FI8908W Cameras.&lt;br /&gt;
&lt;br /&gt;
They can be bought on eBay for around £50 and for that money they are a great buy. (Beware of fakes, see here: http://www.gadgetvictims.com/2009/09/yet-another-firmware-for-foscam-fi8908w.html)&lt;br /&gt;
&lt;br /&gt;
A firmware upgrade can be performed to allow Server Push Mode, for FireFox etc.&lt;br /&gt;
&lt;br /&gt;
See here for a instructions and a link to the firmware file:&lt;br /&gt;
http://www.gadgetvictims.com/2009/07/foscam-ip-camera-part-two.html&lt;br /&gt;
&lt;br /&gt;
I recommend firmware V11.14.1.42 and Web UI V2.4.8.11&lt;br /&gt;
&lt;br /&gt;
Once that is done you can proceed to add the camera into ZoneMinder with the following settings:&lt;br /&gt;
&lt;br /&gt;
;General:&lt;br /&gt;
:Name: x&lt;br /&gt;
:Source Type: Remote&lt;br /&gt;
:Function: Modect (up to you though)&lt;br /&gt;
:Enabled: Tick&lt;br /&gt;
:Maximum FPS: Empty (I had some issues with it lagging when I used values here)&lt;br /&gt;
:Alarm Maximum FPS: Empty&lt;br /&gt;
;Source&lt;br /&gt;
:Remote Protocol: HTTP&lt;br /&gt;
:Remote Method: Simple&lt;br /&gt;
:Remote Host Name: x.x.x.x (The IP of the camera)&lt;br /&gt;
:Remote Host Port: 80&lt;br /&gt;
:Remote Host Path: /videostream.cgi?user=admin&amp;amp;pwd= (assuming you have an admin user on the cam with no password)&lt;br /&gt;
:Remote Image Colours: 24 bit colour&lt;br /&gt;
:Capture Width: 320 (You could use 640 x 480, I found 320 to be better)&lt;br /&gt;
:Capture Height: 240&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|Video Stream Url and Parameter&lt;br /&gt;
|-&lt;br /&gt;
|http://&amp;lt;IP-CAM&amp;gt;/||videostream.cgi?||user=A&amp;amp;||pwd=B&amp;amp;||resolution=C||&amp;amp;rate=D&lt;br /&gt;
|-&lt;br /&gt;
| || || User || Password || 8 =&amp;gt; 320x240|| 0 =&amp;gt; maxframe&lt;br /&gt;
|-&lt;br /&gt;
| || || || || 32 =&amp;gt; 640x480|| 1 =&amp;gt; 20 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 3 =&amp;gt; 15 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 6 =&amp;gt; 10 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 11 =&amp;gt; 5 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 12 =&amp;gt; 4 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 15 =&amp;gt; 3 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 14 =&amp;gt; 2 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 15 =&amp;gt; 1 fps&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 17 =&amp;gt; 1 fps/2s&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 19 =&amp;gt; 1 fps/3s&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 21 =&amp;gt; 1 fps/4s&lt;br /&gt;
|-&lt;br /&gt;
| || || || || || 23 =&amp;gt; 1 fps/5s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;Example&lt;br /&gt;
:http://&amp;lt;ip-webcam&amp;gt;/videostream.cgi?user=admin&amp;amp;pwd=geheim&amp;amp;resolution=32&amp;amp;rate=6  &lt;br /&gt;
--[[User:Lowbayer|Lowbayer]] 08:05, 11 April 2011 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The other settings are for personal preference only – so I haven’t listed them.&lt;br /&gt;
&lt;br /&gt;
I modified an existing camera control file to create this file which will allow you to pan and tilt the camera from the web interface (working in ZM V1.24.2)&lt;br /&gt;
&lt;br /&gt;
Save the following in the same location as the other .pm files. You can search for “PanasonicIP.pm” on your machine and see where that is. In my case it is:&lt;br /&gt;
&lt;br /&gt;
/usr/share/perl/5.10/ZoneMinder/Control&lt;br /&gt;
&lt;br /&gt;
From a terminal window run:&lt;br /&gt;
&lt;br /&gt;
 sudo gedit&lt;br /&gt;
&lt;br /&gt;
Which will open up your text editor in admin mode. Then paste the following between the +++ (excluding the +++) into the text editor:&lt;br /&gt;
&lt;br /&gt;
 +++&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 #&lt;br /&gt;
 # ZoneMinder Foscam FI8908W IP Control Protocol Module, $Date: 2009-11-25 09:20:00 +0000 (Wed, 04 Nov 2009) $, $Revision: 0001 $&lt;br /&gt;
 # Copyright (C) 2001-2008 Philip Coombes&lt;br /&gt;
 # Modified for use with Foscam FI8908W IP Camera by Dave Harris&lt;br /&gt;
 #&lt;br /&gt;
 # This program is free software; you can redistribute it and/or&lt;br /&gt;
 # modify it under the terms of the GNU General Public License&lt;br /&gt;
 # as published by the Free Software Foundation; either version 2&lt;br /&gt;
 # of the License, or (at your option) any later version.&lt;br /&gt;
 #&lt;br /&gt;
 # This program is distributed in the hope that it will be useful,&lt;br /&gt;
 # but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&lt;br /&gt;
 # GNU General Public License for more details.&lt;br /&gt;
 #&lt;br /&gt;
 # You should have received a copy of the GNU General Public License&lt;br /&gt;
 # along with this program; if not, write to the Free Software&lt;br /&gt;
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.&lt;br /&gt;
 #&lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 #&lt;br /&gt;
 # This module contains the implementation of the Foscam FI8908W IP camera control&lt;br /&gt;
 # protocol&lt;br /&gt;
 #&lt;br /&gt;
 package ZoneMinder::Control::FoscamFI8908W;&lt;br /&gt;
 &lt;br /&gt;
 use 5.006;&lt;br /&gt;
 use strict;&lt;br /&gt;
 use warnings;&lt;br /&gt;
 &lt;br /&gt;
 require ZoneMinder::Base;&lt;br /&gt;
 require ZoneMinder::Control;&lt;br /&gt;
 &lt;br /&gt;
 our @ISA = qw(ZoneMinder::Control);&lt;br /&gt;
 &lt;br /&gt;
 our $VERSION = $ZoneMinder::Base::VERSION;&lt;br /&gt;
 &lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 #&lt;br /&gt;
 # Foscam FI8908W IP Control Protocol&lt;br /&gt;
 #&lt;br /&gt;
 # ==========================================================================&lt;br /&gt;
 &lt;br /&gt;
 use ZoneMinder::Debug qw(:all);&lt;br /&gt;
 use ZoneMinder::Config qw(:all);&lt;br /&gt;
 &lt;br /&gt;
  use Time::HiRes qw( usleep );&lt;br /&gt;
 &lt;br /&gt;
 sub new&lt;br /&gt;
 { &lt;br /&gt;
 &lt;br /&gt;
 my $class = shift;&lt;br /&gt;
 my $id = shift;&lt;br /&gt;
 my $self = ZoneMinder::Control-&amp;gt;new( $id );&lt;br /&gt;
 my $logindetails = &amp;quot;&amp;quot;;&lt;br /&gt;
 bless( $self, $class );&lt;br /&gt;
 srand( time() );&lt;br /&gt;
 return $self;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 our $AUTOLOAD;&lt;br /&gt;
 &lt;br /&gt;
 sub AUTOLOAD&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 my $class = ref($self) || croak( &amp;quot;$self not object&amp;quot; );&lt;br /&gt;
 my $name = $AUTOLOAD;&lt;br /&gt;
 $name =~ s/.*://;&lt;br /&gt;
 if ( exists($self-&amp;gt;{$name}) )&lt;br /&gt;
 {&lt;br /&gt;
 return( $self-&amp;gt;{$name} );&lt;br /&gt;
 }&lt;br /&gt;
 Fatal( &amp;quot;Can&amp;#039;t access $name member of object of class $class&amp;quot; );&lt;br /&gt;
 }&lt;br /&gt;
 our $stop_command;&lt;br /&gt;
 &lt;br /&gt;
 sub open&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 &lt;br /&gt;
 $self-&amp;gt;loadMonitor();&lt;br /&gt;
 &lt;br /&gt;
 use LWP::UserAgent;&lt;br /&gt;
 $self-&amp;gt;{ua} = LWP::UserAgent-&amp;gt;new;&lt;br /&gt;
 $self-&amp;gt;{ua}-&amp;gt;agent( &amp;quot;ZoneMinder Control Agent/&amp;quot;.ZM_VERSION );&lt;br /&gt;
 &lt;br /&gt;
 $self-&amp;gt;{state} = &amp;#039;open&amp;#039;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub close&lt;br /&gt;
 { &lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $self-&amp;gt;{state} = &amp;#039;closed&amp;#039;;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub printMsg&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 my $msg = shift;&lt;br /&gt;
 my $msg_len = length($msg);&lt;br /&gt;
 &lt;br /&gt;
 Debug( $msg.&amp;quot;[&amp;quot;.$msg_len.&amp;quot;]&amp;quot; );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub sendCmd&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 my $cmd = shift;&lt;br /&gt;
 my $result = undef;&lt;br /&gt;
 printMsg( $cmd, &amp;quot;Tx&amp;quot; );&lt;br /&gt;
 &lt;br /&gt;
 my $req = HTTP::Request-&amp;gt;new( GET=&amp;gt;&amp;quot;http://&amp;quot;.$self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress}.&amp;quot;/$cmd&amp;quot; );&lt;br /&gt;
 my $res = $self-&amp;gt;{ua}-&amp;gt;request($req);&lt;br /&gt;
 &lt;br /&gt;
 if ( $res-&amp;gt;is_success )&lt;br /&gt;
 {&lt;br /&gt;
 $result = !undef;&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 Error( &amp;quot;Error check failed:&amp;#039;&amp;quot;.$res-&amp;gt;status_line().&amp;quot;&amp;#039;&amp;quot; );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 return( $result );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 sub reset&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 Debug( &amp;quot;Camera Reset&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;reboot.cgi?user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Up Arrow&lt;br /&gt;
 sub moveConUp&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Up&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=0&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Down Arrow&lt;br /&gt;
 sub moveConDown&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Down&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=2&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Left Arrow&lt;br /&gt;
 sub moveConLeft&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Left&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=4&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Right Arrow&lt;br /&gt;
 sub moveConRight&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Right&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=6&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Up Right Arrow&lt;br /&gt;
 sub moveConUpRight&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Up Right&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=91&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Down Right Arrow&lt;br /&gt;
 sub moveConDownRight&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Down Right&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=93&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Up Left Arrow&lt;br /&gt;
 sub moveConUpLeft&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Up Left&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=90&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Diagonally Down Left Arrow&lt;br /&gt;
 sub moveConDownLeft&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
 Debug( &amp;quot;Move Diagonally Down Left&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=92&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Stop&lt;br /&gt;
 sub moveStop&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 Debug( &amp;quot;Move Stop&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?user=admin&amp;amp;pwd=&amp;amp;command=1&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 #Move Camera to Home Position&lt;br /&gt;
 sub presetHome&lt;br /&gt;
 {&lt;br /&gt;
 my $self = shift;&lt;br /&gt;
 Debug( &amp;quot;Home Preset&amp;quot; );&lt;br /&gt;
 my $cmd = &amp;quot;decoder_control.cgi?command=25&amp;amp;user=admin&amp;amp;pwd=&amp;quot;;&lt;br /&gt;
 $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 1;&lt;br /&gt;
 &lt;br /&gt;
 +++&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Now save that as ‘FoscamFI8908W.pm’ in the same location where you found the PanasonicIP.pm file.&lt;br /&gt;
&lt;br /&gt;
(This file also assumes there is a user with the name admin and no password. If your setup is different, you will need to change this file). This is a first draft working version, I’ll tidy it up once ive learnt a bit more about perl &lt;br /&gt;
&lt;br /&gt;
Next you need to add the Control Type.&lt;br /&gt;
&lt;br /&gt;
Click on edit and add a new control with these details:&lt;br /&gt;
&lt;br /&gt;
Main:&lt;br /&gt;
Name: Foscam FI8908W&lt;br /&gt;
Type: Remote&lt;br /&gt;
Protocol: FoscamFI8908W (No space in there)&lt;br /&gt;
Move:&lt;br /&gt;
Can Move: Tick&lt;br /&gt;
Can Move Diagonally: Tick&lt;br /&gt;
Can Move Continuous: Tick&lt;br /&gt;
Pan:&lt;br /&gt;
Can Pan: Tick&lt;br /&gt;
Tilt:&lt;br /&gt;
Can Tilt: Tick&lt;br /&gt;
Presets:&lt;br /&gt;
Has Presets: Tick&lt;br /&gt;
Num Presets: 0&lt;br /&gt;
Has Home Presets: Tick&lt;br /&gt;
&lt;br /&gt;
Add the IP address of the camera to the &amp;#039;&amp;#039;&amp;#039;Control Address&amp;#039;&amp;#039;&amp;#039; field in the &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; tab of camera settings&lt;br /&gt;
&lt;br /&gt;
Save all that and you should be up and running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
;Here a list of more feature from decoder_control.cgi with the Firmware 11.14.2.28 (found: http://www.gadgetvictims.com/2010/10/fi8908w-old-and-new.html) --[[User:Lowbayer|Lowbayer]] 21:39, 12 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
Example: http://&amp;lt;IP_CAM&amp;gt;/decoder_control.cgi?command=30&amp;amp;user=&amp;lt;user&amp;gt;&amp;amp;pwd=&amp;lt;pass&amp;gt; = Set the preset 0&lt;br /&gt;
&lt;br /&gt;
Parameters value&lt;br /&gt;
&lt;br /&gt;
:0 up&lt;br /&gt;
:1 Stop up&lt;br /&gt;
:2 down&lt;br /&gt;
:3 Stop down&lt;br /&gt;
:4 left&lt;br /&gt;
:5 Stop left&lt;br /&gt;
:6 right&lt;br /&gt;
:7 Stop right&lt;br /&gt;
: ... Reserved&lt;br /&gt;
:25 center&lt;br /&gt;
:26 Vertical patrol&lt;br /&gt;
:27 Stop vertical patrol&lt;br /&gt;
:28 Horizon patrol&lt;br /&gt;
:29 Stop horizon patrol&lt;br /&gt;
:30  Set preset 0&lt;br /&gt;
:31  Go preset 0&lt;br /&gt;
:32  Set preset 1&lt;br /&gt;
:33  Go preset 1&lt;br /&gt;
:34  Set preset 2&lt;br /&gt;
:35  Go preset 2&lt;br /&gt;
:  ....&lt;br /&gt;
:62  Set preset 16&lt;br /&gt;
:63  Go preset 16&lt;br /&gt;
:And the list goes further until preset 16&lt;br /&gt;
:94 IO output high&lt;br /&gt;
:95 IO output low &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
A few more notes that I found useful:&lt;br /&gt;
&lt;br /&gt;
Turning off the annoying green LED: (where x.x.x.x is the IP of your camera)&lt;br /&gt;
&lt;br /&gt;
http://x.x.x.x/set_misc.cgi?led_mode=2&amp;amp;user=admin&amp;amp;pwd=&lt;br /&gt;
&lt;br /&gt;
:led_mode=0 - the green led blinks only once connected.&lt;br /&gt;
:led_mode=1 - the green led blinks while searching for a connection and when connected.&lt;br /&gt;
:led_mode=2 - the green led is always off.&lt;br /&gt;
&lt;br /&gt;
Stop the camera moving around when you reboot it:&lt;br /&gt;
&lt;br /&gt;
http://x.x.x.x/set_misc.cgi?ptz_center_onstart=0&amp;amp;user=admin&amp;amp;pwd=&lt;br /&gt;
&lt;br /&gt;
I initially had some issues with no images displaying in ZM. I found this to be a shared memory issue, see here:&lt;br /&gt;
&lt;br /&gt;
http://www.zoneminder.com/wiki/index.php -&amp;gt;  FAQ#What_does_a_.27Can.27t_shmget:_Invalid_argument.27_error_in_my_logs_mean.3F_and_my_cameras_won.27t_display_video_at_higher_resolutions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Here a list of interesting feature: --[[User:Lowbayer|Lowbayer]] 21:39, 12 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
http://[ipcam]/get_misc.cgi -&amp;gt;Returns all the current values for the functions above.&lt;br /&gt;
&lt;br /&gt;
http://[ipcam]/get_log.cgi -&amp;gt; Displays the visits log&lt;br /&gt;
&lt;br /&gt;
http://[ipcam]/get_params.cgi -&amp;gt;Returns the complete configuration of the camera.&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/fileview?id=0B-yhhBvC0DSlNWExZDU0NTQtMDlmZi00YzkzLWFkNDAtMGU4MTA1MDg2YjMz&amp;amp;hl=en&lt;br /&gt;
&lt;br /&gt;
The feature list from the IPCAM CGI SDK V1.7&lt;br /&gt;
&lt;br /&gt;
http://www.notesco.net/download/ipcamcgisdk21.pdf&lt;br /&gt;
&lt;br /&gt;
The feature list from the IPCAM CGI SDK V2.1&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I found this guide useful for getting ZM 1.24.2 installed in the first place on my ubuntu box:&lt;br /&gt;
&lt;br /&gt;
http://www.howtoforge.com/video_surveillance_zoneminder_ubuntu&lt;br /&gt;
&lt;br /&gt;
I replaced:&lt;br /&gt;
&lt;br /&gt;
ftp://www.northern-ridge.com.au/zoneminder/ubuntu/dapper/zoneminder_1.22.3-8_i386.deb&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
ftp://www.northern-ridge.com.au/zoneminder/1.24/ubuntu/jaunty/zoneminder_1.24.2-1_i386.deb&lt;br /&gt;
&lt;br /&gt;
I have also heard of people replacing the existing lens in the Foscam Camera (it simply unscrews) with a 160° Wide Angle lens to give a better view. (Search eBay for ‘2.1mm CCTV Lens’). I haven’t tried this myself yet, but will at some point in the future.&lt;br /&gt;
&lt;br /&gt;
On more thing to add. Since upgrading to 1.24.2 (I was originally on 1.23) I have had a few issues with apache locking up. I followed the recommended fix in this thread:&lt;br /&gt;
&lt;br /&gt;
http://www.zoneminder.com/forums/viewtopic.php?p=51045&lt;br /&gt;
&lt;br /&gt;
Which has helped a little but I’m still having a few issues. I have to run this command:&lt;br /&gt;
&lt;br /&gt;
sudo apache2ctl restart&lt;br /&gt;
&lt;br /&gt;
every now and then on the box (which I VNC into from my windows box) to restart apache.&lt;br /&gt;
&lt;br /&gt;
Hope this is useful to some people.&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
&lt;br /&gt;
DAVE.&lt;br /&gt;
&lt;br /&gt;
PS - As I&amp;#039;m not always on the forum, I tend to update my blog first (and the forum later - sorry!), it&amp;#039;s here: http://dave.harris.net/foscam-fi8908w-ip-camera-with-pt-no-z-working-in-zoneminder/ :)&lt;br /&gt;
&lt;br /&gt;
;Wireless Setup&lt;br /&gt;
How to setup IP camera wirelessly&lt;br /&gt;
http://foscam.us/forum/post15934.html#p15934&lt;br /&gt;
&lt;br /&gt;
;Test and Tweak IP Camera Setup and Configuration&lt;br /&gt;
Make sure your IP Camera is functioning at peak ability&lt;br /&gt;
http://foscam.us/forum/post34164.html#p34164&lt;br /&gt;
&lt;br /&gt;
;Links;&lt;br /&gt;
* http://www.foscam.com&lt;br /&gt;
* [http://foscam.us/forum/free-generic-browser-interface-for-foscam-ip-mjpeg-cameras-t2522.html#p10970 MJPEG Based Foscam Camera Generic Browser Based Interface Example]&lt;br /&gt;
* [http://foscam.us/forum/free-generic-browser-interface-for-foscam-fi9821w-cameras-t4341.html#p20338 H.264 Based Foscam Camera Generic Browser Based Interface Example]&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=ZM2_Architecture_Discussion&amp;diff=14077</id>
		<title>ZM2 Architecture Discussion</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=ZM2_Architecture_Discussion&amp;diff=14077"/>
		<updated>2016-07-17T20:36:48Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Update: See http://ozone.network for more recent updates ===&lt;br /&gt;
&lt;br /&gt;
This page is an initial discussion of the proposed new architecture for ZoneMinder version 2 (ZM2).&lt;br /&gt;
&lt;br /&gt;
The ZM2 architecture will not be purely targetted at providing specific ZM binaries but will form the basis of a framework allowing other more specialised applications to be created.&lt;br /&gt;
&lt;br /&gt;
The key components of the ZoneMinder Framework (ZMFW) can be summarised as follows&lt;br /&gt;
&lt;br /&gt;
; Frame : A frame is a piece of information that can be passed around the framework. This may represent video, audio or any other type of information. At it&amp;#039;s simplest it contains nothing other than an id, a timestamp and a block of data. Specific frame types can include additional information, e.g. a video frame would include dimensions and a video format, an audio frame would include a duration, format and possibly sample rate etc.&lt;br /&gt;
; Provider : A provider is simply an entity that can &amp;#039;provide&amp;#039; other system components with frames. Examples might be analog camera video providers, or GPIO port status providers.&lt;br /&gt;
; Consumer : A consumer is an entity that expects to receive frames from a provider. A local file consumer might receive video frames from a video provider and write them to local file storage.&lt;br /&gt;
&lt;br /&gt;
Some key points about providers and consumers.&lt;br /&gt;
&lt;br /&gt;
# In order to receive frames consumers register with a provider (or a provider can register with a consumer).&lt;br /&gt;
# Once a consumer has registered the provider will distribute frames to a consumer. In the general case this is unconditional but it can be made conditional on certain conditions.&lt;br /&gt;
# A consumer has a frame queue allowing a number of frames to be lined up for processing.&lt;br /&gt;
# A provider can distribute frames to many consumers.&lt;br /&gt;
# A consumer can receive frames from many providers, though the normal case would tend towards only one.&lt;br /&gt;
# A frame contains a reference to the provider from which it originated.&lt;br /&gt;
# Providers and consumers are generally represented by threads and so run autonomously.&lt;br /&gt;
# The ZMFW defines only a very limited interface and set of functionality. Specific providers and consumers need to extend this to suit their own specific needs.&lt;br /&gt;
# Combined providers and consumers are supported. So an ZMFW object can both consume frames from one provider and thence distribute them to other consumers. This allows sequences of providers and consumers to form chains or even more complex structures such as mesh types. Owing to the conditional aspects of providing and consuming frames may take a variety of paths between entities.&lt;br /&gt;
# As frames are passed around, they retain a history of their passage and record which providers they have traversed. Consumers may alter the data contained within a frame, but if they do so, the frame accepts new data but also maintains the original form. This allows consumers to examine or process both unaltered and processed data if both are available.&lt;br /&gt;
&lt;br /&gt;
These simple rules allow some quite complex architectures to be created. For example the zmc process in the current architecture could be represented by the following ZMFW structure&lt;br /&gt;
&lt;br /&gt;
  LocalCameraInput(P) -&amp;gt; MappedMemoryOutput(C)&lt;br /&gt;
&lt;br /&gt;
where (P) represents a provider and (C) is a consumer. Obviously, the LocalCameraInput could alternately be a RemoteCameraInput etc. Likewise the current zma would end up being something like,&lt;br /&gt;
&lt;br /&gt;
  MappedMemoryInput(P) -&amp;gt; SignalChecker(PC) -&amp;gt; MotionDetector(PC) -&amp;gt; EventHandler(C)&lt;br /&gt;
&lt;br /&gt;
and the streams would be&lt;br /&gt;
&lt;br /&gt;
  MappedMemoryInput(P) -&amp;gt; H264Streaming(C)&lt;br /&gt;
&lt;br /&gt;
and so. In fact all those elements could now be in a single monolithic process if required, or a simple relay process could be formed of a capture input and a streaming output and so on.&lt;br /&gt;
&lt;br /&gt;
The intention of the ZMFW is twofold. The first, and principal, reasons is to allow ZM components to be constructed in a more modular fashion, which also would allow additional entities to be added in from thrid parties using a defined API. So specialised I/O components can be built in, or ANPR type functionality without massively affecting the rest of the system. The second reason is to allow new components and even newapplications to arise from the framework to perform specific, perhaps currently unthought of, tasks outside the scope of the existing system.&lt;br /&gt;
&lt;br /&gt;
This is just an initial brain dump. I will shortly be opening up a new forum for interested parties where anyone will be invited to contribute to discussions about the ZMFW and make suggestions and ultimately contribute to the generation of code.&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Various_ZM_thoughts&amp;diff=14076</id>
		<title>Various ZM thoughts</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Various_ZM_thoughts&amp;diff=14076"/>
		<updated>2016-07-16T15:27:42Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most of these were written when I first discovered ZoneMinder in 2015. ZM 1.28 was the stable release then. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;[[Contents]]&lt;br /&gt;
&lt;br /&gt;
==Topics==&lt;br /&gt;
&lt;br /&gt;
[[Understanding ZoneMinder&amp;#039;s Zoning system for Dummies]] (Illustrated)&lt;br /&gt;
&lt;br /&gt;
[[Ubuntu Server or Ubuntu Desktop?]]&lt;br /&gt;
&lt;br /&gt;
[[How to get ssmtp working with Zoneminder]]&lt;br /&gt;
&lt;br /&gt;
[[Doing your best to get rid of smudging in FFMPEG transcoding of RTSP streams]]&lt;br /&gt;
&lt;br /&gt;
[[How to use your external camera&amp;#039;s motion detection with ZM]] (and a basic explanation of ZM&amp;#039;s trigger architecture)&lt;br /&gt;
&lt;br /&gt;
[[Math for Memory - knowing how much memory you need and how to optimize]]&lt;br /&gt;
&lt;br /&gt;
[[Estimating how much HDD space you need for recording]]&lt;br /&gt;
&lt;br /&gt;
[[How to control your Foscam HD cameras - PTZ]] &lt;br /&gt;
&lt;br /&gt;
[[Using your iPhone&amp;#039;s location to start ZM recording]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;[[Modifying ZoneMinder to remember run state names]] (and why that is very useful)&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[How to use ZoneMinder with cameras it may not directly support]] (but you have some way to extract images from it)&lt;br /&gt;
&lt;br /&gt;
[[Mobile companion apps]]&lt;br /&gt;
&lt;br /&gt;
[[Exporting images to Video]]&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Various_ZM_thoughts&amp;diff=14075</id>
		<title>Various ZM thoughts</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Various_ZM_thoughts&amp;diff=14075"/>
		<updated>2016-07-15T00:04:14Z</updated>

		<summary type="html">&lt;p&gt;Asker: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contain&amp;#039;s various learnings related to ZoneMinder. I&amp;#039;ll be adding many sub pages for various tips and tricks. Hope toy find it useful. You can contact me by searching for user &amp;#039;asker&amp;#039; on the ZoneMinder forums. I don&amp;#039;t claim to be a ZM expert, so feel free to correct my observations. A lot of these tips come from other Zoneminder forum members. I&amp;#039;ll attribute credits where I remember.&lt;br /&gt;
&lt;br /&gt;
Note that I am not putting this under the &amp;quot;distribution specific guides&amp;quot; as a lot of what I will document don&amp;#039;t only map to Ubuntu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;[[Contents]]&lt;br /&gt;
&lt;br /&gt;
==Topics==&lt;br /&gt;
&lt;br /&gt;
[[Understanding ZoneMinder&amp;#039;s Zoning system for Dummies]] (Illustrated)&lt;br /&gt;
&lt;br /&gt;
[[Ubuntu Server or Ubuntu Desktop?]]&lt;br /&gt;
&lt;br /&gt;
[[How to get ssmtp working with Zoneminder]]&lt;br /&gt;
&lt;br /&gt;
[[Doing your best to get rid of smudging in FFMPEG transcoding of RTSP streams]]&lt;br /&gt;
&lt;br /&gt;
[[How to use your external camera&amp;#039;s motion detection with ZM]] (and a basic explanation of ZM&amp;#039;s trigger architecture)&lt;br /&gt;
&lt;br /&gt;
[[Math for Memory - knowing how much memory you need and how to optimize]]&lt;br /&gt;
&lt;br /&gt;
[[Estimating how much HDD space you need for recording]]&lt;br /&gt;
&lt;br /&gt;
[[How to control your Foscam HD cameras - PTZ]] &lt;br /&gt;
&lt;br /&gt;
[[Using your iPhone&amp;#039;s location to start ZM recording]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strike&amp;gt;[[Modifying ZoneMinder to remember run state names]] (and why that is very useful)&amp;lt;/strike&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[How to use ZoneMinder with cameras it may not directly support]] (but you have some way to extract images from it)&lt;br /&gt;
&lt;br /&gt;
[[Mobile companion apps]]&lt;br /&gt;
&lt;br /&gt;
[[Exporting images to Video]]&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Various_Learnings_from_getting_Zomeminder_1.28.1_working_well_on_Ubuntu_Server_14.04&amp;diff=14074</id>
		<title>Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Various_Learnings_from_getting_Zomeminder_1.28.1_working_well_on_Ubuntu_Server_14.04&amp;diff=14074"/>
		<updated>2016-07-15T00:03:42Z</updated>

		<summary type="html">&lt;p&gt;Asker: Asker moved page Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04 to Various ZM thoughts: Various ZM learnings&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Various ZM thoughts]]&lt;/div&gt;</summary>
		<author><name>Asker</name></author>
	</entry>
</feed>