{"id":509,"date":"2013-11-29T17:13:36","date_gmt":"2013-11-29T15:13:36","guid":{"rendered":"http:\/\/dety.net.ua\/?p=509"},"modified":"2014-10-24T12:00:04","modified_gmt":"2014-10-24T10:00:04","slug":"zoneminder","status":"publish","type":"post","link":"https:\/\/dety.net.ua\/?p=509","title":{"rendered":"Zoneminder"},"content":{"rendered":"<p>I have a card Kodicom 4400R and IP-camera Hikvision DS-2CD2012-I.<\/p>\n<p>I looked for a free video surveillance system and found it:<a href=\"http:\/\/www.zoneminder.com\/\" target=\"_blank\"> Zoneminder<\/a>.<\/p>\n<p>Firstly, I tried to install it on CentOS 6.4 (i686) from the source.<\/p>\n<p>But after fighting with different errors I decided to install it on Ububntu 13.04 Desktop. So:<\/p>\n<p>Install LAMP:<\/p>\n<pre>sudo apt-get install tasksel<\/pre>\n<pre>sudo tasksel install lamp-server<\/pre>\n<p>Install Postfix:<\/p>\n<blockquote><p>sudo apt-get install postfix<\/p><\/blockquote>\n<p>Install Zoneminder.<\/p>\n<blockquote><p>sudo add-apt-repository ppa:iconnor\/zoneminder<br \/>\nsudo apt-get update<br \/>\nsudo apt-get install zoneminder<\/p><\/blockquote>\n<p>Configure Apache for Zoneminder:<\/p>\n<blockquote><p>sudo ln -s \/etc\/zm\/apache.conf \/etc\/apache2\/sites-enabled\/zoneminder.conf<\/p><\/blockquote>\n<p>Check that \/etc\/php5\/apache2\/php.ini<\/p>\n<blockquote><p>short_open_tag = On<\/p><\/blockquote>\n<p>Start services:<\/p>\n<blockquote><p>sudo \/etc\/init.d\/apache2 start<\/p>\n<p>sudo \/etc\/init.d\/zoneminder start<\/p><\/blockquote>\n<p>Login to http:\/\/localhost\/zm\/<\/p>\n<p>You can see an empty console. Click on the Add New Monitor.<\/p>\n<p>&nbsp;<\/p>\n<p>Source type = local &#8211; I will use the card Kodicom 4400R,<\/p>\n<p>Function = Monitor &#8211; I will only view it.<\/p>\n<p>Go to the Source tab:<\/p>\n<p>&nbsp;<\/p>\n<p>Device path = \/dev\/video0 &#8211; I will use the device video0<\/p>\n<p>Device channel = 0 &#8211; I will use the first channel on the card.<\/p>\n<p>That&#8217;s all for internal card.<\/p>\n<p>Screenshots for the IP-camera:<\/p>\n<p>&nbsp;<\/p>\n<p>I will use ffmpeg module with motion detection.<\/p>\n<p>&nbsp;<\/p>\n<p>There is a trick with source path. For my Hikvision camera it&#8217;s:<\/p>\n<blockquote><p>rtsp:\/\/admin:password@192.168.1.2\/Streaming\/Channels\/1?tcp<\/p><\/blockquote>\n<p>Be careful &#8211; <strong>?tcp<\/strong> in the end means I will use TCP protocol. It will have a red error screen if you won&#8217;t pick it. Hikvision camera streams with UDP by default.<\/p>\n<p>Now you can check the image from the camera by clicking on it&#8217;s name.<\/p>\n<p>That&#8217;s I have:<\/p>\n<p>&nbsp;<\/p>\n<p>The red underline means you can click on it and view\/edit the parameters.<\/p>\n<p>You can review records in Events.<\/p>\n<p>&nbsp;<\/p>\n<p>Click on the Show Filter Window to configure e-mail alerts.<\/p>\n<p>&nbsp;<\/p>\n<p>After changing rules you need to restart Zoneminder: <strong>sudo \/etc\/init.d\/zoneminder restart<\/strong><\/p>\n<p>You can configure motion detection zones in Zones &#8211; there is nothing special.<\/p>\n<p>Now You can get alerts on your e-mail by motion detection.<\/p>\n<p><strong>P.S.:<\/strong><\/p>\n<p>I have the card Orient SDVR-604 also &#8211; the clone of Kodicom 4400R.<\/p>\n<p>For using it I have added the next in the configs:<\/p>\n<p>Created this:<strong> \/etc\/modprobe.d\/bttv.conf<\/strong><\/p>\n<p>Add this to it: <strong>options bttv card=0x84,0x84,0x84,0x84 tuner=4,4,4,4 autoload=0<\/strong><\/p>\n<p>This mean I use 4 chips card without tuner.<\/p>\n<p>You will see only blue screen without correct card&#8217;s number.<\/p>\n<p>P.S.S.:<\/p>\n<p>1. If you see access denied for \/dev\/video0 in the log &#8211; just run the next command (add user video to the group www-data):<\/p>\n<p><strong>sudo usermod -a -G video www-data<\/strong><\/p>\n<p>2. Add this to ZM e-mail to get the video: %EV%<\/p>\n<p>3. When You are using a BTTV (bt8x8) card, You can have troubles using KODICOM 4400 and similar cards with ZoneMinder. The issue is using Video4Linux multibuffer option (in default ZM config). In this case video channels using the same \/dev\/video_ can interfere each other. For example &#8211; using channel 0 and 12 on \/dev\/video0 shows on both cameras the same picture. Turn off V4L_MULTI_BUFFER in options &#8211;&gt; config for proper streaming.<\/p>\n<p>And you can enumerate them all from \/dev\/video0(1-16)<\/p>\n<p>4. I couldn&#8217;t see the realtime video &#8211; nothing. I compared 2 installations of ZM and found out the cgiload module was missed. It was cured by: <strong>sudo a2enmod cgi<\/strong><code><\/code><\/p>\n<p>5. I bought a new colour NTSC (other &#8211; PAL) car park camera and had some issues with getting image from it. I resolved it with changing 24 bit colour on all the cameras. The same situation with resolution &#8211; it have to be the same on all cameras &#8211; I changed it from 320&#215;240 to 640&#215;480 successfully although cameras had different systems PAL\/NTSC and TV-lines (420\/580).Else you will get issues on all cameras. So, if you use bt8x8 card you have to have the same config for all cameras.<\/p>\n<p>6. I noticed that video was interlaced. I changed CAPTURES_PER_FRAME from 1 to 4 and the image became much better.<\/p>\n<p>Links:<\/p>\n<p><a href=\"http:\/\/avreg.net\/howto_linux-capture-cards.html\" target=\"_blank\">http:\/\/avreg.net\/howto_linux-capture-cards.html<\/a><\/p>\n<p><a href=\"http:\/\/avreg.net\/howto_linux-capture-cards_bttv.html\" target=\"_blank\">http:\/\/avreg.net\/howto_linux-capture-cards_bttv.html<\/a><\/p>\n<p><a href=\"http:\/\/www.zoneminder.com\/wiki\/index.php\/Kodicom_8800\" target=\"_blank\">http:\/\/www.zoneminder.com\/wiki\/index.php\/Kodicom_8800<\/a><\/p>\n<p><a href=\"http:\/\/www.zoneminder.com\/wiki\/index.php\/Ubuntu_Server_12.04_64-bit_with_Zoneminder_1.25.0_the_easy_way\" target=\"_blank\">http:\/\/www.zoneminder.com\/wiki\/index.php\/Ubuntu_Server_12.04_64-bit_with_Zoneminder_1.25.0_the_easy_way<\/a><\/p>\n<p><a href=\"http:\/\/www.howtoforge.com\/forums\/showthread.php?t=50199\" target=\"_blank\">http:\/\/www.howtoforge.com\/forums\/showthread.php?t=50199<\/a><\/p>\n<p>P.S.: Last time I installed ZM in this way: <a href=\"http:\/\/www.zoneminder.com\/wiki\/index.php\/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.26.5_the_easy_way\" target=\"_blank\">http:\/\/www.zoneminder.com\/wiki\/index.php\/Ubuntu_Server_14.04_64-bit_with_Zoneminder_1.26.5_the_easy_way<\/a><br \/>\n&#8211; recommended.<\/p>\n<p>Some another tips:<\/p>\n<p>To resolve the permissions issues:<\/p>\n<pre class=\"code bash\"><span class=\"kw2\">sudo chmod<\/span> <span class=\"nu0\">666<\/span> <span class=\"sy0\">\/<\/span>dev<span class=\"sy0\">\/<\/span>video0<\/pre>\n<pre class=\"code bash\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">chmod<\/span> <span class=\"nu0\">4755<\/span> <span class=\"sy0\">\/<\/span>usr<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span>zmfix<\/pre>\n<p>In Config &#8211; Paths. Change ZM_PATH_ZMS from nph-zms to zms &#8211; it will make video capture better.<\/p>\n<p>Use avconv as the path for ffmpeg in new Ubuntu: Options &#8211; Images &#8211; PATH_FFMPEG = avconv<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a card Kodicom 4400R and IP-camera Hikvision DS-2CD2012-I. I looked for a free video surveillance system and found it: Zoneminder. Firstly, I tried to install it on CentOS 6.4 (i686) from the source. But after fighting with different errors I decided to install it on Ububntu 13.04 Desktop. So: Install LAMP: sudo apt-get [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,13],"tags":[],"class_list":["post-509","post","type-post","status-publish","format-standard","hentry","category-linux","category-novosti"],"_links":{"self":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=509"}],"version-history":[{"count":15,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/509\/revisions"}],"predecessor-version":[{"id":620,"href":"https:\/\/dety.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/509\/revisions\/620"}],"wp:attachment":[{"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dety.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}