It would seem, what trick can be in choosing a camera for video surveillance? I looked at the characteristics, chose with the right ones, bought it, stuck it - it worked. However, if this is “on the knee” video surveillance, and even with a webcam, there is something to break your head about, but everything is in order.
Some time ago, a friend confused me with a request - to arrange for him to video surveillance at the points on the repair of clothing. I actually worked as a system administrator at that time, and, to be honest, I had never been engaged in video surveillance before, but ... friendship is sacred - how can you refuse a friend? Especially when it’s pretty damn curious to see how everything is arranged and you can learn at someone else’s expense ... It is said - done. He equipped 3 points with video surveillance systems with inexpensive video recorders with a camera, microphone, etc. etc.
In general, there is nothing difficult here - I consulted with a friend who has been doing video surveillance for many years, purchased equipment through it, put everything in its place, nailed the camera to the wall and that's it. Bought-stuck-works.
However, this “standard” solution has several disadvantages:
')
1) Well, if everything works ...., but if something stops working - to find out what's the matter - it is almost impossible. A black box poorly translated by Chinese translators keeps a proud silence, for example, why after a year or so with small disks they began to fail at one point one by one. Why the DVR itself was sometimes stop for no apparent reason. There is one way out - throw one black box, buy another.
2) Expensive surveillance cameras that require separate power.
3) A separate microphone, which also requires a separate power supply.
4) To watch videos, you need to have a monitor next to the DVR, or connect with a special program via a laptop and download video in a special format, view it in a special program.
4) The speed of viewing videos at best is 3x or less. Seeing records, for example, in a week is not a very quick exercise.
5) The black box is bad, uninteresting, unsportsmanlike.
After a while I received an order for the equipment of another point.
After weighing all the pros and cons - he offered to make video surveillance using the system unit and the motherboard of the ITX form factor and the webcam. Consent to this was easily obtained because In this embodiment, the cost of equipment for video surveillance is almost half as much as with the “standard” version with a DVR. No need for a separate power supply for the camera and microphone, less wires. However, there is a drawback - the short wire of the video camera is usually no more than 1.5 m. But it can either be lengthened (although this may have a detrimental effect on the performance of the camera, since usb can be capricious) or put the system unit next to the camera, it's small, if you take the ITX motherboard (and as a bonus it is quiet, quieter than many DVRs).
Everything is clear with the system unit, however, when choosing a camera, questions appeared that I couldn’t find the answers to either the Russian or the “bourgeois” segment of the Internet, although I could be looking for something bad, but at that time I had to turn my head on.
So, the main problem of using a webcam for video surveillance is the lack of information from the manufacturer, what viewing angle does the camera have. Without this, it is impossible to guarantee the customer that the record will show everything that he needs. Moreover, webcams always have a very narrow viewing angle, and this is not the same vertically or horizontally.
Check the actual viewing angle is possible only after buying the camera
Initially, I unsuccessfully tried to compensate for the narrow viewing angle of the webcam by installing two cameras, but this did not help.
Even two webcams could not provide the necessary coverage of space.
Theoretically, you can buy an interchangeable lens with the correct viewing angle for a modular camera, however, the following questions arise:
1) Lens specifications are specified for a matrix of a camera of a certain size. What is the size of the matrix in a particular webcam?
2) The thread diameter of the web camera and the lens ... will it match?
I began to solve questions in order.
From the range of web cameras offered by local suppliers, using the bruteforce characteristics, I found one - the only camera for which the matrix size was specified: 1/3 "CMOS, (Canyon CNR-WCAM420).

From the lenses offered by the local supplier, he chose the one that provided the required overview for the specified matrix (DW2162 160 degrees for a given matrix 1/3), with an M12 thread that approximately had to go to the camera.

The first attempt to replace the camera lens with an M12 threaded lens failed miserably. The camera thread was half a millimeter smaller in diameter than the lens.
After searching on the Internet for ways to solve this problem, study the bourgeois instructions like “buy special wonder-crap in a special online store, attach and voila (for example
www.instructables.com/id/Wide-angle-web-cam ) I already almost ready to do something similar. However, during the next “meditation” above the camera with the lens, I remembered one old anecdote, which prompted a solution to the problem in a truly national manner without having to buy something unnecessary:
Americans stole from Russian fighter drawings. Collected - steam locomotive. Disassembled, collected - the engine! What to do, stole Russian specialist. The specialist takes the drawing, looks, looks and says: “In the same place, at the bottom, in a small font: after assembling, process it with a file”.
I took the file into my hands, took the freshly bought lens, and after ten minutes the lens freely began to enter where it was to serve faithfully. In order not to accidentally damage the threads in the chamber, I stowed the threads on the lens a little more than necessary, and then wrapped it with tape, another material that a rare national knee craft can do without.

The appearance of the camera has not changed in any way, but the review has become almost 160 degrees which was necessary.
Next is a matter of technology. There were already a lot of articles about video surveillance setup using a webcam and a computer with Linux, including on Habré.
There was, however, another nuance that is not found in those articles - the need to write video with sound on a flash drive. The customer wanted at any time to pull out the flash drive to insert another one in order to go home and browse all that had accumulated in a week — two on the flash drive — to calculate the actual number of orders accepted by the employees.
But this is a completely different story, which I will also surely tell ... if it will be of interest to the respected Habroskoobschestvu.