<?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=Gerdesj</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=Gerdesj"/>
	<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/Special:Contributions/Gerdesj"/>
	<updated>2026-05-03T13:37:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=17545</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=17545"/>
		<updated>2025-01-23T16:31:20Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Emphasise installation of libnvidia-decode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU should reduce the load on the CPUs and potentially enable a system to process more or larger camera feeds.  It can be tricky to get GPU passthrough working for GPUs to virtual machines.  This article is based on running systems. Note that you may also want to consider using a GPU just for object detection (ZMES), not necessarily for ZM.&lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU on Proxmox==&lt;br /&gt;
I have recently [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 19:07, 6 September 2024 (EDT) migrated the hardware running VMware (Dell T320) in the next section to Proxmox 8.2.  I followed this guide: https://www.theregister.com/2024/06/19/proxmox_xcp_ng_gpu_passthrough/ The Proxmox instructions work  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed, since I first wrote this article.  I suggest ignoring the VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.  Note that one of them is to avoid a PSOD so ensure you have access to the system if it needs rebooting from a crash.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-410.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
==Ubuntu 20.04 VM==&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
===Nvidia drivers and CUDA===&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot, optionally install nvidia-utils to get nvidia-smi:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
 # apt install nvidia-utils-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting, if you have the utils installed:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;: libnvidia-decode-440.&lt;br /&gt;
&lt;br /&gt;
If it does not work properly then reboot the ESXi host.  For example the two devices seem to pass through OK but only the audio devices seem to work.  You may have crashed the GPU in some way.  Messing around with drivers and too many restarts of the VM seems to cause this for me.&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
If you get an error relating to libnvcuvid.so.1 then you have not installed libnvidia-decode&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main (bold in the URLs in the table.)  Monitoring at say 640 x 480 7 frames per second will allow you to monitor a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD &amp;lt;br /&amp;gt;&lt;br /&gt;
rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=1&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;br /&gt;
* https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/ - Nvidia Page on FFMPEG&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?t=33415 - the deb-multimedia repo reportedly has CUDA support compiled in for FFMPEG.&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=17417</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=17417"/>
		<updated>2024-09-06T23:07:18Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: First stab at adding Proxmox details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU should reduce the load on the CPUs and potentially enable a system to process more or larger camera feeds.  It can be tricky to get GPU passthrough working for GPUs to virtual machines.  This article is based on running systems. Note that you may also want to consider using a GPU just for object detection (ZMES), not necessarily for ZM.&lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU on Proxmox==&lt;br /&gt;
I have recently [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 19:07, 6 September 2024 (EDT) migrated the hardware running VMware (Dell T320) in the next section to Proxmox 8.2.  I followed this guide: https://www.theregister.com/2024/06/19/proxmox_xcp_ng_gpu_passthrough/ The Proxmox instructions work  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed, since I first wrote this article.  I suggest ignoring the VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.  Note that one of them is to avoid a PSOD so ensure you have access to the system if it needs rebooting from a crash.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-410.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
==Ubuntu 20.04 VM==&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
===Nvidia drivers and CUDA===&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot, optionally install nvidia-utils to get nvidia-smi:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
 # apt install nvidia-utils-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting, if you have the utils installed:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;: libnvidia-decode-440.  It should get installed automatically.&lt;br /&gt;
&lt;br /&gt;
If it does not work properly then reboot the ESXi host.  For example the two devices seem to pass through OK but only the audio devices seem to work.  You may have crashed the GPU in some way.  Messing around with drivers and too many restarts of the VM seems to cause this for me.&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main (bold in the URLs in the table.)  Monitoring at say 640 x 480 7 frames per second will allow you to monitor a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD &amp;lt;br /&amp;gt;&lt;br /&gt;
rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=1&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;br /&gt;
* https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/ - Nvidia Page on FFMPEG&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?t=33415 - the deb-multimedia repo reportedly has CUDA support compiled in for FFMPEG.&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_in_VMWare&amp;diff=17416</id>
		<title>GPU passthrough in VMWare</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_in_VMWare&amp;diff=17416"/>
		<updated>2024-09-06T22:58:49Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Gerdesj moved page GPU passthrough in VMWare to GPU passthrough to virtual machines: Broaden scope of article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[GPU passthrough to virtual machines]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=17415</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=17415"/>
		<updated>2024-09-06T22:58:49Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Gerdesj moved page GPU passthrough in VMWare to GPU passthrough to virtual machines: Broaden scope of article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU should reduce the load on the CPUs and potentially enable a system to process more or larger camera feeds.  It can be tricky to get GPU passthrough for some NVidia cards working on VMWare.  This article is based on a running system. Note that you may also want to consider using a GPU just for object detection (ZMES), not necessarily for ZM.&lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed, since I first wrote this article.  I suggest ignoring the VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.  Note that one of them is to avoid a PSOD so ensure you have access to the system if it needs rebooting from a crash.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-410.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot, optionally install nvidia-utils to get nvidia-smi:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
 # apt install nvidia-utils-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting, if you have the utils installed:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;: libnvidia-decode-440.  It should get installed automatically.&lt;br /&gt;
&lt;br /&gt;
If it does not work properly then reboot the ESXi host.  For example the two devices seem to pass through OK but only the audio devices seem to work.  You may have crashed the GPU in some way.  Messing around with drivers and too many restarts of the VM seems to cause this for me.&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main (bold in the URLs in the table.)  Monitoring at say 640 x 480 7 frames per second will allow you to monitor a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD &amp;lt;br /&amp;gt;&lt;br /&gt;
rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=1&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;br /&gt;
* https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/ - Nvidia Page on FFMPEG&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?t=33415 - the deb-multimedia repo reportedly has CUDA support compiled in for FFMPEG.&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16675</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16675"/>
		<updated>2021-07-07T23:12:52Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Expand the intro and spell out dealing with a PSOD&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU should reduce the load on the CPUs and potentially enable a system to process more or larger camera feeds.  It can be tricky to get GPU passthrough for some NVidia cards working on VMWare.  This article is based on a running system.&lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed, since I first wrote this article.  I suggest ignoring the VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.  Note that one of them is to avoid a PSOD so ensure you have access to the system if it needs rebooting from a crash.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-410.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot, optionally install nvidia-utils to get nvidia-smi:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
 # apt install nvidia-utils-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting, if you have the utils installed:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;: libnvidia-decode-440.  It should get installed automatically.&lt;br /&gt;
&lt;br /&gt;
If it does not work properly then reboot the ESXi host.  For example the two devices seem to pass through OK but only the audio devices seem to work.  You may have crashed the GPU in some way.  Messing around with drivers and too many restarts of the VM seems to cause this for me.&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main (bold in the URLs in the table.)  Monitoring at say 640 x 480 7 frames per second will allow you to monitor a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD &amp;lt;br /&amp;gt;&lt;br /&gt;
rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=1&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16674</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16674"/>
		<updated>2021-07-07T17:46:33Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Nvidia drivers and CUDA */ clean up Nvidia install notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-410.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot, optionally install nvidia-utils to get nvidia-smi:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
 # apt install nvidia-utils-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting, if you have the utils installed:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;: libnvidia-decode-440.  It should get installed automatically.&lt;br /&gt;
&lt;br /&gt;
If it does not work properly then reboot the ESXi host.  For example the two devices seem to pass through OK but only the audio devices seem to work.  You may have crashed the GPU in some way.  Messing around with drivers and too many restarts of the VM seems to cause this for me.&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main (bold in the URLs in the table.)  Monitoring at say 640 x 480 7 frames per second will allow you to monitor a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD &amp;lt;br /&amp;gt;&lt;br /&gt;
rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=1&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16673</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16673"/>
		<updated>2021-07-07T16:16:50Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Nvidia GPU in VMware */ 410 not 520&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-410.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main (bold in the URLs in the table.)  Monitoring at say 640 x 480 7 frames per second will allow you to monitor a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD &amp;lt;br /&amp;gt;&lt;br /&gt;
rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=1&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16672</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16672"/>
		<updated>2021-07-07T15:43:31Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Camera Settings */ Add sub URL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main (bold in the URLs in the table.)  Monitoring at say 640 x 480 7 frames per second will allow you to monitor a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD &amp;lt;br /&amp;gt;&lt;br /&gt;
rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;sub&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=1&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=16671</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=16671"/>
		<updated>2021-07-06T15:25:33Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Fix forum links&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 [https://zoneminder.readthedocs.io/en/stable/userguide/definezone.html here]. However, you will see 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://forums.zoneminder.com/viewtopic.php?f=32&amp;amp;t=23024 here]. You should also read his earlier explanation [http://forums.zoneminder.com/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;
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 let&amp;#039;s 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 documentation I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, it&amp;#039;s 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. Then 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 let&amp;#039;s 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 percentages)&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 lessons for me was 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 percentages 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>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Understanding_ZoneMinder%27s_Zoning_system_for_Dummies&amp;diff=16670</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=16670"/>
		<updated>2021-07-06T15:19:57Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Fix documentation link and some minor spellings&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 [https://zoneminder.readthedocs.io/en/stable/userguide/definezone.html here]. However, you will see 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;
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 let&amp;#039;s 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 documentation I pointed to earlier does a great job of explaining different methods. At the cost of repeating what has already been said, it&amp;#039;s 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. Then 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 let&amp;#039;s 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 percentages)&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 lessons for me was 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 percentages 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>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16669</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16669"/>
		<updated>2021-07-06T11:47:02Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Camera Settings */ Correct the model now in use on this system&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-410-5MP&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16668</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16668"/>
		<updated>2021-07-06T09:54:44Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Camera Settings */ re-arrange and simplify 1.36 notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
All other settings on defaults.  Initial setup done on 1.34.  See below for notes on 1.36&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Changes between 1.34 and 1.36 ==&lt;br /&gt;
I had to change the buffers settings to stop zmc crashing. &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36 which autotunes the buffer.  &amp;#039;&amp;#039;Image Buffer Size (frames)&amp;#039;&amp;#039; to 5 which smoothes the live view.  /dev/shm is no longer a concern in 1.36 as it was before (see the release notes: https://forums.zoneminder.com/viewtopic.php?f=1&amp;amp;t=30781 )&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16667</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16667"/>
		<updated>2021-07-06T01:10:59Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Camera Settings */ 0 still seems best for buffer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
I [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 00:45, 6 July 2021 (UTC) have just upgraded from 1.34 to 1.36 and I had to change the buffers settings to stop zmc crashing.  I&amp;#039;ve changed &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The default is 0 if you create a new monitor in 1.36.  I&amp;#039;ve tried 50 but that still had errors relating to getting behind.  /dev/shm is showing 5% usage instead of around 40% in 1.34.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16666</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16666"/>
		<updated>2021-07-06T00:52:51Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Camera Settings */ Notes wrt buffers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
I [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 00:45, 6 July 2021 (UTC) have just upgraded from 1.34 to 1.36 and I had to change the buffers settings to stop zmc crashing.  I&amp;#039;ve changed &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  The monitors are no longer crashing every few seconds but are running behind and load average is up.  Setting to 50 has reduced the load back to roughly the same as 1.34.  The default is 0 if you create a new monitor in 1.36.  /dev/shm is showing 5% usage instead of around 40% in 1.34.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16665</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16665"/>
		<updated>2021-07-06T00:45:47Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Relaxing version warnings and note 1.36 upgrade changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
I have not tested whether all mitigations are &amp;#039;&amp;#039;still&amp;#039;&amp;#039; needed.  I suggest ignoring my VMware related changes (except for the actual passthrough step!) first and then add them in if they are still an issue.&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34 and 1.36&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
&lt;br /&gt;
I [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 00:45, 6 July 2021 (UTC) have just upgraded from 1.34 to 1.36 and I had to change the buffers settings to stop zmc crashing.  I&amp;#039;ve changed &amp;#039;&amp;#039;Maximum Image Buffer Size (frames)&amp;#039;&amp;#039; from 25 to 0.  /dev/shm is showing 5% usage instead of around 40% in 1.34.  The monitors are no longer crashing every few seconds but are running behind and load average is up.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* https://forums.zoneminder.com/viewtopic.php?f=40&amp;amp;t=30512&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16392</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16392"/>
		<updated>2020-10-22T14:55:13Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Updated system and it still works!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at the present [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
(Update: 450 version works as well. [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 14:55, 22 October 2020 (UTC))&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16239</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16239"/>
		<updated>2020-08-07T12:31:36Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Tidy up&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at the present [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 20.04 VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu 20.04 LTS. NVidia as upstream also provide drivers and these will be newer but may break something.  The OS provided ffmpeg has cuda support built in.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16238</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16238"/>
		<updated>2020-08-06T21:14:33Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Camera Settings */ Clarify streams&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% reduction and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at now [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lowest quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.  I want to watch these cameras so I monitor at high resolution.  If you are building a security system then monitor sub and record main.  Monitoring at say 640 x 480 will allow you to run a huge number of cameras.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value RTMP&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16237</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16237"/>
		<updated>2020-08-06T21:10:16Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Ubuntu VM */ Formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% reduction and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at now [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&lt;br /&gt;
&lt;br /&gt;
 hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lower quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value RTMP&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16236</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16236"/>
		<updated>2020-08-06T17:51:08Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Update expectations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% reduction and load about 30-50% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at now [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lower quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value RTMP&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16235</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16235"/>
		<updated>2020-08-06T17:41:51Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Add camera settings for reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% reduction and load about 30% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at now [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
== Camera Settings ==&lt;br /&gt;
&lt;br /&gt;
Camera parameters for reference. Reolinks have three streams - main, sub and ext.  main is the clear stream and sub is the lower quality one.  These cameras also have a RTSP stream but that appears to be pretty flakey compared to RTMP.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter&lt;br /&gt;
!Value RTMP&lt;br /&gt;
|-&lt;br /&gt;
|Model&lt;br /&gt;
|Reolink RLC-520&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Source Type&lt;br /&gt;
|Ffmpeg&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Source&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Method&lt;br /&gt;
|TCP&lt;br /&gt;
|-&lt;br /&gt;
|Options&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Source Path&lt;br /&gt;
|rtmp://HOSTNAME_OR_IP/bcs/channel0_&amp;#039;&amp;#039;&amp;#039;main&amp;#039;&amp;#039;&amp;#039;.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&lt;br /&gt;
|-&lt;br /&gt;
|DecoderHWAccelName&lt;br /&gt;
|cuda&lt;br /&gt;
|-&lt;br /&gt;
|Target colorspace&lt;br /&gt;
|32 bit colour&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|2048&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|1536&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Storage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|Save JPEGs&lt;br /&gt;
|Frames + Analysis images (if available)&lt;br /&gt;
|-&lt;br /&gt;
|Video Writer&lt;br /&gt;
|H264 Camera Passthrough&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16234</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16234"/>
		<updated>2020-08-06T17:37:55Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Add ZM version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% reduction and load about 30% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at now [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
* Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
* VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
* GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
* Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
* VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
* Zoneminder: 1.34&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16233</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16233"/>
		<updated>2020-08-06T17:29:02Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Fix intro, add sig, remove refs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  I saw /dev/shm at 50% reduction and load about 30% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at now [[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]) 17:29, 6 August 2020 (UTC).&lt;br /&gt;
&lt;br /&gt;
*Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
*VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
*GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
*Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
*VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD on the host when restarting the VM with the GPU passed through to it. See: https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/&lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism  and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.  see: https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16232</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16232"/>
		<updated>2020-08-06T17:24:52Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: No syntax highlighting!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  For Zoneminder, /dev/shm at 50% reduction and load is about 30% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at 6 Aug 2020.&lt;br /&gt;
&lt;br /&gt;
*Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
*VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
*GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
*Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
*VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD &amp;lt;ref&amp;gt;https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/ - Reddit post - NVIDIA GPU / ESX 6.5 / DELL T320 / PCI Pass-through crash on shutdown&amp;lt;/ref&amp;gt; on the host when restarting the VM with the GPU passed through to it. &lt;br /&gt;
&lt;br /&gt;
 # NVIDIA&lt;br /&gt;
 10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
Pass the GPU through to the host using the DirectPath I/O mechanism &amp;lt;ref&amp;gt;https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html - Using GPUs with Virtual Machines on vSphere – Part 2: VMDirectPath I/O&amp;lt;/ref&amp;gt; and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&lt;br /&gt;
&lt;br /&gt;
 # ubuntu-drivers devices&lt;br /&gt;
&lt;br /&gt;
Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&lt;br /&gt;
 # apt install nvidia-headless-440&lt;br /&gt;
&lt;br /&gt;
Run this to confirm it is working after rebooting:&lt;br /&gt;
 # nvidia-smi&lt;br /&gt;
&lt;br /&gt;
If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&lt;br /&gt;
 # apt install libnvidia-decode-440&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&lt;br /&gt;
 # ffmpeg -hwaccels&lt;br /&gt;
 ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
 ...&lt;br /&gt;
 Hardware acceleration methods:&lt;br /&gt;
 vdpau&lt;br /&gt;
 cuda&lt;br /&gt;
 vaapi&lt;br /&gt;
 drm&lt;br /&gt;
 opencl&lt;br /&gt;
 cuvid&lt;br /&gt;
&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&lt;br /&gt;
&lt;br /&gt;
 # ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16231</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16231"/>
		<updated>2020-08-06T17:22:20Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Initial dump from my doc wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using a GPU reduces the load on the CPUs and RAM.  For Zoneminder, /dev/shm at 50% reduction and load is about 30% what it was before deploying a NVidia GTX 1050.  &lt;br /&gt;
&lt;br /&gt;
==Nvidia GPU in VMware==&lt;br /&gt;
The versions shown here are essential because it did not work at all prior to some updates, crashed the host and the VM would not start.  The versions are the latest current at 6 Aug 2020.&lt;br /&gt;
&lt;br /&gt;
*Host: Dell T320, 1 socket Xeon E5-2407 2.2 GHz CPU, BIOS 2.9.0&lt;br /&gt;
*VMware: ESXI 6.5.0 patch level 16576891&lt;br /&gt;
*GPU: MSI Geforce GTX 1050 Ti (this card does not require any host BIOS settings changing, nor Memory Mapped I/O settings on the VM)&lt;br /&gt;
*Cameras: Four Reolink RLC-520.  Encoding at 2048 x 1536, 10 fps, High H.264 profile&lt;br /&gt;
*VM: Ubuntu 20.04 LTS server with no extras. Four vCPUs, 6 GB RAM, 30GB root and EFI, 300GB XFS for /var&lt;br /&gt;
&lt;br /&gt;
===ESXi host===&lt;br /&gt;
ssh into the host and edit /etc/vmware/passthru.map.  Change the word bridge to link.  This avoids a PSOD &amp;lt;ref&amp;gt;https://www.reddit.com/r/vmware/comments/f3xsgj/nvidia_gpu_esx_65_dell_t320_pci_passthrough_crash/ - Reddit post - NVIDIA GPU / ESX 6.5 / DELL T320 / PCI Pass-through crash on shutdown&amp;lt;/ref&amp;gt; on the host when restarting the VM with the GPU passed through to it. &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# NVIDIA&lt;br /&gt;
10de  ffff  link   false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Pass the GPU through to the host using the DirectPath I/O mechanism &amp;lt;ref&amp;gt;https://blogs.vmware.com/apps/2018/09/using-gpus-with-virtual-machines-on-vsphere-part-2-vmdirectpath-i-o.html - Using GPUs with Virtual Machines on vSphere – Part 2: VMDirectPath I/O&amp;lt;/ref&amp;gt; and reboot, then connect both devices to the VM.  There will be an audio card and the video card itself.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu VM===&lt;br /&gt;
The VM must use EFI so the install must use the Ubuntu server installer and not the minimal installer which will not work with efiboot.  VM type set to Ubuntu 64 bit.&lt;br /&gt;
&lt;br /&gt;
In Advanced settings for the VM, set the following flag to false. This setting disables informing the VM it is a VM.  This avoids a problem where the GPU fails to initialise properly:&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
hypervisor.cpuid.v0 = FALSE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Nvidia drivers and CUDA====&lt;br /&gt;
These instructions stay within the drivers etc provided by Ubuntu LTS. NVidia as upstream also provide drivers and these will be newer but may break something.&lt;br /&gt;
&lt;br /&gt;
Use this command to decide which driver to install:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# ubuntu-drivers devices&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Install the &amp;quot;headless&amp;quot; version of the driver and reboot:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# apt install nvidia-headless-440&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Run this to confirm it is working after rebooting:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# nvidia-smi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;If you just need decoding eg for Zoneminder - this provides &amp;#039;&amp;#039;libnvcuvid.so&amp;#039;&amp;#039;:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# apt install libnvidia-decode-440&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
Check ffmpeg has cuda support:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# ffmpeg -hwaccels&lt;br /&gt;
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers&lt;br /&gt;
...&lt;br /&gt;
Hardware acceleration methods:&lt;br /&gt;
vdpau&lt;br /&gt;
cuda&lt;br /&gt;
vaapi&lt;br /&gt;
drm&lt;br /&gt;
opencl&lt;br /&gt;
cuvid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There should be no error messages relating to libraries when you run something like this, which streams from a camera to /dev/null and uses CUDA:&amp;lt;syntaxhighlight lang=&amp;quot;shell-session&amp;quot;&amp;gt;&lt;br /&gt;
# ffmpeg -hwaccel cuda -i &amp;quot;rtmp://HOSTNAME_OR_IP/bcs/channel0_main.bcs?channel=0&amp;amp;stream=0&amp;amp;user=admin&amp;amp;password=PASSWORD&amp;quot;  -an -f rawvideo -y /dev/null&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;In another console, you could run nvidia-smi and see a process using the GPU.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16230</id>
		<title>GPU passthrough to virtual machines</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=GPU_passthrough_to_virtual_machines&amp;diff=16230"/>
		<updated>2020-08-06T17:20:22Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Created page with &amp;quot;{WIP}&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{WIP}&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Helpful_user_contributed_resources&amp;diff=16229</id>
		<title>Helpful user contributed resources</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Helpful_user_contributed_resources&amp;diff=16229"/>
		<updated>2020-08-06T17:19:16Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Installation Procedure */ add GPU in VMware page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==FAQ==&lt;br /&gt;
&lt;br /&gt;
[[FAQ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Installation Procedure==&lt;br /&gt;
&lt;br /&gt;
[http://zoneminder.readthedocs.org/en/latest/installationguide/index.html Official install guides ]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.zoneminder.com/Ubuntu  Ubuntu specific guides (currently more updated than official guides)]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.zoneminder.com/Debian  Debian specific guides]&lt;br /&gt;
&lt;br /&gt;
[https://wiki.zoneminder.com/Ubuntu#Common_Issues_with_Zoneminder_Installation_on_Ubuntu._Includes_upgrade_instructions.21 Common problems migrating from old versions to new versions ]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/pliablepixels/zmNinja/wiki/Configuring-ZoneMinder-with-API API installation/validation guide]-  (use the link above first, if you face problems, refer to this link)&lt;br /&gt;
&lt;br /&gt;
[https://wiki.zoneminder.com/Using_a_dedicated_Hard_Drive Using a dedicated Hard Drive] - Adding HDDs for more storage.&lt;br /&gt;
&lt;br /&gt;
[[Single Board Computers]] - Notes for ARM devices.&lt;br /&gt;
&lt;br /&gt;
[[GPU passthrough in VMWare]] - Notes on using GPUs with Zoneminder running in a virtual machine&lt;br /&gt;
&lt;br /&gt;
[[Email]] - Getting notifications when alerts occur.&lt;br /&gt;
&lt;br /&gt;
==Supported== &lt;br /&gt;
&lt;br /&gt;
[[Beginner hardware]]&lt;br /&gt;
&lt;br /&gt;
[[Supported distributions]]&lt;br /&gt;
&lt;br /&gt;
[[Hardware Compatibility List ]]&lt;br /&gt;
&lt;br /&gt;
[[MobileDevices]] - View ZM from your phone.&lt;br /&gt;
&lt;br /&gt;
==Third party==&lt;br /&gt;
[https://github.com/goruck/smart-zoneminder smart-zoneminder - Fast upload of ZoneMinder alarms to S3 where they are analyzed by Rekognition and made accessible via Alexa.]&lt;br /&gt;
&lt;br /&gt;
[[Flash&amp;#039;s IP Camera Database]]&lt;br /&gt;
&lt;br /&gt;
[[Utilities]]&lt;br /&gt;
&lt;br /&gt;
[http://foscam.us/forum/showing-secure-methods-using-php-to-display-your-ip-cameras-t8721.html Embed any IP Camera in website and webpages securely] - Free, many options. Includes many live examples.&lt;br /&gt;
&lt;br /&gt;
[[Standalone Zm Frontends]]&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/zonerama/ Zonerama] - Merges multiple  monitors into one and supports video creation. &lt;br /&gt;
&lt;br /&gt;
[[IpCamMontage]] Ip Camera Montage - remove the user viewing load from the server for IP Camera setups.&lt;br /&gt;
&lt;br /&gt;
[[Plugins]]&lt;br /&gt;
&lt;br /&gt;
[[Infrared Leds, Cameras, DC-DC converters etc]]&lt;br /&gt;
&lt;br /&gt;
[[Consultants]]&lt;br /&gt;
&lt;br /&gt;
[[Video Recorders running ZM]]&lt;br /&gt;
&lt;br /&gt;
[[External resources of information related to ZM]]&lt;br /&gt;
&lt;br /&gt;
==Community documentation==&lt;br /&gt;
&lt;br /&gt;
[[How To]] &lt;br /&gt;
&lt;br /&gt;
[[Miscellaneous helpful hints]]&lt;br /&gt;
&lt;br /&gt;
[[Hardware specific tips]]&lt;br /&gt;
&lt;br /&gt;
[[Various Learnings from getting Zomeminder 1.28.1 working well on Ubuntu Server 14.04]]&lt;br /&gt;
&lt;br /&gt;
[[Dummies Guide]]&lt;br /&gt;
&lt;br /&gt;
==CCTV Laws==&lt;br /&gt;
[[Area Specific Laws]]&lt;br /&gt;
&lt;br /&gt;
[http://www.library.ca.gov/CRB/97/05/ California Report on Public Video Surveillance]&lt;br /&gt;
&lt;br /&gt;
 &lt;/div&gt;</summary>
		<author><name>Gerdesj</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=14818</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=14818"/>
		<updated>2017-09-25T15:07:28Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Install Zoneminder 1.30.4 */ Clarified why /zm/ is added to PATH ZMS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Zoneminder 1.30.4 on Ubuntu 16.04/16.10/17.04 Server &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04/16.10/17.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 update&lt;br /&gt;
 apt upgrade&lt;br /&gt;
 apt 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;
&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;
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;
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 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 1.30.4===&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&lt;br /&gt;
&lt;br /&gt;
Update Sources&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install zoneminder&lt;br /&gt;
&lt;br /&gt;
Add the Apache user (www-data) to the video group&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;
 systemctl 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. &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;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 systemctl apache2 reload&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IMPORTANT FINAL STEP:  The default zoneminder installation assumes that the web interface runs from the root of the webserver but this installation runs from /zm/.  If you fail to make this change then you will have blank monitors.  Open Zoneminder in a web browser (http://server-ip/zm). Click on Options -&amp;gt; Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------------------------------------&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;
NOTE: This procedure is to upgrade to Mariadb before installing Zoneminder!&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 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;
Change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Make the following changes:&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;
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 install mysqltuner&lt;br /&gt;
&lt;br /&gt;
Continue installing Zoneminder: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.0_the_easy_way#Install_Zoneminder_1.30.0&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 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;
Change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Make the following changes:&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;
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;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 to download the file from:&lt;br /&gt;
&lt;br /&gt;
 https://drive.google.com/open?id=0BwH00-h4hi0LbEtzY0g2ZVFmc2M&lt;br /&gt;
&lt;br /&gt;
or view the file contents here:&lt;br /&gt;
&lt;br /&gt;
[[Shell script zm_install]]&lt;br /&gt;
&lt;br /&gt;
I have tested this on budgie-remix 16.04-1 desktop x64 and Ubuntu 16.04-1 server x64. This shell script should work on and Ubuntu 16.04 desktop (Mint, Lubuntu et. al.).&lt;br /&gt;
You do not have to have LAMP, Apache or MySQL installed to run this. The script will install everything Zoneminder needs to function and set up Zoneminder!&lt;br /&gt;
&lt;br /&gt;
WARNING: This script installs Mariadb Server and Client and will replace MySQL if it is installed!!!&lt;br /&gt;
&lt;br /&gt;
Copy the file, zm_install, to your home directory. &lt;br /&gt;
&lt;br /&gt;
Open a terminal and 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 till you get to adding the timezone to PHP then you will need to know how to operate Nano. As a help you can see how it is done in the procedure above.&lt;br /&gt;
&lt;br /&gt;
I did not include the fix for the API in this script but it is an edit to apache2.conf which is shown on above procedure.&lt;br /&gt;
&lt;br /&gt;
WARNING: This script installs Mariadb Server and Client and will replace MySQL if it is installed!!!&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;/div&gt;</summary>
		<author><name>Gerdesj</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=14817</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=14817"/>
		<updated>2017-09-25T14:15:21Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Install Zoneminder 1.30.4 */ use systemctl consistently&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Zoneminder 1.30.4 on Ubuntu 16.04/16.10/17.04 Server &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04/16.10/17.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 update&lt;br /&gt;
 apt upgrade&lt;br /&gt;
 apt 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;
&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;
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;
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 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 1.30.4===&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&lt;br /&gt;
&lt;br /&gt;
Update Sources&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install zoneminder&lt;br /&gt;
&lt;br /&gt;
Add the Apache user (www-data) to the video group&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;
 systemctl 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. &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;
Restart Apache&lt;br /&gt;
&lt;br /&gt;
 systemctl 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;
&lt;br /&gt;
---------------------------------------------------------------------------------------&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;
NOTE: This procedure is to upgrade to Mariadb before installing Zoneminder!&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 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;
Change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Make the following changes:&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;
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 install mysqltuner&lt;br /&gt;
&lt;br /&gt;
Continue installing Zoneminder: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.0_the_easy_way#Install_Zoneminder_1.30.0&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 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;
Change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Make the following changes:&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;
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;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 to download the file from:&lt;br /&gt;
&lt;br /&gt;
 https://drive.google.com/open?id=0BwH00-h4hi0LbEtzY0g2ZVFmc2M&lt;br /&gt;
&lt;br /&gt;
or view the file contents here:&lt;br /&gt;
&lt;br /&gt;
[[Shell script zm_install]]&lt;br /&gt;
&lt;br /&gt;
I have tested this on budgie-remix 16.04-1 desktop x64 and Ubuntu 16.04-1 server x64. This shell script should work on and Ubuntu 16.04 desktop (Mint, Lubuntu et. al.).&lt;br /&gt;
You do not have to have LAMP, Apache or MySQL installed to run this. The script will install everything Zoneminder needs to function and set up Zoneminder!&lt;br /&gt;
&lt;br /&gt;
WARNING: This script installs Mariadb Server and Client and will replace MySQL if it is installed!!!&lt;br /&gt;
&lt;br /&gt;
Copy the file, zm_install, to your home directory. &lt;br /&gt;
&lt;br /&gt;
Open a terminal and 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 till you get to adding the timezone to PHP then you will need to know how to operate Nano. As a help you can see how it is done in the procedure above.&lt;br /&gt;
&lt;br /&gt;
I did not include the fix for the API in this script but it is an edit to apache2.conf which is shown on above procedure.&lt;br /&gt;
&lt;br /&gt;
WARNING: This script installs Mariadb Server and Client and will replace MySQL if it is installed!!!&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;/div&gt;</summary>
		<author><name>Gerdesj</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=14816</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=14816"/>
		<updated>2017-09-25T14:07:37Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Install Zoneminder 1.30.4 */ adduser in this case adds a user to a group, not create a new user&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Zoneminder 1.30.4 on Ubuntu 16.04/16.10/17.04 Server &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 16.04/16.10/17.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 update&lt;br /&gt;
 apt upgrade&lt;br /&gt;
 apt 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;
&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;
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;
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 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 1.30.4===&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&lt;br /&gt;
&lt;br /&gt;
Update Sources&lt;br /&gt;
&lt;br /&gt;
 apt update&lt;br /&gt;
&lt;br /&gt;
Install Zoneminder&lt;br /&gt;
&lt;br /&gt;
 apt install zoneminder&lt;br /&gt;
&lt;br /&gt;
Add the Apache user (www-data) to the video group&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.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. &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;
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;
&lt;br /&gt;
---------------------------------------------------------------------------------------&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;
NOTE: This procedure is to upgrade to Mariadb before installing Zoneminder!&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 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;
Change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Make the following changes:&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;
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 install mysqltuner&lt;br /&gt;
&lt;br /&gt;
Continue installing Zoneminder: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.0_the_easy_way#Install_Zoneminder_1.30.0&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 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;
Change Mariadb settings:&lt;br /&gt;
&lt;br /&gt;
 nano /etc/mysql/my.cnf&lt;br /&gt;
&lt;br /&gt;
Make the following changes:&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;
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;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 to download the file from:&lt;br /&gt;
&lt;br /&gt;
 https://drive.google.com/open?id=0BwH00-h4hi0LbEtzY0g2ZVFmc2M&lt;br /&gt;
&lt;br /&gt;
or view the file contents here:&lt;br /&gt;
&lt;br /&gt;
[[Shell script zm_install]]&lt;br /&gt;
&lt;br /&gt;
I have tested this on budgie-remix 16.04-1 desktop x64 and Ubuntu 16.04-1 server x64. This shell script should work on and Ubuntu 16.04 desktop (Mint, Lubuntu et. al.).&lt;br /&gt;
You do not have to have LAMP, Apache or MySQL installed to run this. The script will install everything Zoneminder needs to function and set up Zoneminder!&lt;br /&gt;
&lt;br /&gt;
WARNING: This script installs Mariadb Server and Client and will replace MySQL if it is installed!!!&lt;br /&gt;
&lt;br /&gt;
Copy the file, zm_install, to your home directory. &lt;br /&gt;
&lt;br /&gt;
Open a terminal and 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 till you get to adding the timezone to PHP then you will need to know how to operate Nano. As a help you can see how it is done in the procedure above.&lt;br /&gt;
&lt;br /&gt;
I did not include the fix for the API in this script but it is an edit to apache2.conf which is shown on above procedure.&lt;br /&gt;
&lt;br /&gt;
WARNING: This script installs Mariadb Server and Client and will replace MySQL if it is installed!!!&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;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14111</id>
		<title>Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14111"/>
		<updated>2016-08-12T22:26:21Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: /* Control */ Control Script pulled to master - no need for it here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
-- PICCY --&lt;br /&gt;
&lt;br /&gt;
http://www.keekoonvision.com/ produce a series of IP cameras that are marketed as baby monitors and sold directly via outlets such as Amazon. They are low cost and feature pan and tilt.  This page was written after full testing of the KK002 model.  The other current models at time of writing (July 2016) are the KK001 and KK003 and are expected to work with the same settings.  &lt;br /&gt;
&lt;br /&gt;
=== Camera Features ===&lt;br /&gt;
Some pertinent features and things to know:&lt;br /&gt;
* 720p - RTSP, H264, 1M pixel &lt;br /&gt;
* Pan and tilt with six presets&lt;br /&gt;
* Two way audio (not tested)&lt;br /&gt;
* Wifi and ethernet (100Mbs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* IR night vision&lt;br /&gt;
* Three metre long power lead&lt;br /&gt;
* Indoor only&lt;br /&gt;
* Minimal but functional web interface &lt;br /&gt;
&lt;br /&gt;
=== Initial Installation ===&lt;br /&gt;
Recycle the Quick Start guide and throw away the mini CD.  Connect via ethernet cable to your network.  It will DHCP an IP address by default and the web interface is on port 80.  Default username is admin with no password.  To get to the settings, click on the &amp;quot;Non IE web browsers&amp;quot; link.  At the bottom right there is a gear shaped icon for &amp;quot;Setting&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Set an admin password and optionally setup additional users and passwords.  Optionally set ntp and for Zoneminder usage, go through the other settings disabling anything that might add load on the built in processor. &lt;br /&gt;
&lt;br /&gt;
If you want to use Wifi then browse to Network -&amp;gt; Wifi.  Select the correct SSID, click on connect and fill in the pre shared key.  Finally select the newly created &amp;quot;Station Profile&amp;quot; and select Activate.  A correctly activated profile will have a yellow tick on a green square icon next to it.  If you have a red square then most likely you have got the pre shared key wrong.&lt;br /&gt;
&lt;br /&gt;
== Zoneminder specifics ==&lt;br /&gt;
&lt;br /&gt;
=== Tested Versions ===&lt;br /&gt;
* Zoneminder 1.29 on Ubuntu 14.04 LTS &lt;br /&gt;
* Camera firmware 1.8.16.6 D (it arrived with the latest at the time of writing)  Software downloads: http://www.keekoonvision.com/download-details-a &lt;br /&gt;
&lt;br /&gt;
=== Monitor Settings ===&lt;br /&gt;
These are known good settings:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Source&lt;br /&gt;
!Parameter&lt;br /&gt;
!Setting&lt;br /&gt;
|-&lt;br /&gt;
|Remote Protocol&lt;br /&gt;
|RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Method&lt;br /&gt;
|RTP/RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Name&lt;br /&gt;
|admin:password@camera.example.co.uk&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Port&lt;br /&gt;
|554&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Path&lt;br /&gt;
|/rtsp_live0&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|1280&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|780&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Control ===&lt;br /&gt;
Until it is included in the released software, get the control script from here: [https://github.com/ZoneMinder/ZoneMinder/blob/master/scripts/ZoneMinder/lib/ZoneMinder/Control/Keekoon.pm Keekoon Control script from Zoneminder Github] and put it in say /usr/share/perl5/ZoneMinder/Control (Debian/Ubuntu)&lt;br /&gt;
&lt;br /&gt;
Read the comments in the script.&lt;br /&gt;
&lt;br /&gt;
[[Category:Network Cameras]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=User:Keekoon&amp;diff=14087</id>
		<title>User:Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=User:Keekoon&amp;diff=14087"/>
		<updated>2016-07-22T21:38:34Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Gerdesj moved page User:Keekoon to Keekoon: Err, forgot which space I was in.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Keekoon]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14086</id>
		<title>Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14086"/>
		<updated>2016-07-22T21:38:34Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Gerdesj moved page User:Keekoon to Keekoon: Err, forgot which space I was in.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
-- PICCY --&lt;br /&gt;
&lt;br /&gt;
http://www.keekoonvision.com/ produce a series of IP cameras that are marketed as baby monitors and sold directly via outlets such as Amazon. They are low cost and feature pan and tilt.  This page was written after full testing of the KK002 model.  The other current models at time of writing (July 2016) are the KK001 and KK003 and are expected to work with the same settings.  &lt;br /&gt;
&lt;br /&gt;
=== Camera Features ===&lt;br /&gt;
Some pertinent features and things to know:&lt;br /&gt;
* 720p - RTSP, H264, 1M pixel &lt;br /&gt;
* Pan and tilt with six presets&lt;br /&gt;
* Two way audio (not tested)&lt;br /&gt;
* Wifi and ethernet (100Mbs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* IR night vision&lt;br /&gt;
* Three metre long power lead&lt;br /&gt;
* Indoor only&lt;br /&gt;
* Minimal but functional web interface &lt;br /&gt;
&lt;br /&gt;
=== Initial Installation ===&lt;br /&gt;
Recycle the Quick Start guide and throw away the mini CD.  Connect via ethernet cable to your network.  It will DHCP an IP address by default and the web interface is on port 80.  Default username is admin with no password.  To get to the settings, click on the &amp;quot;Non IE web browsers&amp;quot; link.  At the bottom right there is a gear shaped icon for &amp;quot;Setting&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Set an admin password and optionally setup additional users and passwords.  Optionally set ntp and for Zoneminder usage, go through the other settings disabling anything that might add load on the built in processor. &lt;br /&gt;
&lt;br /&gt;
If you want to use Wifi then browse to Network -&amp;gt; Wifi.  Select the correct SSID, click on connect and fill in the pre shared key.  Finally select the newly created &amp;quot;Station Profile&amp;quot; and select Activate.  A correctly activated profile will have a yellow tick on a green square icon next to it.  If you have a red square then most likely you have got the pre shared key wrong.&lt;br /&gt;
&lt;br /&gt;
== Zoneminder specifics ==&lt;br /&gt;
&lt;br /&gt;
=== Tested Versions ===&lt;br /&gt;
* Zoneminder 1.29 on Ubuntu 14.04 LTS &lt;br /&gt;
* Camera firmware 1.8.16.6 D (it arrived with the latest at the time of writing)  Software downloads: http://www.keekoonvision.com/download-details-a &lt;br /&gt;
&lt;br /&gt;
=== Monitor Settings ===&lt;br /&gt;
These are known good settings:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Source&lt;br /&gt;
!Parameter&lt;br /&gt;
!Setting&lt;br /&gt;
|-&lt;br /&gt;
|Remote Protocol&lt;br /&gt;
|RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Method&lt;br /&gt;
|RTP/RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Name&lt;br /&gt;
|admin:password@camera.example.co.uk&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Port&lt;br /&gt;
|554&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Path&lt;br /&gt;
|/rtsp_live0&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|1280&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|780&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Control ===&lt;br /&gt;
Shortly this script will be pending inclusion into the distro but is reproduced here in case it doesn&amp;#039;t make it or you have an older version of ZM.  Instructions for use are in the comments under Usage.  You should not have to change the script itself in any way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ==========================================================================&lt;br /&gt;
#&lt;br /&gt;
# ZoneMinder Keekoon Control Protocol Module&lt;br /&gt;
# This code was mostly derived from other ZM Control modules&lt;br /&gt;
#&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;
# Tested: KK002 (22 July 2016)&lt;br /&gt;
#&lt;br /&gt;
# Usage:&lt;br /&gt;
# ======&lt;br /&gt;
#&lt;br /&gt;
# Copy this file to say /usr/share/perl5/ZoneMinder/Control (Debian/Ubuntu)&lt;br /&gt;
#&lt;br /&gt;
# Create a new Control Capabilities:&lt;br /&gt;
#   Main:    Name Keekoon, Type = Remote, Protocol = Keekoon&lt;br /&gt;
#   Move:    Can Move, Can Move Diagonally, Can Move Continous&lt;br /&gt;
#   Pan:     Can Pan&lt;br /&gt;
#   Tilt:    Can Tilt&lt;br /&gt;
#   Presets: Has Presets, Num Presets = 6, Can Set Presets&lt;br /&gt;
#&lt;br /&gt;
# Set the ControlAddress in the camera definition, use the format:&lt;br /&gt;
#   http(s)://username:password@address:port&lt;br /&gt;
#&lt;br /&gt;
#   eg : http://admin:adminpass@10.10.10.1:80&lt;br /&gt;
#   or : https://admin:password@mycamera.example.co.uk:80&lt;br /&gt;
#&lt;br /&gt;
#   Return Location to Preset 1&lt;br /&gt;
#   Auto Stop Timeout = 0.5      is a good starting point&lt;br /&gt;
#&lt;br /&gt;
# ===========================================================================&lt;br /&gt;
# Problems: Enable debug and watch /tmp/zm_debug.log.&amp;lt;int&amp;gt; The&lt;br /&gt;
#           correct debug log can be found by date stamp.&lt;br /&gt;
#           Enable/disable the Source for the camera in the web GUI&lt;br /&gt;
#           each time you edit this script.  If the pid doesn&amp;#039;t&lt;br /&gt;
#           change then you have not restarted it.    &lt;br /&gt;
# Errors like this:&lt;br /&gt;
# [Error in response to Request:&amp;#039;400 URL must be absolute&amp;#039;]&lt;br /&gt;
# means that you have not specified all the parts in ControlAddress or the&lt;br /&gt;
# Regex has failed to parse it correctly&lt;br /&gt;
#&lt;br /&gt;
# =========================================================================&lt;br /&gt;
# Notes:  &lt;br /&gt;
# Example command from docs, at http://www.keekoonvision.com/for-developers-a: &lt;br /&gt;
# Up: http://camera_ip:web_port/decoder_control.cgi?command=0&amp;amp;user=username&amp;amp;pwd=password&lt;br /&gt;
# However the camera actually uses basic auth and not user= etc&lt;br /&gt;
#&lt;br /&gt;
# Test URLs with something like this&lt;br /&gt;
# curl -XGET -u user:pass &amp;quot;http://cam.example.co.uk:80/decoder_control.cgi?command=1&lt;br /&gt;
#&lt;br /&gt;
# These cameras have a default admin user but can have six more defined&lt;br /&gt;
# with membership of three groups&lt;br /&gt;
# https is not directly supported but could be via say HA Proxy, so that&lt;br /&gt;
# is included rather than hardstrapping http://&lt;br /&gt;
# ==========================================================================&lt;br /&gt;
&lt;br /&gt;
package ZoneMinder::Control::Keekoon;&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::Control;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw(ZoneMinder::Control);&lt;br /&gt;
&lt;br /&gt;
use ZoneMinder::Logger qw(:all);&lt;br /&gt;
use ZoneMinder::Config qw(:all);&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( ) || 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;
&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;
&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;.ZoneMinder::Base::ZM_VERSION );&lt;br /&gt;
&lt;br /&gt;
    $self-&amp;gt;{state} = &amp;#039;open&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
    Info( &amp;quot;Open&amp;quot; );&lt;br /&gt;
&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;
&lt;br /&gt;
    my ( $PROTOCOL, $USER, $PASS, $ADDR, $PORT ) &lt;br /&gt;
        = $self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress} =~ /^(https?):\/\/(.*):(.*)@(.*):(\d+)$/;&lt;br /&gt;
    my $URL = $PROTOCOL.&amp;quot;://&amp;quot;.$ADDR.&amp;quot;:&amp;quot;.$PORT.&amp;quot;/decoder_control.cgi?command=&amp;quot;.$cmd;&lt;br /&gt;
&lt;br /&gt;
    Debug( &amp;quot;ControlAddress from camera Control setting:&amp;quot;.$self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress} );&lt;br /&gt;
    Debug( &amp;quot;URL parsed from ControlAddress:&amp;quot;.$URL);&lt;br /&gt;
&lt;br /&gt;
    my $req = HTTP::Request-&amp;gt;new( GET=&amp;gt;$URL );&lt;br /&gt;
    &lt;br /&gt;
    # Do Basic Auth&lt;br /&gt;
    $req-&amp;gt;authorization_basic($USER, $PASS);&lt;br /&gt;
    &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 in response to Request:&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;
# Set autoStop timeout on the Control tab for the camera&lt;br /&gt;
sub autoStop&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $stop_command = shift;&lt;br /&gt;
    my $autostop = shift;&lt;br /&gt;
    &lt;br /&gt;
    if( $stop_command &amp;amp;&amp;amp; $autostop)&lt;br /&gt;
    {&lt;br /&gt;
        Debug( &amp;quot;Auto Stop&amp;quot; );&lt;br /&gt;
        usleep( $autostop );&lt;br /&gt;
        my $cmd = $stop_command;&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUp&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;0&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Up&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDown&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;2&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;3&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Down&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;4&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;5&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;6&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;7&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUpRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Up Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConUp( );&lt;br /&gt;
    $self-&amp;gt;moveConRight( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDownRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Down Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConDown( );&lt;br /&gt;
    $self-&amp;gt;moveConRight( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUpLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Up Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConUp( );&lt;br /&gt;
    $self-&amp;gt;moveConLeft( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDownLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Down Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConDown( );&lt;br /&gt;
    $self-&amp;gt;moveConLeft( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# SET: 30,32,34,36,38,40 for presets 1-6&lt;br /&gt;
sub presetSet&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $params = shift;&lt;br /&gt;
    my $preset = $self-&amp;gt;getParam( $params, &amp;#039;preset&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
    Debug( &amp;quot;Set Preset No: &amp;quot; . $preset );&lt;br /&gt;
&lt;br /&gt;
    if (( $preset &amp;gt;= 1 ) &amp;amp;&amp;amp; ( $preset &amp;lt;= 6 )) {&lt;br /&gt;
        my $cmd = (($preset*2) + 28);&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
        Debug( &amp;quot;Set preset cmd: &amp;quot; . $cmd );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# GOTO: 31,33,35,37,39,41 for presets 1-6&lt;br /&gt;
sub presetGoto&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $params = shift;&lt;br /&gt;
    my $preset = $self-&amp;gt;getParam( $params, &amp;#039;preset&amp;#039; );&lt;br /&gt;
    Debug( &amp;quot;Goto Preset No: &amp;quot; . $preset );&lt;br /&gt;
&lt;br /&gt;
    if (( $preset &amp;gt;= 1 ) &amp;amp;&amp;amp; ( $preset &amp;lt;= 6 )) {&lt;br /&gt;
        my $cmd = (($preset*2) + 29);&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
        Debug( &amp;quot;Goto Preset cmd: &amp;quot; . $cmd );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Network Cameras]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=User:Gerdesj/Keekoon&amp;diff=14085</id>
		<title>User:Gerdesj/Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=User:Gerdesj/Keekoon&amp;diff=14085"/>
		<updated>2016-07-22T21:37:28Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Gerdesj moved page User:Gerdesj/Keekoon to User:Keekoon: Move from UP/subpage to &amp;quot;live&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[User:Keekoon]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14084</id>
		<title>Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14084"/>
		<updated>2016-07-22T21:37:28Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Gerdesj moved page User:Gerdesj/Keekoon to User:Keekoon: Move from UP/subpage to &amp;quot;live&amp;quot;.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
-- PICCY --&lt;br /&gt;
&lt;br /&gt;
http://www.keekoonvision.com/ produce a series of IP cameras that are marketed as baby monitors and sold directly via outlets such as Amazon. They are low cost and feature pan and tilt.  This page was written after full testing of the KK002 model.  The other current models at time of writing (July 2016) are the KK001 and KK003 and are expected to work with the same settings.  &lt;br /&gt;
&lt;br /&gt;
=== Camera Features ===&lt;br /&gt;
Some pertinent features and things to know:&lt;br /&gt;
* 720p - RTSP, H264, 1M pixel &lt;br /&gt;
* Pan and tilt with six presets&lt;br /&gt;
* Two way audio (not tested)&lt;br /&gt;
* Wifi and ethernet (100Mbs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* IR night vision&lt;br /&gt;
* Three metre long power lead&lt;br /&gt;
* Indoor only&lt;br /&gt;
* Minimal but functional web interface &lt;br /&gt;
&lt;br /&gt;
=== Initial Installation ===&lt;br /&gt;
Recycle the Quick Start guide and throw away the mini CD.  Connect via ethernet cable to your network.  It will DHCP an IP address by default and the web interface is on port 80.  Default username is admin with no password.  To get to the settings, click on the &amp;quot;Non IE web browsers&amp;quot; link.  At the bottom right there is a gear shaped icon for &amp;quot;Setting&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Set an admin password and optionally setup additional users and passwords.  Optionally set ntp and for Zoneminder usage, go through the other settings disabling anything that might add load on the built in processor. &lt;br /&gt;
&lt;br /&gt;
If you want to use Wifi then browse to Network -&amp;gt; Wifi.  Select the correct SSID, click on connect and fill in the pre shared key.  Finally select the newly created &amp;quot;Station Profile&amp;quot; and select Activate.  A correctly activated profile will have a yellow tick on a green square icon next to it.  If you have a red square then most likely you have got the pre shared key wrong.&lt;br /&gt;
&lt;br /&gt;
== Zoneminder specifics ==&lt;br /&gt;
&lt;br /&gt;
=== Tested Versions ===&lt;br /&gt;
* Zoneminder 1.29 on Ubuntu 14.04 LTS &lt;br /&gt;
* Camera firmware 1.8.16.6 D (it arrived with the latest at the time of writing)  Software downloads: http://www.keekoonvision.com/download-details-a &lt;br /&gt;
&lt;br /&gt;
=== Monitor Settings ===&lt;br /&gt;
These are known good settings:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Source&lt;br /&gt;
!Parameter&lt;br /&gt;
!Setting&lt;br /&gt;
|-&lt;br /&gt;
|Remote Protocol&lt;br /&gt;
|RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Method&lt;br /&gt;
|RTP/RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Name&lt;br /&gt;
|admin:password@camera.example.co.uk&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Port&lt;br /&gt;
|554&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Path&lt;br /&gt;
|/rtsp_live0&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|1280&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|780&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Control ===&lt;br /&gt;
Shortly this script will be pending inclusion into the distro but is reproduced here in case it doesn&amp;#039;t make it or you have an older version of ZM.  Instructions for use are in the comments under Usage.  You should not have to change the script itself in any way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ==========================================================================&lt;br /&gt;
#&lt;br /&gt;
# ZoneMinder Keekoon Control Protocol Module&lt;br /&gt;
# This code was mostly derived from other ZM Control modules&lt;br /&gt;
#&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;
# Tested: KK002 (22 July 2016)&lt;br /&gt;
#&lt;br /&gt;
# Usage:&lt;br /&gt;
# ======&lt;br /&gt;
#&lt;br /&gt;
# Copy this file to say /usr/share/perl5/ZoneMinder/Control (Debian/Ubuntu)&lt;br /&gt;
#&lt;br /&gt;
# Create a new Control Capabilities:&lt;br /&gt;
#   Main:    Name Keekoon, Type = Remote, Protocol = Keekoon&lt;br /&gt;
#   Move:    Can Move, Can Move Diagonally, Can Move Continous&lt;br /&gt;
#   Pan:     Can Pan&lt;br /&gt;
#   Tilt:    Can Tilt&lt;br /&gt;
#   Presets: Has Presets, Num Presets = 6, Can Set Presets&lt;br /&gt;
#&lt;br /&gt;
# Set the ControlAddress in the camera definition, use the format:&lt;br /&gt;
#   http(s)://username:password@address:port&lt;br /&gt;
#&lt;br /&gt;
#   eg : http://admin:adminpass@10.10.10.1:80&lt;br /&gt;
#   or : https://admin:password@mycamera.example.co.uk:80&lt;br /&gt;
#&lt;br /&gt;
#   Return Location to Preset 1&lt;br /&gt;
#   Auto Stop Timeout = 0.5      is a good starting point&lt;br /&gt;
#&lt;br /&gt;
# ===========================================================================&lt;br /&gt;
# Problems: Enable debug and watch /tmp/zm_debug.log.&amp;lt;int&amp;gt; The&lt;br /&gt;
#           correct debug log can be found by date stamp.&lt;br /&gt;
#           Enable/disable the Source for the camera in the web GUI&lt;br /&gt;
#           each time you edit this script.  If the pid doesn&amp;#039;t&lt;br /&gt;
#           change then you have not restarted it.    &lt;br /&gt;
# Errors like this:&lt;br /&gt;
# [Error in response to Request:&amp;#039;400 URL must be absolute&amp;#039;]&lt;br /&gt;
# means that you have not specified all the parts in ControlAddress or the&lt;br /&gt;
# Regex has failed to parse it correctly&lt;br /&gt;
#&lt;br /&gt;
# =========================================================================&lt;br /&gt;
# Notes:  &lt;br /&gt;
# Example command from docs, at http://www.keekoonvision.com/for-developers-a: &lt;br /&gt;
# Up: http://camera_ip:web_port/decoder_control.cgi?command=0&amp;amp;user=username&amp;amp;pwd=password&lt;br /&gt;
# However the camera actually uses basic auth and not user= etc&lt;br /&gt;
#&lt;br /&gt;
# Test URLs with something like this&lt;br /&gt;
# curl -XGET -u user:pass &amp;quot;http://cam.example.co.uk:80/decoder_control.cgi?command=1&lt;br /&gt;
#&lt;br /&gt;
# These cameras have a default admin user but can have six more defined&lt;br /&gt;
# with membership of three groups&lt;br /&gt;
# https is not directly supported but could be via say HA Proxy, so that&lt;br /&gt;
# is included rather than hardstrapping http://&lt;br /&gt;
# ==========================================================================&lt;br /&gt;
&lt;br /&gt;
package ZoneMinder::Control::Keekoon;&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::Control;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw(ZoneMinder::Control);&lt;br /&gt;
&lt;br /&gt;
use ZoneMinder::Logger qw(:all);&lt;br /&gt;
use ZoneMinder::Config qw(:all);&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( ) || 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;
&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;
&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;.ZoneMinder::Base::ZM_VERSION );&lt;br /&gt;
&lt;br /&gt;
    $self-&amp;gt;{state} = &amp;#039;open&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
    Info( &amp;quot;Open&amp;quot; );&lt;br /&gt;
&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;
&lt;br /&gt;
    my ( $PROTOCOL, $USER, $PASS, $ADDR, $PORT ) &lt;br /&gt;
        = $self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress} =~ /^(https?):\/\/(.*):(.*)@(.*):(\d+)$/;&lt;br /&gt;
    my $URL = $PROTOCOL.&amp;quot;://&amp;quot;.$ADDR.&amp;quot;:&amp;quot;.$PORT.&amp;quot;/decoder_control.cgi?command=&amp;quot;.$cmd;&lt;br /&gt;
&lt;br /&gt;
    Debug( &amp;quot;ControlAddress from camera Control setting:&amp;quot;.$self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress} );&lt;br /&gt;
    Debug( &amp;quot;URL parsed from ControlAddress:&amp;quot;.$URL);&lt;br /&gt;
&lt;br /&gt;
    my $req = HTTP::Request-&amp;gt;new( GET=&amp;gt;$URL );&lt;br /&gt;
    &lt;br /&gt;
    # Do Basic Auth&lt;br /&gt;
    $req-&amp;gt;authorization_basic($USER, $PASS);&lt;br /&gt;
    &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 in response to Request:&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;
# Set autoStop timeout on the Control tab for the camera&lt;br /&gt;
sub autoStop&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $stop_command = shift;&lt;br /&gt;
    my $autostop = shift;&lt;br /&gt;
    &lt;br /&gt;
    if( $stop_command &amp;amp;&amp;amp; $autostop)&lt;br /&gt;
    {&lt;br /&gt;
        Debug( &amp;quot;Auto Stop&amp;quot; );&lt;br /&gt;
        usleep( $autostop );&lt;br /&gt;
        my $cmd = $stop_command;&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUp&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;0&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Up&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDown&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;2&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;3&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Down&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;4&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;5&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;6&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;7&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUpRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Up Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConUp( );&lt;br /&gt;
    $self-&amp;gt;moveConRight( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDownRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Down Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConDown( );&lt;br /&gt;
    $self-&amp;gt;moveConRight( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUpLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Up Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConUp( );&lt;br /&gt;
    $self-&amp;gt;moveConLeft( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDownLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Down Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConDown( );&lt;br /&gt;
    $self-&amp;gt;moveConLeft( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# SET: 30,32,34,36,38,40 for presets 1-6&lt;br /&gt;
sub presetSet&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $params = shift;&lt;br /&gt;
    my $preset = $self-&amp;gt;getParam( $params, &amp;#039;preset&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
    Debug( &amp;quot;Set Preset No: &amp;quot; . $preset );&lt;br /&gt;
&lt;br /&gt;
    if (( $preset &amp;gt;= 1 ) &amp;amp;&amp;amp; ( $preset &amp;lt;= 6 )) {&lt;br /&gt;
        my $cmd = (($preset*2) + 28);&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
        Debug( &amp;quot;Set preset cmd: &amp;quot; . $cmd );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# GOTO: 31,33,35,37,39,41 for presets 1-6&lt;br /&gt;
sub presetGoto&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $params = shift;&lt;br /&gt;
    my $preset = $self-&amp;gt;getParam( $params, &amp;#039;preset&amp;#039; );&lt;br /&gt;
    Debug( &amp;quot;Goto Preset No: &amp;quot; . $preset );&lt;br /&gt;
&lt;br /&gt;
    if (( $preset &amp;gt;= 1 ) &amp;amp;&amp;amp; ( $preset &amp;lt;= 6 )) {&lt;br /&gt;
        my $cmd = (($preset*2) + 29);&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
        Debug( &amp;quot;Goto Preset cmd: &amp;quot; . $cmd );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Network Cameras]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Hardware_Compatibility_List&amp;diff=14083</id>
		<title>Hardware Compatibility List</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Hardware_Compatibility_List&amp;diff=14083"/>
		<updated>2016-07-22T21:35:54Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Add Keekoon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Zoneminder will work with almost any capture card that is supported by the linux kernel.  You may find additional details about supported hardware in the part of the forums.  Also if you find something in the forums that is  missing from the wiki ADD IT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Capture Cards ==&lt;br /&gt;
&lt;br /&gt;
[[Anykeeper]] &lt;br /&gt;
&lt;br /&gt;
[[Avermedia]]&lt;br /&gt;
&lt;br /&gt;
[[Camsecure PCI Express video capture]]&lt;br /&gt;
&lt;br /&gt;
[[Digiflower]]&lt;br /&gt;
&lt;br /&gt;
[[Geovision GV250 - bt878a chip]]&lt;br /&gt;
&lt;br /&gt;
[[Grandtec Grand X Guard]] &lt;br /&gt;
&lt;br /&gt;
[[Hauppauge]]&lt;br /&gt;
&lt;br /&gt;
[[Howell-Tempest  VC 878B-Q]]&lt;br /&gt;
&lt;br /&gt;
[[Ituner Spectra 8]]&lt;br /&gt;
&lt;br /&gt;
[[Kodicom 4400r]]&lt;br /&gt;
&lt;br /&gt;
[[Kodicom 8800]]&lt;br /&gt;
&lt;br /&gt;
[[Tungson TE-8008]]&lt;br /&gt;
&lt;br /&gt;
Leadtek WinFast VC 100 - the cheapest bt878 model with no tuner on it, just Com/Svideo in.&lt;br /&gt;
&lt;br /&gt;
[[LinkDelight CCTV H.264 4CH DVR Card]]&lt;br /&gt;
&lt;br /&gt;
[[Linux Media Labs LMLBT44]] &lt;br /&gt;
&lt;br /&gt;
[[Osprey 100]]&lt;br /&gt;
&lt;br /&gt;
[[Provideo PV- series (Bluecherry)]] &lt;br /&gt;
[[ Bluecherry - BC-H16480A]] &lt;br /&gt;
[[TView 95/99]]&lt;br /&gt;
&lt;br /&gt;
[[UDP Technology NCP3200v2]]&lt;br /&gt;
&lt;br /&gt;
[[Videocards with Philips saa7134 chipset]]&lt;br /&gt;
&lt;br /&gt;
[[WinFast TV2000 XP]]&lt;br /&gt;
&lt;br /&gt;
[[Rapid OS]]&lt;br /&gt;
&lt;br /&gt;
[[KesCom PG104]]&lt;br /&gt;
&lt;br /&gt;
[[IEI Technology Corp. IVC-268G-R20]]&lt;br /&gt;
&lt;br /&gt;
== bt8x8 Cards ==&lt;br /&gt;
A note on the bt8x8-based TV-tuner cards: these usually have beside the tuner input, also a Composite and an S-Video input. You can hook up 2 analog cameras to these, and access from ZoneMinder both of them as individual cameras, at max 15Fps. You don&amp;#039;t need two separate TV cards for two cameras!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Pico2000]] - 4 port card, one chip bt878, around 2 fps when using all channels&lt;br /&gt;
&lt;br /&gt;
[[Bt878_4chip_8inputs]] -4 chips bt878, 8 inputs, around 5 fps when using 2 inputs per chip&lt;br /&gt;
&lt;br /&gt;
[[:Image:Karta.jpg| bt878 8 chip 8 input]] - This card is supplied with D-sub to 8 BNC connector and uses the bt878 chip for each input allowing full frame rates and quality. See [[Kodicom 8800]] for more information.&lt;br /&gt;
&lt;br /&gt;
Geovision GV250 bt878a single chip 4 inputs - This capture Card is supplied with 4 video inputs but with NO audio channel&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Most other BTTV (bt878, bt848) cards, see /usr/src/linux/Documentation/video4linux/bttv/CARDLIST on your system for a list of some of them.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Analog Cameras ==&lt;br /&gt;
&lt;br /&gt;
Any regular composite or S-video camera connected via a supported capture card.  Some analog cameras feature camera control - ZM supports several of these camera&amp;#039;s Pan/Tilt/Zoom functions via serial port control, as well as camera Presets, Focus, Iris, etc.&lt;br /&gt;
*[[PicturetelControlScript | PictureTel PTZ2N]].&lt;br /&gt;
&lt;br /&gt;
== Network Cameras ==&lt;br /&gt;
For Network Cams to work they need to be able to stream MJPEG without the requirement of activex controls. If you see the requirement for the camera calls for IE then there is a good chance it may not work. The other option is to grab JPEG images if the camera supports that option which will work but at a lower frame rate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any network camera that allows access to single JPEG image grabs or &amp;#039;&amp;#039;&amp;#039;some but not all&amp;#039;&amp;#039;&amp;#039; multi-part JPEG feeds.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Full Compatibility &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* [[7Links]](TM Trade Mark)&lt;br /&gt;
&lt;br /&gt;
* [[A-mtk]]&lt;br /&gt;
&lt;br /&gt;
* [[Abus]]  some&lt;br /&gt;
&lt;br /&gt;
* [[Airlink 101]] some &lt;br /&gt;
&lt;br /&gt;
* [[AirLive AirCam OD325HD]]&lt;br /&gt;
&lt;br /&gt;
* [[Amcrest QCam]]&lt;br /&gt;
&lt;br /&gt;
* [[Amovision AM-Q630M]]&lt;br /&gt;
&lt;br /&gt;
* [[Android]]&lt;br /&gt;
&lt;br /&gt;
* [[Anran VGB101-IP]]&lt;br /&gt;
&lt;br /&gt;
* [[Apexis]] most if not all (only tested some)&lt;br /&gt;
&lt;br /&gt;
* [[ArecontVision]] (AV3130M, probably other too)&lt;br /&gt;
&lt;br /&gt;
* [[Astak Mole]] Some&lt;br /&gt;
&lt;br /&gt;
* [[Axis]] All&lt;br /&gt;
&lt;br /&gt;
* [[Brickcom]] These have been tested&lt;br /&gt;
&lt;br /&gt;
* [[B-QTECH]] H.264 Camera&lt;br /&gt;
&lt;br /&gt;
* [[BSTI]] Some&lt;br /&gt;
&lt;br /&gt;
* [[Cisco]] some&lt;br /&gt;
&lt;br /&gt;
* [[Dahua]] (IPC-HDB3200C, probably others)&lt;br /&gt;
&lt;br /&gt;
* [[DBPower]] (H.264 Model, possibly others)&lt;br /&gt;
&lt;br /&gt;
* [[D-Link]] Most&lt;br /&gt;
&lt;br /&gt;
* [[EasyN]] (Mini Speed Dome 1BF)&lt;br /&gt;
&lt;br /&gt;
* [[Edimax]] only tested some&lt;br /&gt;
&lt;br /&gt;
* [[Foscam]] (FI8908W, FI8904W, possibly others)&lt;br /&gt;
&lt;br /&gt;
* [[Gadspot]] Most&lt;br /&gt;
&lt;br /&gt;
* [[Generic]] Only tested one &lt;br /&gt;
&lt;br /&gt;
* [[Geovision]] (GV-FE420, possibly others)&lt;br /&gt;
&lt;br /&gt;
* [[Grandstream]] Grandstream (GXV-3672-FHD &amp;amp; GXV-3672-FHD-36 &amp;amp; GXV3611_HD tested)&lt;br /&gt;
&lt;br /&gt;
* [[Hikvision]] Some&lt;br /&gt;
&lt;br /&gt;
* [[hootoo]] Some&lt;br /&gt;
&lt;br /&gt;
* [[Iguard]] IP390E&lt;br /&gt;
&lt;br /&gt;
* [[Instar]] (IN-2905, possibly others)&lt;br /&gt;
&lt;br /&gt;
* [[InternetEye]] M6840&lt;br /&gt;
&lt;br /&gt;
* [[Keekoon]] KK002 (KK001 and 3 are probably the same)&lt;br /&gt;
&lt;br /&gt;
* [[Level One]] some&lt;br /&gt;
&lt;br /&gt;
* [[Linksys]] WVC-210 / WVC2300 / PVC2300 / WVC54GC&lt;br /&gt;
&lt;br /&gt;
* [[Loftek]] Sentinel PTZ&lt;br /&gt;
&lt;br /&gt;
* [[Maygion]] (IP-603, IP-604, possibly others)&lt;br /&gt;
&lt;br /&gt;
* [[Messoa]] (NCR870, probably others)&lt;br /&gt;
&lt;br /&gt;
* [[Netcat]] IP Cameras&lt;br /&gt;
&lt;br /&gt;
* [[Pelco]] IP Cameras&lt;br /&gt;
&lt;br /&gt;
* [[Rimax]] Some&lt;br /&gt;
&lt;br /&gt;
* [[Rovio]]&lt;br /&gt;
&lt;br /&gt;
* [[Sony]] Most&lt;br /&gt;
&lt;br /&gt;
* [[TP-LINK]] Some&lt;br /&gt;
&lt;br /&gt;
* [[Trendnet]] Most&lt;br /&gt;
&lt;br /&gt;
* [[Vstar T7833WIP HD Dome Network Camera]]&lt;br /&gt;
&lt;br /&gt;
* [[Wanscam]] FR4020A2 (Foscam clone)&lt;br /&gt;
&lt;br /&gt;
* [[x-vision]] Xvision cameras by y3k (some)&lt;br /&gt;
&lt;br /&gt;
* [[Y-Cam]] (Sharx Ip) Most&lt;br /&gt;
&lt;br /&gt;
* [[Zavio]] Some&lt;br /&gt;
&lt;br /&gt;
* [[Zecumate]] JPT3815W&lt;br /&gt;
&lt;br /&gt;
* [[ZoneWay ZW-NC863M-P Megapixel IP]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Remote systems, themselves running zoneminder, can be accessed as cameras using the Remote Path of &amp;#039;&amp;#039;&amp;#039;/cgi-bin/nph-zms?mode=single&amp;amp;monitor=1&amp;amp;scale=100&amp;amp;maxfps=5&amp;amp;buffer=1000&amp;#039;&amp;#039;&amp;#039; - where the monitor number is the correct camera on the remote system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Single Jpeg Only&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* [[Airlink 101]] some&lt;br /&gt;
&lt;br /&gt;
* [[JVC]] some&lt;br /&gt;
&lt;br /&gt;
* [[Panasonic]] some&lt;br /&gt;
&lt;br /&gt;
* [[PLANET]] some   &lt;br /&gt;
&lt;br /&gt;
*[[Toshiba]] some&lt;br /&gt;
&lt;br /&gt;
* [[Veo Observer IP NetCam]] most&lt;br /&gt;
&lt;br /&gt;
*[[Vivotek]] All&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mpeg(ver1.24.0 and up)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*[[ABS_MegaCam]]&lt;br /&gt;
&lt;br /&gt;
* [[Axis]] All&lt;br /&gt;
&lt;br /&gt;
* [[ ACTi]] All&lt;br /&gt;
&lt;br /&gt;
*[[Vivotek]] Most&lt;br /&gt;
&lt;br /&gt;
*[[Logitech 700 series]] some&lt;br /&gt;
&lt;br /&gt;
*[[Ubiqiti]] some&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compatible with modifications&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*[[Aviosys]] some&lt;br /&gt;
&lt;br /&gt;
* [[Mobotix]]  all  &lt;br /&gt;
&lt;br /&gt;
* [[Conceptronic]]  some&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compatible with problems&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
* [[Compro]] IP70. MPEG4 only, some reliability issues and general poor firmware quality.&lt;br /&gt;
&lt;br /&gt;
* [[Grandtec]] [[Grandtec_WLAN_Camera|WLAN Camera]] WiFi or III - acceptable indoor quality, no infrared-filter (better nightvision) cheap!&lt;br /&gt;
&lt;br /&gt;
* [[Intellinet]]  IPCamera with the new firmware.&lt;br /&gt;
&lt;br /&gt;
* Old Intellinet IPCamera (model MWNC-100) with this (http://www.zoneminder.com/forums/viewtopic.php?t=7500) protocol adapter. &lt;br /&gt;
&lt;br /&gt;
* OvisLink AirLive WL-5400CAM&lt;br /&gt;
&lt;br /&gt;
Useful link: Flash&amp;#039;s IP Camera Database, with Zoneminder compatibility guide:   http://digdilem.org/cameras&lt;br /&gt;
&lt;br /&gt;
== Network Digitizers ==&lt;br /&gt;
&lt;br /&gt;
Like Network Cameras, these devices produce a video stream - but they accept an analog video input from a camera or other video source.&lt;br /&gt;
&lt;br /&gt;
* [[Synectics E100]] encoder&lt;br /&gt;
*The [[IP9100 | Aviosys IP9100, Models A, B and Plus]] has four analog video inputs.  It produces a ZM compatible video stream from one of the inputs, which is selectable via an HTTP GET command.  There might even be a control script for ZM that lets you select the active video input using &amp;#039;&amp;#039;ZM&amp;#039;s Camera Control Presets!&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
With the yoics Aviosys 9100 firmware at http://www.yoics.com/?p=28, ZoneMinder can directly access all four ports via /usr/yoicsX.jpg as the remote host path, where X is 0 - 3.&lt;br /&gt;
&lt;br /&gt;
* [[Bosch VIP X1 Single-channel]] video encoder [http://products.boschsecuritysystems.eu/en/EMEA/products/bxp/SKU15449253232961378955-CATMda7ec5dc0edf5b1a0b8cb619e2e11308]&lt;br /&gt;
&lt;br /&gt;
* Video cameras &amp;amp; safes for antitheft purpose on the website http://www.infosafe.fr&lt;br /&gt;
&lt;br /&gt;
== USB Cameras ==&lt;br /&gt;
&lt;br /&gt;
*Just Zoom USB cam&lt;br /&gt;
&lt;br /&gt;
*Creative Webcam Pro, Webcam 3, LIVE! Cam OPTIA PRO (V4L2, Chan 0, PAL, YUYV)&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;Most&amp;#039;&amp;#039; UVCvideo cameras, including: Advent AWC213, Creative Labs VF0420, [[Logitech QuickCam Express]], Logitech HD C270, QuickCam Pro 3000, [[QuickCam Pro 4000]],  QuickCam Communicate STX/Deluxe, [[Logitech Webcam Pro 9000]], and [[Webcam C250]]&lt;br /&gt;
&lt;br /&gt;
*Logitech Quickcam Orbit/Sphere (experimental basic pan/tilt control has also published for testing and hacking [http://www.zoneminder.com/forums/viewtopic.php?t=9788])&lt;br /&gt;
&lt;br /&gt;
*[[Philips]] &lt;br /&gt;
&lt;br /&gt;
*Any OV511 based USB camera [http://alpha.dyndns.org/ov511/cameras.html]&lt;br /&gt;
&lt;br /&gt;
*Any CPIA based USB camera [http://webcam.sourceforge.net]&lt;br /&gt;
&lt;br /&gt;
*[[LabTec WebCam Pro]]&lt;br /&gt;
&lt;br /&gt;
*Confirmed basic functionality with Microsoft Lifecam VX 5000 using UVC Streaming method&lt;br /&gt;
&lt;br /&gt;
Note that most USB cameras that can use Video4Linux/V4L2, and so can be used by ZoneMinder.  Some have older chipsets and can be hard to find new.&lt;br /&gt;
&lt;br /&gt;
Note that PWC drivers are not included in the kernel. Some distribution&amp;#039;s add them in and other may not. Here are some relevant links:&lt;br /&gt;
* [http://www.smcc.demon.nl/webcam/ Old Maintainer]&lt;br /&gt;
* [http://www.saillard.org/linux/pwc/ Current PWC Maintainer]&lt;br /&gt;
&lt;br /&gt;
== X10 Devices ==&lt;br /&gt;
The only device that really needs to be compatable with ZM is the Transceiver, all other x10 devices comunicate through that device.&lt;br /&gt;
*[[CM11]] Bi-Directional Transceiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other X10 notes:&lt;br /&gt;
&lt;br /&gt;
[http://www.zoneminder.com/forums/viewtopic.php?t=6423&amp;amp;highlight=x10 Topic 6423]&lt;br /&gt;
&lt;br /&gt;
[http://www.zoneminder.com/forums/viewtopic.php?t=7082&amp;amp;highlight=x10 Topic 7082]&lt;br /&gt;
&lt;br /&gt;
== All other hardware as supported by Linux ==&lt;br /&gt;
To find out if your hardware is supported, check the [http://www.zoneminder.com/forums/viewforum.php?f=10 HCL]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Plug Computers ==&lt;br /&gt;
Guruplug Server Plus -&amp;gt; How to install Zoneminder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Raspberry Pi - Raspbian ==&lt;br /&gt;
&lt;br /&gt;
ZM 1.25 is already in Raspbian.  Newer development packages are available.&lt;br /&gt;
&lt;br /&gt;
You will want libjpeg-turbo from the following repository by adding to your /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
deb http://zarrenspry.info/repos/apt/raspbian testing main&lt;br /&gt;
deb-src http://zarrenspry.info/repos/apt/raspbian testing main&lt;br /&gt;
&lt;br /&gt;
Add gpg by&lt;br /&gt;
&lt;br /&gt;
wget -O - http://zarrenspry.info/zarrenspry.gpg.key|apt-key add -&lt;br /&gt;
&lt;br /&gt;
apt-get install libturbojpeg8 libturbojpeg8-dev&lt;br /&gt;
&lt;br /&gt;
If using the Pi camera, you will need to enable it in raspi-config as well as loading the v4l2 kernel module by adding the following to your /etc/modules&lt;br /&gt;
&lt;br /&gt;
bcm2835-v4l2&lt;br /&gt;
&lt;br /&gt;
Although the camera will can capture high res, you don&amp;#039;t have enough RAM currently to do so.  Especially if you have the early 256MB model.  So ust stick to 640x480.  &lt;br /&gt;
&lt;br /&gt;
You should be able to get around 20fps, but if you do anything involving the CPU you will get underruns.&lt;br /&gt;
&lt;br /&gt;
== Raspberry Pi 2 - Fedora ==&lt;br /&gt;
&lt;br /&gt;
The latest version of ZoneMinder is available for the Raspberry Pi 2 when running Fedora. &lt;br /&gt;
Browse to the zmrepo site for installation instructions: https://zmrepo.zoneminder.com/&lt;br /&gt;
&lt;br /&gt;
== Raspberry Pi 2 - Raspbian ==&lt;br /&gt;
&lt;br /&gt;
Installed fine from packages as found in instructions in other locations.&lt;br /&gt;
&lt;br /&gt;
Five Dahua HFW-4300S cameras resulted in a load of 13+, running at reasonably 720x576 capture. Nothing I could do seemed to save this attempted project. Switched to Ordoid XU4, see below.&lt;br /&gt;
&lt;br /&gt;
== Odroid - XU4 - Ubuntu Mate ==&lt;br /&gt;
Installed Zoneminder via Ubuntu package and then upgraded to 1.29.0 without issue.&lt;br /&gt;
Five Dahua HFW-4300S cameras running at 720x576 as FFMPEG results in a system load of around 2-3, so not too bad. System running several other always on systems, but Zoneminder consumes most the CPU. No local storage, used QNAP as dedicated image/events storage.&lt;br /&gt;
Compiled libjpeg-turbo and that reduced CPU a little, not a lot.&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14082</id>
		<title>Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14082"/>
		<updated>2016-07-22T21:29:02Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Dump off corp wiki - no syntaxhighlight &amp;#039;round &amp;#039;ere!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
-- PICCY --&lt;br /&gt;
&lt;br /&gt;
http://www.keekoonvision.com/ produce a series of IP cameras that are marketed as baby monitors and sold directly via outlets such as Amazon. They are low cost and feature pan and tilt.  This page was written after full testing of the KK002 model.  The other current models at time of writing (July 2016) are the KK001 and KK003 and are expected to work with the same settings.  &lt;br /&gt;
&lt;br /&gt;
=== Camera Features ===&lt;br /&gt;
Some pertinent features and things to know:&lt;br /&gt;
* 720p - RTSP, H264, 1M pixel &lt;br /&gt;
* Pan and tilt with six presets&lt;br /&gt;
* Two way audio (not tested)&lt;br /&gt;
* Wifi and ethernet (100Mbs&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* IR night vision&lt;br /&gt;
* Three metre long power lead&lt;br /&gt;
* Indoor only&lt;br /&gt;
* Minimal but functional web interface &lt;br /&gt;
&lt;br /&gt;
=== Initial Installation ===&lt;br /&gt;
Recycle the Quick Start guide and throw away the mini CD.  Connect via ethernet cable to your network.  It will DHCP an IP address by default and the web interface is on port 80.  Default username is admin with no password.  To get to the settings, click on the &amp;quot;Non IE web browsers&amp;quot; link.  At the bottom right there is a gear shaped icon for &amp;quot;Setting&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Set an admin password and optionally setup additional users and passwords.  Optionally set ntp and for Zoneminder usage, go through the other settings disabling anything that might add load on the built in processor. &lt;br /&gt;
&lt;br /&gt;
If you want to use Wifi then browse to Network -&amp;gt; Wifi.  Select the correct SSID, click on connect and fill in the pre shared key.  Finally select the newly created &amp;quot;Station Profile&amp;quot; and select Activate.  A correctly activated profile will have a yellow tick on a green square icon next to it.  If you have a red square then most likely you have got the pre shared key wrong.&lt;br /&gt;
&lt;br /&gt;
== Zoneminder specifics ==&lt;br /&gt;
&lt;br /&gt;
=== Tested Versions ===&lt;br /&gt;
* Zoneminder 1.29 on Ubuntu 14.04 LTS &lt;br /&gt;
* Camera firmware 1.8.16.6 D (it arrived with the latest at the time of writing)  Software downloads: http://www.keekoonvision.com/download-details-a &lt;br /&gt;
&lt;br /&gt;
=== Monitor Settings ===&lt;br /&gt;
These are known good settings:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Source&lt;br /&gt;
!Parameter&lt;br /&gt;
!Setting&lt;br /&gt;
|-&lt;br /&gt;
|Remote Protocol&lt;br /&gt;
|RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Method&lt;br /&gt;
|RTP/RTSP&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Name&lt;br /&gt;
|admin:password@camera.example.co.uk&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Port&lt;br /&gt;
|554&lt;br /&gt;
|-&lt;br /&gt;
|Remote Host Path&lt;br /&gt;
|/rtsp_live0&lt;br /&gt;
|-&lt;br /&gt;
|Capture Width&lt;br /&gt;
|1280&lt;br /&gt;
|-&lt;br /&gt;
|Capture Height&lt;br /&gt;
|780&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Control ===&lt;br /&gt;
Shortly this script will be pending inclusion into the distro but is reproduced here in case it doesn&amp;#039;t make it or you have an older version of ZM.  Instructions for use are in the comments under Usage.  You should not have to change the script itself in any way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ==========================================================================&lt;br /&gt;
#&lt;br /&gt;
# ZoneMinder Keekoon Control Protocol Module&lt;br /&gt;
# This code was mostly derived from other ZM Control modules&lt;br /&gt;
#&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;
# Tested: KK002 (22 July 2016)&lt;br /&gt;
#&lt;br /&gt;
# Usage:&lt;br /&gt;
# ======&lt;br /&gt;
#&lt;br /&gt;
# Copy this file to say /usr/share/perl5/ZoneMinder/Control (Debian/Ubuntu)&lt;br /&gt;
#&lt;br /&gt;
# Create a new Control Capabilities:&lt;br /&gt;
#   Main:    Name Keekoon, Type = Remote, Protocol = Keekoon&lt;br /&gt;
#   Move:    Can Move, Can Move Diagonally, Can Move Continous&lt;br /&gt;
#   Pan:     Can Pan&lt;br /&gt;
#   Tilt:    Can Tilt&lt;br /&gt;
#   Presets: Has Presets, Num Presets = 6, Can Set Presets&lt;br /&gt;
#&lt;br /&gt;
# Set the ControlAddress in the camera definition, use the format:&lt;br /&gt;
#   http(s)://username:password@address:port&lt;br /&gt;
#&lt;br /&gt;
#   eg : http://admin:adminpass@10.10.10.1:80&lt;br /&gt;
#   or : https://admin:password@mycamera.example.co.uk:80&lt;br /&gt;
#&lt;br /&gt;
#   Return Location to Preset 1&lt;br /&gt;
#   Auto Stop Timeout = 0.5      is a good starting point&lt;br /&gt;
#&lt;br /&gt;
# ===========================================================================&lt;br /&gt;
# Problems: Enable debug and watch /tmp/zm_debug.log.&amp;lt;int&amp;gt; The&lt;br /&gt;
#           correct debug log can be found by date stamp.&lt;br /&gt;
#           Enable/disable the Source for the camera in the web GUI&lt;br /&gt;
#           each time you edit this script.  If the pid doesn&amp;#039;t&lt;br /&gt;
#           change then you have not restarted it.    &lt;br /&gt;
# Errors like this:&lt;br /&gt;
# [Error in response to Request:&amp;#039;400 URL must be absolute&amp;#039;]&lt;br /&gt;
# means that you have not specified all the parts in ControlAddress or the&lt;br /&gt;
# Regex has failed to parse it correctly&lt;br /&gt;
#&lt;br /&gt;
# =========================================================================&lt;br /&gt;
# Notes:  &lt;br /&gt;
# Example command from docs, at http://www.keekoonvision.com/for-developers-a: &lt;br /&gt;
# Up: http://camera_ip:web_port/decoder_control.cgi?command=0&amp;amp;user=username&amp;amp;pwd=password&lt;br /&gt;
# However the camera actually uses basic auth and not user= etc&lt;br /&gt;
#&lt;br /&gt;
# Test URLs with something like this&lt;br /&gt;
# curl -XGET -u user:pass &amp;quot;http://cam.example.co.uk:80/decoder_control.cgi?command=1&lt;br /&gt;
#&lt;br /&gt;
# These cameras have a default admin user but can have six more defined&lt;br /&gt;
# with membership of three groups&lt;br /&gt;
# https is not directly supported but could be via say HA Proxy, so that&lt;br /&gt;
# is included rather than hardstrapping http://&lt;br /&gt;
# ==========================================================================&lt;br /&gt;
&lt;br /&gt;
package ZoneMinder::Control::Keekoon;&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::Control;&lt;br /&gt;
&lt;br /&gt;
our @ISA = qw(ZoneMinder::Control);&lt;br /&gt;
&lt;br /&gt;
use ZoneMinder::Logger qw(:all);&lt;br /&gt;
use ZoneMinder::Config qw(:all);&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( ) || 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;
&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;
&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;.ZoneMinder::Base::ZM_VERSION );&lt;br /&gt;
&lt;br /&gt;
    $self-&amp;gt;{state} = &amp;#039;open&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
    Info( &amp;quot;Open&amp;quot; );&lt;br /&gt;
&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;
&lt;br /&gt;
    my ( $PROTOCOL, $USER, $PASS, $ADDR, $PORT ) &lt;br /&gt;
        = $self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress} =~ /^(https?):\/\/(.*):(.*)@(.*):(\d+)$/;&lt;br /&gt;
    my $URL = $PROTOCOL.&amp;quot;://&amp;quot;.$ADDR.&amp;quot;:&amp;quot;.$PORT.&amp;quot;/decoder_control.cgi?command=&amp;quot;.$cmd;&lt;br /&gt;
&lt;br /&gt;
    Debug( &amp;quot;ControlAddress from camera Control setting:&amp;quot;.$self-&amp;gt;{Monitor}-&amp;gt;{ControlAddress} );&lt;br /&gt;
    Debug( &amp;quot;URL parsed from ControlAddress:&amp;quot;.$URL);&lt;br /&gt;
&lt;br /&gt;
    my $req = HTTP::Request-&amp;gt;new( GET=&amp;gt;$URL );&lt;br /&gt;
    &lt;br /&gt;
    # Do Basic Auth&lt;br /&gt;
    $req-&amp;gt;authorization_basic($USER, $PASS);&lt;br /&gt;
    &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 in response to Request:&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;
# Set autoStop timeout on the Control tab for the camera&lt;br /&gt;
sub autoStop&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $stop_command = shift;&lt;br /&gt;
    my $autostop = shift;&lt;br /&gt;
    &lt;br /&gt;
    if( $stop_command &amp;amp;&amp;amp; $autostop)&lt;br /&gt;
    {&lt;br /&gt;
        Debug( &amp;quot;Auto Stop&amp;quot; );&lt;br /&gt;
        usleep( $autostop );&lt;br /&gt;
        my $cmd = $stop_command;&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUp&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;0&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;1&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Up&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDown&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;2&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;3&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Down&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;4&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;5&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $cmd = &amp;quot;6&amp;quot;;&lt;br /&gt;
    my $stop_command = &amp;quot;7&amp;quot;;&lt;br /&gt;
    Debug( &amp;quot;Move Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
    $self-&amp;gt;autoStop( $stop_command, $self-&amp;gt;{Monitor}-&amp;gt;{AutoStopTimeout} );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUpRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Up Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConUp( );&lt;br /&gt;
    $self-&amp;gt;moveConRight( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDownRight&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Down Right&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConDown( );&lt;br /&gt;
    $self-&amp;gt;moveConRight( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConUpLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Up Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConUp( );&lt;br /&gt;
    $self-&amp;gt;moveConLeft( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
sub moveConDownLeft&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    Debug( &amp;quot;Move Diagonally Down Left&amp;quot; );&lt;br /&gt;
    $self-&amp;gt;moveConDown( );&lt;br /&gt;
    $self-&amp;gt;moveConLeft( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# SET: 30,32,34,36,38,40 for presets 1-6&lt;br /&gt;
sub presetSet&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $params = shift;&lt;br /&gt;
    my $preset = $self-&amp;gt;getParam( $params, &amp;#039;preset&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
    Debug( &amp;quot;Set Preset No: &amp;quot; . $preset );&lt;br /&gt;
&lt;br /&gt;
    if (( $preset &amp;gt;= 1 ) &amp;amp;&amp;amp; ( $preset &amp;lt;= 6 )) {&lt;br /&gt;
        my $cmd = (($preset*2) + 28);&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
        Debug( &amp;quot;Set preset cmd: &amp;quot; . $cmd );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# GOTO: 31,33,35,37,39,41 for presets 1-6&lt;br /&gt;
sub presetGoto&lt;br /&gt;
{&lt;br /&gt;
    my $self = shift;&lt;br /&gt;
    my $params = shift;&lt;br /&gt;
    my $preset = $self-&amp;gt;getParam( $params, &amp;#039;preset&amp;#039; );&lt;br /&gt;
    Debug( &amp;quot;Goto Preset No: &amp;quot; . $preset );&lt;br /&gt;
&lt;br /&gt;
    if (( $preset &amp;gt;= 1 ) &amp;amp;&amp;amp; ( $preset &amp;lt;= 6 )) {&lt;br /&gt;
        my $cmd = (($preset*2) + 29);&lt;br /&gt;
        $self-&amp;gt;sendCmd( $cmd );&lt;br /&gt;
        Debug( &amp;quot;Goto Preset cmd: &amp;quot; . $cmd );&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Network Cameras]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14081</id>
		<title>Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14081"/>
		<updated>2016-07-22T20:02:09Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Categorise&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
[[Category:Network Cameras]]&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=User:Gerdesj&amp;diff=14080</id>
		<title>User:Gerdesj</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=User:Gerdesj&amp;diff=14080"/>
		<updated>2016-07-22T19:58:39Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Add link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is my user page.  There are many others like it but this one is mine.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* WIP: [[User:Gerdesj/Keekoon]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14079</id>
		<title>Keekoon</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Keekoon&amp;diff=14079"/>
		<updated>2016-07-22T19:53:32Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Create page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=User:Gerdesj&amp;diff=14078</id>
		<title>User:Gerdesj</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=User:Gerdesj&amp;diff=14078"/>
		<updated>2016-07-22T19:52:13Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Initial entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is my user page.  There are many others like it but this one is mine.&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Y-Cam&amp;diff=6542</id>
		<title>Y-Cam</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Y-Cam&amp;diff=6542"/>
		<updated>2015-01-14T16:19:05Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Lightly wikify&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Y-Cam Black and HD Bullet ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! URL&lt;br /&gt;
|-&lt;br /&gt;
| RTSP MPEG4 stream || &amp;lt;nowiki&amp;gt;rtsp://&amp;lt;ip&amp;gt;/live_mpeg4.sdp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| RTSP MJPEG stream || &amp;lt;nowiki&amp;gt;rtsp://&amp;lt;ip&amp;gt;/live_mjpeg.sdp&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| HTTP MPEG4 stream || &amp;lt;nowiki&amp;gt;http://&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt;/stream.av&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| HTTP MJPEG stream || &amp;lt;nowiki&amp;gt;http://&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt;/stream.jpg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| HTTP snapshot image || &amp;lt;nowiki&amp;gt;http://&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt;/snapshot.jpg&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Size of each stream is setup in preferences. Normally recommended to leave primary stream as the maximum and set the secondary stream for 320x240 for thumbnails or smaller recorded streams.&lt;br /&gt;
&lt;br /&gt;
Note: Colour balance on some of the Y-Cam blacks is /very/ off. Greens as pinks etc.&lt;br /&gt;
&lt;br /&gt;
Do not use this camera if colour is important, however as a night-time room Infra-red camera it is very suitable. We use several for welfare monitoring of horses.&lt;br /&gt;
&lt;br /&gt;
Seconded ([[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]))on the colour problems on this camera.  The same is not true for the 720 and 1080p Bullets though - very good colours.&lt;br /&gt;
&lt;br /&gt;
Example of source settings for http:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Remote Protocol: HTTP&lt;br /&gt;
Remote Method: Simple&lt;br /&gt;
Remote Host Name: user:pass@ip_of_camera&lt;br /&gt;
Remote Host Port: 80&lt;br /&gt;
Remote Host path: /stream.jpg&lt;br /&gt;
Target Colorspace: 24 bit colour&lt;br /&gt;
Capture Width: 640 (1280 for 720p Bullet)&lt;br /&gt;
Capture Height: 480 (720 for 720p Bullet)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of source settings for rtsp:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Remote Protocol: RTSP&lt;br /&gt;
Remote Method: RTP/RTSP&lt;br /&gt;
Remote Host Name: user:pass@ip_of_camera&lt;br /&gt;
Remote Host Port: 554&lt;br /&gt;
Remote Host path: /live_mpeg4.sdp&lt;br /&gt;
Target Colorspace: 24 bit colour&lt;br /&gt;
Capture Width: 640 (1280 for 720p Bullet)&lt;br /&gt;
Capture Height: 480 (720 for 720p Bullet)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Network Cameras]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Y-Cam&amp;diff=6541</id>
		<title>Y-Cam</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Y-Cam&amp;diff=6541"/>
		<updated>2015-01-14T16:17:45Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Converted to using wikitable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Y-Cam Black and HD Bullet ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! URL&lt;br /&gt;
|-&lt;br /&gt;
| RTSP MPEG4 stream || rtsp://&amp;lt;ip&amp;gt;/live_mpeg4.sdp&lt;br /&gt;
|-&lt;br /&gt;
| RTSP MJPEG stream || rtsp://&amp;lt;ip&amp;gt;/live_mjpeg.sdp&lt;br /&gt;
|-&lt;br /&gt;
| HTTP MPEG4 stream || http://&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt;/stream.av&lt;br /&gt;
|-&lt;br /&gt;
| HTTP MJPEG stream || http://&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt;/stream.jpg&lt;br /&gt;
|-&lt;br /&gt;
| HTTP snapshot image || http://&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt;/snapshot.jpg&lt;br /&gt;
|}&lt;br /&gt;
Size of each stream is setup in preferences. Normally recommended to leave primary stream as the maximum and set the secondary stream for 320x240 for thumbnails or smaller recorded streams.&lt;br /&gt;
&lt;br /&gt;
Note: Colour balance on some of the Y-Cam blacks is /very/ off. Greens as pinks etc.&lt;br /&gt;
&lt;br /&gt;
Do not use this camera if colour is important, however as a night-time room Infra-red camera it is very suitable. We use several for welfare monitoring of horses.&lt;br /&gt;
&lt;br /&gt;
Seconded ([[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]))on the colour problems on this camera.  The same is not true for the 720 and 1080p Bullets though - very good colours.&lt;br /&gt;
&lt;br /&gt;
Example of source settings for http:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Remote Protocol: HTTP&lt;br /&gt;
Remote Method: Simple&lt;br /&gt;
Remote Host Name: user:pass@ip_of_camera&lt;br /&gt;
Remote Host Port: 80&lt;br /&gt;
Remote Host path: /stream.jpg&lt;br /&gt;
Target Colorspace: 24 bit colour&lt;br /&gt;
Capture Width: 640 (1280 for 720p Bullet)&lt;br /&gt;
Capture Height: 480 (720 for 720p Bullet)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of source settings for rtsp:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Remote Protocol: RTSP&lt;br /&gt;
Remote Method: RTP/RTSP&lt;br /&gt;
Remote Host Name: user:pass@ip_of_camera&lt;br /&gt;
Remote Host Port: 554&lt;br /&gt;
Remote Host path: /live_mpeg4.sdp&lt;br /&gt;
Target Colorspace: 24 bit colour&lt;br /&gt;
Capture Width: 640 (1280 for 720p Bullet)&lt;br /&gt;
Capture Height: 480 (720 for 720p Bullet)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Network Cameras]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=Y-Cam&amp;diff=6540</id>
		<title>Y-Cam</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=Y-Cam&amp;diff=6540"/>
		<updated>2015-01-14T16:11:32Z</updated>

		<summary type="html">&lt;p&gt;Gerdesj: Added known working source examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Y-Cam Black and HD Bullet ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RTSP MPEG4 stream:	/live_mpeg4.sdp&lt;br /&gt;
RTSP MJPEG stream:	/live_mjpeg.sdp&lt;br /&gt;
HTTP MPEG4 stream:	/stream.av&lt;br /&gt;
HTTP MJPEG stream:	/stream.jpg&lt;br /&gt;
HTTP snapshot image:  /snapshot.jpg&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Size of each stream is setup in preferences. Normally recommended to leave primary stream as the maximum and set the secondary stream for 320x240 for thumbnails or smaller recorded streams.&lt;br /&gt;
&lt;br /&gt;
Note: Colour balance on some of the Y-Cam blacks is /very/ off. Greens as pinks etc.&lt;br /&gt;
&lt;br /&gt;
Do not use this camera if colour is important, however as a night-time room Infra-red camera it is very suitable. We use several for welfare monitoring of horses.&lt;br /&gt;
&lt;br /&gt;
Seconded ([[User:Gerdesj|Gerdesj]] ([[User talk:Gerdesj|talk]]))on the colour problems on this camera.  The same is not true for the 720 and 1080p Bullets though - very good colours.&lt;br /&gt;
&lt;br /&gt;
Example of source settings for http:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Remote Protocol: HTTP&lt;br /&gt;
Remote Method: Simple&lt;br /&gt;
Remote Host Name: user:pass@ip_of_camera&lt;br /&gt;
Remote Host Port: 80&lt;br /&gt;
Remote Host path: /stream.jpg&lt;br /&gt;
Target Colorspace: 24 bit colour&lt;br /&gt;
Capture Width: 640 (1280 for 720p Bullet)&lt;br /&gt;
Capture Height: 480 (720 for 720p Bullet)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of source settings for rtsp:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Remote Protocol: RTSP&lt;br /&gt;
Remote Method: RTP/RTSP&lt;br /&gt;
Remote Host Name: user:pass@ip_of_camera&lt;br /&gt;
Remote Host Port: 554&lt;br /&gt;
Remote Host path: /live_mpeg4.sdp&lt;br /&gt;
Target Colorspace: 24 bit colour&lt;br /&gt;
Capture Width: 640 (1280 for 720p Bullet)&lt;br /&gt;
Capture Height: 480 (720 for 720p Bullet)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Network Cameras]]&lt;/div&gt;</summary>
		<author><name>Gerdesj</name></author>
	</entry>
</feed>