Difference between revisions of "LibVNC"
(→Setup) |
|||
(24 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Zoneminder can not only record cameras, but can also do screen recording of Windows/Linux/Mac or any computer that uses VNC. LibVNC in 1.36 is a way to record VNC sessions. Any VNC should be able to be used, but this guide has tested only TightVNC. | Zoneminder can not only record cameras, but can also do screen recording of Windows/Linux/Mac or any computer that uses VNC. LibVNC in 1.36 is a way to record VNC sessions. Any VNC server should be able to be used, but this guide has tested only TightVNC. | ||
==Setup== | ==Setup== | ||
===Windows=== | ===LibVNCServer Installation=== | ||
Install TightVNC. | On Debian | ||
apt install libvncclient1 | |||
Setup a view only user with a password. Disable the primary user and | ===Using TightVNC on Windows=== | ||
1. Install TightVNC. https://www.tightvnc.com/download.html | |||
2. Setup a view only user with a password. Disable the primary user and | |||
also disable the java client. There is also the Access Control page where | also disable the java client. There is also the Access Control page where | ||
you can optionally put firewall rules in to only allow access to the | you can optionally put firewall rules in to only allow access to the | ||
ZM server. | ZM server. | ||
[[File:Libvnc1.png| | [[File:Libvnc1.png|400px|||]] | ||
My settings in Zoneminder look something like this. Note that I've | My settings in Zoneminder look something like this. Note that I've | ||
Line 17: | Line 20: | ||
just a password is used. The resolution may be any value that you want to record | just a password is used. The resolution may be any value that you want to record | ||
at. I have not tested how it affects performance, but have had success with both | at. I have not tested how it affects performance, but have had success with both | ||
1600x600 and also at say 320x240. | |||
NOTE: on the firewall page, the proper syntax for blocking all ips is: | |||
allow ip low ip high | |||
block 0.0.0.0 255.255.255.255 | |||
In that order. You can't simply put block 0.0.0.0, you must put the whole range there. | |||
===Settings=== | |||
[[File:Libvnc2.png|800px|||]] | [[File:Libvnc2.png|800px|||]] | ||
[[File:Libvnc3.png|700px|||]] | [[File:Libvnc3.png|700px|||]] | ||
The frame rate should be set to a limit, otherwise LibVNC may run at 200+fps. LibVNC also is unable to use | |||
h264 passthrough, as it doesn't use FFMPEG, therefore you must either save JPEGs or encode. Because of | |||
this, if you don't set an FPS limit, and/or you use too high a framerate, you could run into swapping/high | |||
CPU usage. So, beware. | |||
If everything goes right, you should have the computer screen recording in Zoneminder. | |||
Note: There has been a bug where the computers, if shut down then the recording will | |||
freeze in ZM. This can be avoided by restarting the monitor or ZM service after the | |||
computer is shut off (e.g. overnight). | |||
[[File:Libvnc4.png|800px|||]] | |||
==Tips/Troubleshooting== | |||
===Library Link Missing for LibVNCClient=== | |||
In ZM 1.36 on Debian 11, you will have to manually add a symbolic link from /usr/lib/x86-64-linux-gnu/libvncclient.so.1 to | |||
libvncclient.so. ZM looks for the library without the .1 appended to it. This may also apply to other Debian releases. | |||
===Frame Rate / Resolution Too High=== | |||
Be sure to do the following: | |||
* Set a limit for Maximum FPS, Alarm Maximum FPS, and Analysis FPS. Generally under 10, maybe 5. | |||
* Set the resolution to be some lower value that has the same aspect ratio. Because trying to run a 1920x1080 JPEG camera (which LibVNC is) will bog down the system. I use gimp, and calculate a lower value by adjusting the image size of a template that starts with the monitor size. | |||
===Multiple Monitors Resolution=== | |||
For multiple monitors, you will want to use the combined width, with the highest height. Multiple monitors are somewhat less desirable for LibVNC if you can avoid it. Again, use gimp to calculate the size, while keeping the same aspect ratio. | |||
==See Also== | |||
* https://thetechnologyteacher.wordpress.com/vncthumbnailviewer/ Another project which screen records computers using VNC. |
Latest revision as of 16:16, 23 February 2025
Zoneminder can not only record cameras, but can also do screen recording of Windows/Linux/Mac or any computer that uses VNC. LibVNC in 1.36 is a way to record VNC sessions. Any VNC server should be able to be used, but this guide has tested only TightVNC.
Setup
LibVNCServer Installation
On Debian
apt install libvncclient1
Using TightVNC on Windows
1. Install TightVNC. https://www.tightvnc.com/download.html
2. Setup a view only user with a password. Disable the primary user and also disable the java client. There is also the Access Control page where you can optionally put firewall rules in to only allow access to the ZM server.
My settings in Zoneminder look something like this. Note that I've specified to record only 2 FPS. For LibVNC, you should specify a max FPS. 2 is enough for my use case. Also note that there is no username, and instead just a password is used. The resolution may be any value that you want to record at. I have not tested how it affects performance, but have had success with both 1600x600 and also at say 320x240.
NOTE: on the firewall page, the proper syntax for blocking all ips is:
allow ip low ip high block 0.0.0.0 255.255.255.255
In that order. You can't simply put block 0.0.0.0, you must put the whole range there.
Settings
The frame rate should be set to a limit, otherwise LibVNC may run at 200+fps. LibVNC also is unable to use h264 passthrough, as it doesn't use FFMPEG, therefore you must either save JPEGs or encode. Because of this, if you don't set an FPS limit, and/or you use too high a framerate, you could run into swapping/high CPU usage. So, beware.
If everything goes right, you should have the computer screen recording in Zoneminder. Note: There has been a bug where the computers, if shut down then the recording will freeze in ZM. This can be avoided by restarting the monitor or ZM service after the computer is shut off (e.g. overnight).
Tips/Troubleshooting
Library Link Missing for LibVNCClient
In ZM 1.36 on Debian 11, you will have to manually add a symbolic link from /usr/lib/x86-64-linux-gnu/libvncclient.so.1 to libvncclient.so. ZM looks for the library without the .1 appended to it. This may also apply to other Debian releases.
Frame Rate / Resolution Too High
Be sure to do the following:
- Set a limit for Maximum FPS, Alarm Maximum FPS, and Analysis FPS. Generally under 10, maybe 5.
- Set the resolution to be some lower value that has the same aspect ratio. Because trying to run a 1920x1080 JPEG camera (which LibVNC is) will bog down the system. I use gimp, and calculate a lower value by adjusting the image size of a template that starts with the monitor size.
Multiple Monitors Resolution
For multiple monitors, you will want to use the combined width, with the highest height. Multiple monitors are somewhat less desirable for LibVNC if you can avoid it. Again, use gimp to calculate the size, while keeping the same aspect ratio.
See Also
- https://thetechnologyteacher.wordpress.com/vncthumbnailviewer/ Another project which screen records computers using VNC.