A
A
Art_Sh822021-03-29 17:39:53
CCTV
Art_Sh82, 2021-03-29 17:39:53

Requirements for a video surveillance server?

There are several questions:
1. Making a video surveillance system using 4G cameras. The firmware is custom, the camera itself sends the stream to the server. Stream h.265 + AAC 1920*1080 30fps. own protocol. The task of the server is to pack audio-video frames into an MP4 container. The duration of each file is 5-10 minutes. Number of cameras: 300. What kind of server is required, meaning memory-perc, and what disk subsystem?
2. The task becomes a little more difficult and we want to watch videos. At the same time, the number of users who will watch the videos does not exceed 10. We shift the decoding of the stream to the client side. The question is the same, what kind of iron do you need?
3. There is a desire to connect 4-5LTE CAT4 modems of different operators with real IP to the server. Those. the server sees the world through a wireless connection. How to balance communication channels? Is it possible to bind all IPs to a single domain name so that cameras can connect to a server through it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-03-29
@rPman

Protocol own
it all depends on its implementation
Encoding the stream I hope you have specialized hardware or ip-cameras, because otherwise not every server will be able to process such a stream (you can create something on the basis of nvidia gpu).
Everything else does not add any special requirements, I strongly recommend building and testing a reduced version of the solution with 1-2 cameras, most likely each will require a dozen other ram and a percentage of the processor core.
Multiply 300+10 streams by the bitrate, plus 30% you get the requirements for the disk system. Ordinary cheap hdd will give about 100 MB / s (remember that the linear speed of hdd disks is not uniform and drops by a factor during non-linear access, i.e. while watching videos, and then if you tune the file speed, for example, increase the read-ahead parameter), those. at 8 Mbps per camera, for example, it will allow writing no more than 100 streams to the disk, and if you read at the same time, then many times less. I've seen systems built on windows machines, they choke on a couple of dozen threads to disk. So I recommend linux,
You can add an intermediate ssd buffer to which recording from cameras will be made, and from it, with a parallel script, video chunks are transferred to hdd, when watching videos in the time interval, while they fit on ssd, there will be no particular slowdown, and yes, the speed of working with ssd you need to take the worst (divide by 2 from the worst write speed on synthetic tests, after completely writing the entire volume to the disk and remember about the fast depletion of the write resource in this mode)
There are two ways to use this buffer
выбор зависит от того, какие именно ролики нужно будет смотреть из архива или недавние:
* в буфер пишутся чанки видео и копируются на hdd в режиме FIFO, заполнив диск по максимуму, таким образом буфер содержит видео за последние X времени, и позволит просматривать эффективно только эти, к сожалению архив смотреть нельзя, так как это уронит скорость и будут потери данных записываемых в буфер
* в буфер пишутся чанки видео и тут же параллельным скриптом с удалением переносятся на hdd, таким образом буфер будет постоянно пустой, но во время просмотра видео из hdd архива, копирование должно приостанавливаться/замедляться (разруливать приоритетами ОС), во время просмотра роликов из архива, буфер начнет заполняться, когда он закончится, либо нужно останавливать просмотр либо будут потери видео

If viewing clips from the history is not regular, you can use an intermediate disk to use a regular hdd, in this case, while watching clips, the transfer speed from the buffer disk to the main ones may not keep up with the speed of the entire stream, so the size of this buffer disk will determine how long you can watch these videos (you need the appropriate software that monitors this and stops viewing so as not to lose data).
raid0 does not give an additional load on the processor, and will speed up the operation of the final device by about sqrt(n) times (n is the number of disks, and yes, even though the linear speed increases n-fold in synthetic tests, random access when watching videos will kill all this bonus )
raid5-6 may add requirements to the processor, but not much, one 100Mbit thread consumes about half the core load of an average modern machine
raid0 - - mirror does not create a load, i.e.
if suddenly the processor speed is not enough, it will be possible to free up a bit of the processor from raid5 due to a decrease in storage efficiency in the price both on the server side and the entire network infrastructure), so it is quite possible that 2-3 independent servers, even located in different rooms (it can physically optimize the network) will optimize the final cost of the solution, compared to a very powerful one located in one place.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question