Quick Start for Dummies
From:     https://wiki.zoneminder.com/Dummies_Guide



Contents


Dummies Guide

This is a lot of what I know about surveillance cameras and ZM.

If you wish to view the full ZM Documentation, I recommend viewing it through
the PDF view, as the sphinx website is not efficient and requires javascript. 
PDF View: 
https://readthedocs.org/projects/zoneminder/downloads/pdf/stable/
If you want a hard copy, you can order the documentation through a self
publishing service like lulu.com

Zoneminder is a powerful tool, but it has a learning curve. The forums are
there to answer questions. Search then post if its not already answered.

On the learning curve: It can be some work (depending on how complex your
system is), but you will become a proficient gnulinux sysadmin if you
familiarize yourself with ZM and its many features. If you buy an off the
shelf DVR you won't learn nearly as much (if anything). Additionally, these
skills are valuable for 'any' Unix-based server (DB, website, email server,
kiosk, etc).

If you are already knowledgeable about unix based computers, then you
shouldn't have any trouble.



Install Use the install guides provided by Bbunge on the wiki: Zoneminder Wiki: Contents These are the best supported install guides. Debian is recommended. Even numbers are stable. Use those. Odd numbers are testing/development. Here's a guide for using an external HDD: Using a dedicated Hard Drive
Test out a Camera Once you get ZM installed, you will want to test out a camera. You can do a webcam, or you can do an IP camera. See the Hardware_Compatibility_List I recommend you start with an early Axis. They are well documented and easy to setup. Old ones go for $10-20. Follow the instructions on either the Zoneminder Hardware compatibility list, on ispyconnect's url list, or in the user manual for the camera. Any respectable camera will document it's RTSP and MJPEG / JPG paths for you to access. ONVIF is also an option to find the path for RTSP cameras. This is covered in more detail in Finding Camera Stream Paths. Follow the instructions in the Hardware Compatibility List for parameters for setting up a camera the first time. If you have an error, look at the logs. FFMPEG and VLC can be used to test that the streams are valid. e.g. from terminal: ffmpeg -i rtsp://username:password@:554/path output.mp4 This is faster than using ZM. In ZM, IP address, path, port, and Resolution must be correct. Most other fields can be left at defaults. Use vlc or ffplay like this: ffplay http://192.168.1.5/mjpg/video.mjpg or ffmpeg ffmpeg -i http://192.168.1.5/mjpg/video.mjpg output.mp4 or ffplay rtsp://i<user>:<pass>@<hostname/ip>:554/axis-media/media.amp ?videocodec=h264&resolution=320x240 If the camera requires authorization, consult the user manual, or you can try adding the username and password before the ip like so username:password@ipaddress This is an alternative to: 192.168.1.5?username=root&&pwd=mypass which most guides tell you to do. Both will work, however the former is easier. If pass is blank, you type in root:@192.168.1.5 RTSP always specifies the port and uses rtsp, instead of http. e.g. rtsp://user:password@192.168.1.10:554/somepath
Obtaining more Cameras In ZoneMinder, when you add a camera, you have a few options: And some others... FFMPEG / LibVLC is recommended. Don't confuse LibVNC with LibVLC. LibVNC is for recording VNC (i.e. screenrecording). FFMPEG has the option of RTSP (h264) or MJPEG streams.
MJPEG Older cameras from 2000's. E.g.Arecont Vision, Axis, Bosch, Foscam, Grandstream, Instar, Messoa, Zavio and others. The prices scale with features. Old indoor Axis cameras at 480p-720p resolution (no IR) can be found online easily for $10-30. These are generally obsolete.
RTSP 2010's and newer cameras: These cameras use h264 (or h265) compression. They serve it on an RTSP server. h264 means less bytes, so you end up using less HDD space than compared with MJPEG. H264 is recommended when possible. Note: Users with 1.32+ can use H264 passthrough, which writes the h264 direct to mp4, and saves some CPU usage.
How Powerful of a Computer to Use High-end server hardware will perform better than desktop, or low end server hardware. I have seen this firsthand between two servers: KFSN4-DRE and the KGPE-D16. The latter runs ZM with 25+ cameras, not breaking a sweat. The former reaches a limit at about 10. Another limitation is HDD size. I currently recommend buying Axis (new is expensive, so you'll probably purchase used), although many do not have IR. This is not a problem, as outdoors IR on cameras attracts spider webs, and external IR is recommended. Another recommended brand is Hikvision. Hikvision can be bought new for a lower price if warranty is an issue (for business clients that can't afford Axis). The cameras work well with ZM, and are configurable without Windows, Otherwise, any respectable name brand camera will work. Look through the hardware compatibility list. Read the user manual before you purchase the camera, and look for the following: Outdoors/indoors, IR/no-IR, Resolution. IR can be supplemented with external appliances. You can also put pesticide on the cameras to deter bugs... (although I wouldn't).
A note on Analog Cameras There is an option to use a coax to ethernet adapter. You need two pieces. One is the sender, one is the receiver. They may or may not be identical. These allow the use of IP Cameras over coax. Search ebay. Altronix ebridge ones are about $120 for a pair or adapters (you need a pair for each camera). If this is too much money, you may keep the old coax cameras. See: IP Video Encoders [1]. Honestly, just run ethernet if you have a chance. Customers expect HD these days. I have not worked with HD analog over coax, and I don't recommend it. I did try to keep old coax cameras but they became obsolete. IP cameras are the way to go.
Watching the Cameras Cameras can be watched from the ZM apache server website and/or ZMNinja. For business customers offer both choices to the customer. Or build something custom if you like. HTML imagemaps work well. You can make fully customizable pages i.e. make an html file on a remote machine with the following code embedded in an img tag. Adjust monitor ID as needed. How to stream from another ZoneMinder installation. Also an easy way to embed video in a website (img tag). See Dedicated SBC Camera Monitor for an example of a computer that only displays the streams. [[2]] has the HTML code for API/non-API usage. If you embed the URL in an img tag, include http prefix or it wont work. img width="500px" height="500px" src="http://zmserveripaddress/zm/ cgi-bin/nph-zms?mode=jpeg&monitor=#&scale=100&maxfps=5& user=username&pass=password" Call it locally: firefox file:///home/username/file.html When you have > 6 cameras, you can either use firefox and edit about:config (explained below in guide), or see: https://forums.zoneminder.com/viewtopic.php?t=28168&p=113934#p113934 for instructions regarding multi port. Watch the scale parameter. That can be adjusted for clients with low power CPUs (ARM SBCs) if whole img boxes seem to drop out. Note that scale does require some CPU on the server side. One note: If you have alternative high/low resolution cameras (motion detect on the low res, record on the high res). You might not want customers to view the low res cameras. In this case, make a group of the high res cameras, and set that to be the default view.
Embedding ZM in a webpage Example Camera View HTML Embedding Streaming Video in External Website from Forums https://wiki.zoneminder.com/External_Live_Stream#Imagemap_of_Cameras - Highly recommended for medium / large installations.
Recording in Zoneminder The zmc binary handles recording and analysis (1.36). You can record everything (good, but no way to find events). You can modect everything (light HDD use, but misses stuff). You can mocord everything (better, but uses HDD, and event list timeline in ZMNinja shows 10 minute segments). But all of these are flawed. Here's what you do: always record two streams percamera: One, low res stream function, is set to mocord/modect, with reasonable (but no need to be perfect) settings for detection. Two, high res stream function is set to either record (mocord or record) and uses h264 passthrough.* The hi res compressed stream is saved directly to disk. Decoding and Analysis should be disabled as well in the source menu. See also this link for a way to use a high res stream under analysis with less CPU: CamPerf In ZM 1.32+, you can use multiple HDs (as many as you like), and assign cameras to where they should be saved. These are storage areas
Motion Detection What's all this motion detection stuff, anyhow? The strength of zoneminder lies in its motion detection analysis (thus the 'zone' in zoneminder, being the motion detection zones). See: Understanding Zoneminder's Zoning system for Dummies
Help, I missed an event!? You can re-run analysis on old videos with: https://forums.zoneminder.com/viewtopic.php?f=11&t=24686 and https://forums.zoneminder.com/viewtopic.php?f=8&t=28013&p=109190 You can re-create videos from your (JPEG ONLY) footage, and then reanalyze them. (those with ffmpeg mp4s created, may need to combine the footage into one video, then make that a video source in zm as file.). See also: https://forums.zoneminder.com/viewtopic.php?f=11&t=31355 to run zm on files on the server filesystem.
4K Cameras Mocord on the low res stream, and record on the high res stream. Do NOT use any analysis or decoding on the high res stream. Analysis and decoding is where the CPU is eaten up.
Sizing Zones Tip My first thought is the threshold is too low. It happened to me when I first started with ZM. I figured out a little trick: Draw a new zone a little smaller than you appear in the video. The zone will tell you the number of pixels or the percent of the whole frame. Compare that to the size you have setup to detect. If you are using percent try changing to pixels, that will not require the math to adjust the percent. ref:http://forums.zoneminder.com/viewtopic.php?f=40&t=30570
I'm still getting false alerts! You may want to run ZMES. It's not too difficult to setup, but it will require more resources. See https://wiki.zoneminder.com/ZMES
Tips
Hardware Advice When setting up the cameras, here is some advice.
Troubleshooting
Notes sudo iptables-legacy -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination <officeip>:80 sudo iptables-legacy -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination <officeip>:443 sudo iptables-legacy -t nat -A POSTROUTING -j MASQUERADE Note that you might want to set nonstandard ports.
See Also
Other Users
Dummies Guide