<h2 id="cctv-security-system">CCTV Security System</h2>
<ul>
<li>$80 Reolink IP PoE Security Camera 4MP Super HD 2560x1440 with SD Card &amp; Audio Outdoor Indoor Bullet IR Night Vision Motion Detection RLC-410S</li>
<li>65$ RLC-410 ( No SD CARD )</li>
<li>$150 Linksys Business LGS116P 16-Port Desktop Gigabit Ethernet PoE+ Unmanaged Network Switch I Metal Enclosure $150</li>
<li>Ispy to start</li>
<li><a href="https://forums.zoneminder.com/viewtopic.php?f=36&amp;t=26906" class="uri">https://forums.zoneminder.com/viewtopic.php?f=36&amp;t=26906</a> 115 lines of bash</li>
<li>When event ends on ZM yolo is run on a random 10 images for that event (Person Dog Cat Car)</li>
<li>if an object is detected we look to see if two Android phones via MAC on network</li>
<li>if they are on the network it means somebody is home so events are throttled to 1/1hr max</li>
<li>if nobody is home then original image/object detected from event is sent to email</li>
<li>zones</li>
<li>zones preclusion</li>
<li>Video <a href="https://rmccurdy.com/scripts/videos/rmccurdy_com/ZoneMinder_Yolo_Yolov2_Darknet_Script_Plugin.mp4" class="uri">https://rmccurdy.com/scripts/videos/rmccurdy_com/ZoneMinder_Yolo_Yolov2_Darknet_Script_Plugin.mp4</a></li>
</ul>
<h3 id="issues">Issues:</h3>
<ul>
<li>rain, spiderwebs, shadows, Car lights (preclusion zones)</li>
<li>full motion capture is -6hrs 16gig</li>
<li>smearing ( lower FPS on cam and make sure ZM has higher framerate then the cam make sure not to use Source Type:ffmpeg and use remote or try both)</li>
<li><code>journalctl -f -t DARKNET.service</code> (shows nothing...@#%ing systemd)</li>
<li>night time</li>
</ul>
<h2 id="more-notes">More Notes:</h2>
<p>Start with one zone at a time and raise/test sensitive KISS...don't setup like 4 zones and expect to trouble shoot anything. I used my Android to do a lot of tweaking. I also want to sort out &quot;night&quot; mode config so after night mode kicks in a different config is automatically applied.</p>
<p>Use low quality for motion detection and drop frame rate of cam to lower than max of ZM for little to no smearing and I also set &quot;Alarm Frame Count to 2&quot; and &quot;overload ignore frame count to 4&quot; but I think it's more about Alarm Frame Count..I can't be sure..</p>
<p>Explanation of overload ignore frame count<br />
Report this post Quote<br />
Post by bb99 » Thu May 10, 2012 5:22 pm</p>
<p>For sudden changes to the environment, no better tool then Overload Frame Ignore Count. Your fps determines these settings but at 10 fps with Overload Frame Ignore Count set to 4, it only ignores .4 seconds. In other words if a drastic change to the lighting (such as a car with headlights on in darkness) passes within the monitors view it will ignore the number of frames you specify before processing for motion detection.</p>
<h3 id="alarm-frame-count">Alarm Frame Count</h3>
<p>This option allows you to specify how many consecutive alarm frames must occur before an alarm event is generated. The usual, and default, value is 1 which implies that any alarm frame will cause or participate in an event. You can enter any value up to 16 here to eliminate bogus events caused perhaps by screen flickers or other transients. Values over 3 or 4 are unlikely to be useful however. Please note that if you have statistics recording enabled then currently statistics are not recorded for the first ‘Alarm Frame Count’-1 frames of an event. So if you set this value to 5 then the first 4 frames will be missing statistics whereas the more usual value of 1 will ensure that all alarm frames have statistics recorded.</p>
<p><a href="https://forums.zoneminder.com/viewtopic.php?f=36&amp;t=26222" class="uri">https://forums.zoneminder.com/viewtopic.php?f=36&amp;t=26222</a></p>
<p>Windows software to get basic idea ( install face plugin )<br />
<a href="https://www.ispyconnect.com/plugins.aspx" class="uri">https://www.ispyconnect.com/plugins.aspx</a></p>
<h2 id="videos">Videos</h2>
<ul>
<li><a href="https://www.reddit.com/r/DIY/comments/713eka/heres_how_to_build_your_own_smart_security_camera/" class="uri">https://www.reddit.com/r/DIY/comments/713eka/heres_how_to_build_your_own_smart_security_camera/</a></li>
<li><a href="https://www.hackster.io/hackerhouse/raspberry-pi-motion-tracking-gun-turret-77fb0b" class="uri">https://www.hackster.io/hackerhouse/raspberry-pi-motion-tracking-gun-turret-77fb0b</a></li>
<li><a href="https://www.youtube.com/watch?v=QfNvhPx5Px8" class="uri">https://www.youtube.com/watch?v=QfNvhPx5Px8</a></li>
<li><a href="https://www.youtube.com/watch?v=4eIBisqx9_g&amp;t=11m10s" class="uri">https://www.youtube.com/watch?v=4eIBisqx9_g&amp;t=11m10s</a></li>
</ul>
<h2 id="eazy-getting-started">eazy getting started</h2>
<ul>
<li><a href="https://pjreddie.com/darknet/yolo/#small" class="uri">https://pjreddie.com/darknet/yolo/#small</a></li>
</ul>
<h3 id="getting-started-with-gpu">getting started with GPU</h3>
<p>you need 4gig+ GPU and new nvidia or old GCC4.9 /GCC4_NEEDED_FOR_DARKNET$ ls cpp-4.9_4.9.2-10_amd64.deb gcc-4.9_4.9.2-10_amd64.deb libasan1_4.9.2-10_amd64.deb libcloog-isl-dev_0.18.2-1+b2_amd64.deb libisl10_0.12.2-2_amd64.deb g++-4.9_4.9.2-10_amd64.deb gcc-4.9-base_4.9.2-10_amd64.deb libcloog-isl4_0.18.2-1+b2_amd64.deb libgcc-4.9-dev_4.9.2-10_amd64.deb libstdc++-4.9-dev_4.9.2-10_amd64.deb https://github.com/dasGringuen/debian9-install</p>
<h3 id="gpu-memory-talk">GPU memory talk</h3>
<p><a href="https://groups.google.com/forum/#!msg/darknet/ZRAEvMmKzFc/iVZgibJiJQAJ" class="uri">https://groups.google.com/forum/#!msg/darknet/ZRAEvMmKzFc/iVZgibJiJQAJ</a></p>
<h3 id="trying-to-gpu-prep-..">trying to GPU prep ..</h3>
<pre><code>apt-get remove --purge nvidia-cuda-toolkit libcudnn*
dpkg -i libcudnn7_7.0.5.15-1+cuda9.1_amd64.deb
dpkg -i libcudnn7-dev_7.0.5.15-1+cuda9.1_amd64.deb
dpkg -i cuda-repo-ubuntu1704-9-1-local_9.1.85-1_amd64

sudo dpkg -i cuda-repo-ubuntu1704-9-1-local_9.1.85-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-1-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

apt install libopencv-dev</code></pre>
<h3 id="more-code-references">more code/ references</h3>
<ul>
<li><a href="https://machinethink.net/blog/object-detection-with-yolo/" class="uri">https://machinethink.net/blog/object-detection-with-yolo/</a></li>
<li><a href="https://ozone.network/apidocs/starter__example_8cpp_source.html" class="uri">https://ozone.network/apidocs/starter__example_8cpp_source.html</a></li>
</ul>
<h3 id="yolov2-training">yolov2 training</h3>
<ul>
<li><a href="https://www.yuthon.com/2016/12/03/Train-YOLOv2-on-my-own-dataset/" class="uri">https://www.yuthon.com/2016/12/03/Train-YOLOv2-on-my-own-dataset/</a></li>
</ul>
<h3 id="dump-reolink-using-gpu-nvidia">dump reolink using GPU nvidia</h3>
<pre><code>ffmpeg -c:v h264_vdpau -rtsp_transport tcp -i &quot;rtsp://admin:@25.0.0.238/h264Preview_01_main&quot; -f segment -segment_time 60 -segment_format mp4  -reset_timestamps 1 -strftime 1 -c copy -map 0 dauphine-%Y%m%d-%H%M%S.mp4

ffmpeg -hwaccel vdpau -i rtsp://admin:@25.0.0.238/h264Preview_01_main -an -f rawvideo -y /dev/null</code></pre>
<h3 id="complicated-zoneminder-plugins-and-bits-of-code">complicated zoneminder plugins and bits of code :(</h3>
<ul>
<li><a href="https://gist.github.com/pliablepixels/34b484cca1c23ae9493c5d2e57f0bde8" class="uri">https://gist.github.com/pliablepixels/34b484cca1c23ae9493c5d2e57f0bde8</a></li>
<li><a href="https://forums.zoneminder.com/viewtopic.php?f=36&amp;t=26222" class="uri">https://forums.zoneminder.com/viewtopic.php?f=36&amp;t=26222</a></li>
<li><a href="https://through-the-interface.typepad.com/through_the_interface/2012/09/creating-a-face-recognising-security-cam-with-a-raspberry-pi-part-1.html" class="uri">https://through-the-interface.typepad.com/through_the_interface/2012/09/creating-a-face-recognising-security-cam-with-a-raspberry-pi-part-1.html</a></li>
</ul>
<h3 id="cheap-cams-720p-max">cheap cams 720p max</h3>
<ul>
<li><a href="https://www.zmododirect.com/" class="uri">https://www.zmododirect.com/</a></li>
</ul>
<h3 id="save-as-video">Save as video</h3>
<p>By default ZoneMinder saves events as a sequence of images. It is however possible to save an event as a video file. Caution is advised when converting events to video as it is very strenuous on the ZoneMinder machine, however once you have converted an event it can be viewed/downloaded any time without additional stress on the server.</p>
<p>First, make sure you have <code>OPT_FFMPEG</code> under Options -&gt; Images set to yes (checked).</p>
<p>If necessary, set the proper full path for the ffmpeg executable in <code>PATH_FFMPEG</code> (ex.: <code>/usr/bin/ffmpeg</code>)</p>
<p>Open up the default view for an event and Click the video link located in the top left corner</p>
<p>Choose a video export file type and click generate.</p>
<p>Download the video to your machine. If video files have already been generated you will see them listed at the bottom of the page.</p>
<p>When an event gets a video file encoded for it you can choose to automatically include that event with any future exports. For a more detailed explanation on how to select and export events investigate How to export download and view events</p>
