📜 ⬆️ ⬇️

Video surveillance from idea to ... idea. Data

The idea itself: "Video surveillance from idea to ... idea"

Here will be described the facts of the system. Pictures, logs, and something else.

The most difficult thing was not the optimization of algorithms, not the invention of a good system, but the struggle with the load average. Imagine you have 30 streams of cameras that write to disk, desktop disks in the raid on FreeNas via NFS. Creepy? No, not horror, even if without NFS, it is still a huge system drawdown. The solution is ramdisks.

Since the system has been lying dead for a month, and I slowly studied Java ( here ), I am not quite aware of how many cameras are alive and what is happening on the server. We will understand the course of the article. Do not let me go until the topic of video surveillance.
')
Here it is a cherished machine:

image

The picture shows that she has experienced many tests and loads (from Windows 2003 graphics to the minecraft server). Load average is shown in working condition, i.e. Now the cameras are working and the car is writing a video.

Here is the "working virtual horse" system. The idea was to multiply and run them in different parts of the "world". And if desired, embody in the gland. Unpacking qcow to disk seems to be a trivial task.

image

We climb inside the car.
top
top - 10:41:49 up 25 min, 2 users, load average: 0.34, 0.45, 0.40 Tasks: 168 total, 1 running, 167 sleeping, 0 stopped, 0 zombie %Cpu(s): 4.0 us, 2.3 sy, 0.0 ni, 90.5 id, 0.1 wa, 1.2 hi, 1.2 si, 0.7 st KiB Mem: 6112740 total, 2076652 used, 4036088 free, 19736 buffers KiB Swap: 2047996 total, 0 used, 2047996 free, 1586536 cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 9727 vlc 20 0 690412 29852 1776 S 4.3 0.5 0:44.78 motion 9713 vlc 20 0 2067540 88944 11928 S 3.7 1.5 0:33.55 vlc 9911 vlc 20 0 1407164 42080 11968 S 2.0 0.7 0:22.40 vlc 10133 vlc 20 0 1481508 42672 7732 S 1.3 0.7 0:17.86 vlc 23982 vlc 20 0 397988 7948 1908 S 0.7 0.1 0:00.02 php-fpm 15 root 20 0 0 0 0 S 0.3 0.0 0:00.73 ksoftirqd/2 918 vlc 20 0 55700 2384 892 S 0.3 0.0 0:03.47 nginx 9935 vlc 20 0 604916 16616 1528 S 0.3 0.3 0:04.62 motion ... 

free
  total used free shared buffers cached Mem: 5.8G 2.1G 3.8G 647M 19M 1.6G -/+ buffers/cache: 461M 5.4G Swap: 2.0G 0B 2.0G 


df
 Filesystem Size Used Avail Use% Mounted on /dev/mapper/fedora_dvr-root 7.4G 6.9G 28M 100% / devtmpfs 3.0G 0 3.0G 0% /dev tmpfs 3.0G 0 3.0G 0% /dev/shm tmpfs 3.0G 17M 2.9G 1% /run tmpfs 3.0G 0 3.0G 0% /sys/fs/cgroup tmpfs 3.0G 48K 3.0G 1% /tmp tmpfs 4.0G 602M 3.4G 15% /home/vlc/dvr/tmpfs /dev/sda1 477M 90M 358M 20% /boot *.*.*.211:/mnt/raid1/mx/video 11T 2.2T 8.2T 21% /home/vlc/dvr/nfs 


The most working horse in the current implementation is VLC (proceeded to the development of ffserve, but never completed it)

vlc 9713 1 2 10:22 ? 00:00:39 /usr/bin/vlc -I dummy -vvv --rtsp-tcp -d -I http --http-host=0.0.0.0 --http-port 8101 -I telnet --telnet-port 44301 --telnet-password 12345 --repeat --loop --live-caching 500 --network-caching 500 --sout-mux-caching 300 --sout-ts-dts-delay 400 --pidfile /home/vlc/dvr/local/proc/1/vlc.pid --extraintf=http:logger --file-logging --log-verbose 0 --logfile /home/vlc/dvr/local/log/1/vlc.log
Caching cannot be set to less than 500 (ms), as there is some buffer in VLC that does not have time to fill with video data and they go to the return and destroy the video stream (there will be sound, there is no video).
Caches are chosen empirically.
--telnet - allows you to manage VLC via telnet.
telnet localhost 44301
> show
show command
  instances CAM_9_l_flv type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:55309 output : #transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,samplerate=44100,ab=128}:http{dst=*:11009/stream.flv} options instances CAM_11_live type : broadcast enabled : yes loop : yes inputs 1 : rtsp://10.112.249.48:10003/live/ch01_0 output : #transcode{acodec=none}:std{access=http{mime=video/mp4},mux=ts{use-key-frames},dst=*:9011/path.mp4} options instances instance name : default state : playing position : 0.000000 time : 1555935707 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_11_lhttp type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:9011/path.mp4 output : #std{access=livehttp{seglen=5,delsegs=true,numsegs=15,splitanywhere=true,index=/home/vlc/dvr/tmpfs/lhttp/1/stream-11.m3u8,index-url=http://10.154.28.202/lhttp/1/stream-11-########.ts},mux=ts{use-key-frames},dst=/home/vlc/dvr/tmpfs/lhttp/1/stream-11-########.ts} options instances instance name : default state : playing position : 0.000000 time : 0 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_11_l_flv type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:55311 output : #transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,samplerate=44100,ab=128}:http{dst=*:11011/stream.flv} options instances instance name : default state : playing position : 0.000000 time : 0 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_12_live type : broadcast enabled : yes loop : yes inputs 1 : rtsp://10.112.249.48:10004/live/ch01_0 output : #transcode{acodec=none}:std{access=http{mime=video/mp4},mux=ts{use-key-frames},dst=*:9012/path.mp4} options instances instance name : default state : playing position : 0.000000 time : 1560325097 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_12_lhttp type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:9012/path.mp4 output : #std{access=livehttp{seglen=5,delsegs=true,numsegs=15,splitanywhere=true,index=/home/vlc/dvr/tmpfs/lhttp/1/stream-12.m3u8,index-url=http://10.154.28.202/lhttp/1/stream-12-########.ts},mux=ts{use-key-frames},dst=/home/vlc/dvr/tmpfs/lhttp/1/stream-12-########.ts} options instances instance name : default state : playing position : 0.000000 time : 0 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_12_l_flv type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:55312 output : #transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,samplerate=44100,ab=128}:http{dst=*:11012/stream.flv} options instances instance name : default state : playing position : 0.000000 time : 0 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_14_live type : broadcast enabled : yes loop : yes inputs 1 : http://95.31.22.173:3128/cam_1.cgi output : #transcode{acodec=none}:std{access=http{mime=video/mp4},mux=ts{use-key-frames},dst=*:9014/path.mp4} options instances CAM_14_lhttp type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:9014/path.mp4 output : #std{access=livehttp{seglen=5,delsegs=true,numsegs=15,splitanywhere=true,index=/home/vlc/dvr/tmpfs/lhttp/1/stream-14.m3u8,index-url=http://10.154.28.202/lhttp/1/stream-14-########.ts},mux=ts{use-key-frames},dst=/home/vlc/dvr/tmpfs/lhttp/1/stream-14-########.ts} options instances CAM_14_l_flv type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:55314 output : #transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,samplerate=44100,ab=128}:http{dst=*:11014/stream.flv} options instances CAM_15_live type : broadcast enabled : yes loop : yes inputs 1 : rtsp://10.112.249.48:10001/live/ch01_0 output : #transcode{acodec=none}:std{access=http{mime=video/mp4},mux=ts{use-key-frames},dst=*:9015/path.mp4} options instances CAM_15_lhttp type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:9015/path.mp4 output : #std{access=livehttp{seglen=5,delsegs=true,numsegs=15,splitanywhere=true,index=/home/vlc/dvr/tmpfs/lhttp/1/stream-15.m3u8,index-url=http://10.154.28.202/lhttp/1/stream-15-########.ts},mux=ts{use-key-frames},dst=/home/vlc/dvr/tmpfs/lhttp/1/stream-15-########.ts} options instances CAM_15_l_flv type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:55315 output : #transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,samplerate=44100,ab=128}:http{dst=*:11015/stream.flv} options instances CAM_11_rec type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:9011/path.mp4 output : #std{access=file{append},mux=ts{use-key-frames},dst=/home/vlc/dvr/tmpfs/rec/1/20140822/11_104211.avi} options instances instance name : default state : playing position : 0.000000 time : 0 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_12_rec type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:9012/path.mp4 output : #std{access=file{append},mux=ts{use-key-frames},dst=/home/vlc/dvr/tmpfs/rec/1/20140822/12_104412.avi} options instances instance name : default state : playing position : 0.000000 time : 0 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 0 playlistindex : 1 CAM_11_mtn type : broadcast enabled : yes loop : yes inputs 1 : http://localhost:9011/path.mp4 output : #std{access=file{append},mux=ts{use-key-frames},dst=/home/vlc/dvr/tmpfs/mtn/1/20140822/11_104831.avi} options instances instance name : default state : stopped position : 0.000000 time : 0 length : 0 rate : 1.000000 title : 0 chapter : 0 can-seek : 1 playlistindex : 1 schedule > 



CAM_12_lhttp is our cameras
12 - id from sql
CAM - essence
lhttp - stream
The logic of work is simple. Once every 10 minutes, delete the rec stream, create a new rec stream with a new file name. Video stream is cut.
New threads are added to the end of the list.
Here we see the CAM_11_mtn is the last - he is writing at the moment, as the motion said to write.
in the ~ / vlc directory there is local, nfs, tmpfs.
fstab explains who it is and what it is
 tmpfs /home/vlc/dvr/tmpfs tmpfs size=4072m 0 0 *.*.*.211:/mnt/*/*/video /home/vlc/dvr/nfs nfs users 0 0 

local - Plain folder. It contains intermediate configs, logs, and proc flags (see the VLC startup command above)
[vlc @ dvr tmpfs] $ ls
img lhttp lock mtn rec tmp
Each directory has subdirectories where name is the user id from sql
each user has his information
img - image storage

lastsnap.jpg snapshot-2014_08_22-10_32_00.jpg snapshot-2014_08_22-10_39_00.jpg snapshot-2014_08_22-10_46_00.jpg snapshot-2014_08_22-10_53_00.jpg
snapshot-2014_08_22-10_26_00.jpg ...


lhttp - VLCshny hls
stream-11-00000414.ts stream-11-00000419.ts stream-11-00000424.ts ...
lock - files flags to synchronize all this zoo
motionDetected_11.lock time_16_timelapse.lock time_23_timelapse.lock time_CAM_25_rec.lock update.lock
motionDetected_11 - says that there is movement on the 11th camera.
update.lock - says that the update system is on
And for these files is a countdown. Time lapse, recording and more delays.

mnt, rec - current records. Let me remind you that this is a ram disk and we write 10 minutes in memory. If we don’t write, the folders are empty. As soon as 10 minutes passes, the file is migrated to NFS. After all, it is easier to throw a piece at NFS, rather than pouring streams from the cameras.
in tmp there are auxiliary files, or additional info for php, since we are not working as a daemon, but run 1 time in the update about the server.

From the pictures we make tayplapsy
 257K 11_20140714_132700_timelapse.mp4 560K 11_20140714_142600_timelapse.mp4 


While writing an article we have traffic (ls with NFS)
 [vlc@dvr 20140822]$ ls -hs | grep -v asdfasdf total 129M 2.6M 11_101919.mp4 1.4M 11_101943.mp4 3.6M 11_103431.mp4 2.8M 11_103734.mp4 1.5M 11_104036.mp4 3.9M 11_104142.mp4 1000K 11_104219.mp4 1.8M 11_104354.mp4 3.2M 11_104831.mp4 2.8M 11_104908.mp4 3.3M 11_104942.mp4 2.1M 11_105034.mp4 2.1M 11_105156.mp4 1.2M 11_105215.mp4 944K 11_105228.mp4 2.6M 11_105321.mp4 161K 11_105410.mp4 1.6M 11_105505.mp4 1.4M 11_105855.mp4 4.5M 11_105943.mp4 7.3M 11_110022.mp4 3.8M 11_110256.mp4 1.4M 11_110342.mp4 1.8M 11_110448.mp4 1.3M 12_101917.mp4 2.9M 12_102416.mp4 1.7M 12_102753.mp4 5.5M 12_102831.mp4 1.4M 12_103319.mp4 1.5M 12_103529.mp4 1.8M 12_103551.mp4 2.5M 12_103622.mp4 1.4M 12_103955.mp4 1.8M 12_105112.mp4 2.5M 12_105816.mp4 48M 12_105839.mp4 


And this is what they recorded today.
17M 11_101734.mp4 71M 11_102230.mp4 74M 11_103212.mp4 73M 11_104211.mp4 74M 11_105211.mp4 18M 12_101735.mp4 88M 12_102231.mp4 75M 12_103411.mp4 75M 12_104412.mp4 81M 12_105413.mp4

A piece of the system log reflects the operation of the system.
 [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\Lock-time_CAM_26_rec.lock __construct [ 2014-08-22 11:08:32 ] UID:0 NOTICE TimeLock 249 [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\Lock-time_CAM_26_mtn.lock __construct [ 2014-08-22 11:08:32 ] UID:0 NOTICE TimeLock 370 [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\Lock-motionDetected_26.lock __construct [ 2014-08-22 11:08:32 ] UID:7 NOTICE system2\Daemon(vlc) __construct [ 2014-08-22 11:08:32 ] UID:7 NOTICE system2\Daemon(motion) __construct [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\Lock-motionDetected_11.lock __construct [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\Lock-motionDetected_11.lock delete [ 2014-08-22 11:08:32 ] UID:11 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\Vlm control CAM_11_mtn stop [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\Vlm del CAM_11_mtn [ 2014-08-22 11:08:32 ] UID:11 NOTICE system2\BBRecStream moveToNfs [ 2014-08-22 11:08:32 ] UID:11 NOTICE system2\BBRecStream insert into archive values(0, 11, 'mtn', 1408691293, 1408691311, 1408691312, 0.00010013580322266, 'yes', 0, '/home/vlc/dvr/nfs/mtn/1/20140822/11_110813') [ 2014-08-22 11:08:32 ] UID:0 NOTICE system2\MoveVideoCommand ffmpeg -y -i /home/vlc/dvr/tmpfs/mtn/1/20140822/11_110813.avi -codec copy /home/vlc/dvr/nfs/mtn/1/20140822/11_110813.mp4 [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\HLSVlcStream update [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\HLSVlcStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_17_lhttp stop [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\HLSVlcStream rm -rf /home/vlc/dvr/tmpfs/lhttp/2/stream-17 [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\BBRecStream update [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_17_rec stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_17_rec [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Lock-time_CAM_17_rec.lock create [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\TimeLock time_CAM_17_rec.lock [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\BBRecStream update [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_17_mtn stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_17_mtn [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_17_mtn stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_17_mtn [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Lock-time_CAM_17_mtn.lock create [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\TimeLock time_CAM_17_mtn.lock [ 2014-08-22 11:08:34 ] UID:17 NOTICE system2\UrlFlvVlcStream update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\Cam update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\Streams update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\MotionStream update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBLiveStream update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBLiveStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_live stop [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\HLSVlcStream update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\HLSVlcStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_lhttp stop [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\HLSVlcStream rm -rf /home/vlc/dvr/tmpfs/lhttp/2/stream-18 [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\HLSVlcStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_lhttp stop [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\HLSVlcStream rm -rf /home/vlc/dvr/tmpfs/lhttp/2/stream-18 [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBRecStream update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_rec stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_18_rec [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_rec stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_18_rec [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Lock-time_CAM_18_rec.lock create [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\TimeLock time_CAM_18_rec.lock [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBRecStream update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_mtn stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_18_mtn [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_mtn stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_18_mtn [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Lock-time_CAM_18_mtn.lock create [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\TimeLock time_CAM_18_mtn.lock [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\UrlFlvVlcStream update [ 2014-08-22 11:08:34 ] UID:18 NOTICE system2\UrlFlvVlcStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_18_l_flv stop [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\Cam update [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\Streams update [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\MotionStream update [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\BBLiveStream update [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\BBLiveStream start [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_19_live play [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\HLSVlcStream update [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\BBRecStream update [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Lock-time_CAM_19_rec.lock create [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\TimeLock time_CAM_19_rec.lock [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\BBRecStream update [ 2014-08-22 11:08:34 ] UID:19 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm control CAM_19_mtn stop [ 2014-08-22 11:08:34 ] UID:0 NOTICE system2\Vlm del CAM_19_mtn [ 2014-08-22 11:08:35 ] UID:0 NOTICE system2\Lock-time_CAM_19_mtn.lock create [ 2014-08-22 11:08:35 ] UID:19 NOTICE system2\BBRecStream stop [ 2014-08-22 11:08:35 ] UID:0 NOTICE system2\Vlm control CAM_19_mtn stop [ 2014-08-22 11:08:35 ] UID:0 NOTICE system2\Vlm del CAM_19_mtn [ 2014-08-22 11:08:35 ] UID:19 NOTICE system2\UrlFlvVlcStream update [ 2014-08-22 11:08:35 ] UID:20 NOTICE system2\Cam update [ 2014-08-22 11:08:35 ] UID:20 NOTICE system2\Streams update [ 2014-08-22 11:08:35 ] UID:20 NOTICE system2\MotionStream update [ 2014-08-22 11:08:35 ] UID:20 NOTICE system2\BBLiveStream update [ 2014-08-22 11:08:38 ] UID:20 NOTICE system2\BBLiveStream stop [ 2014-08-22 11:08:38 ] UID:0 NOTICE system2\Vlm control CAM_20_live stop [ 2014-08-22 11:08:38 ] UID:20 NOTICE system2\BBLiveStream start 


Logs writes a lot. Not production after all.

The current load on the network interface (iptraf-ng) in-15000 kbps, out 1500 kbps.
FreeNas load:

image

Gigabit interface, worth ZRaid2 + hard body (ZLog?)
Freenas:
Intel® Core (TM) 2 Duo CPU E4500 @ 2.20GHz
Memory: 4006MB
Load average 0.15, 0.16, 0.11

Records
image
Green - permanent record
red - motion records
blue - timelapse

We look record on the movement. And the truth is movement:

image

And all events are put in sql.

That timelapse arrived in the last hour.
Duration 20 seconds.
You can see something like this:

image

If 1 hour can be viewed in 20 seconds, then 1 day can be viewed in 8 minutes.

This is how it is possible to collect something formalized and working from improvised means.

I do not spread the video as the cameras are private. In the screenshots there is a public space that anyone can enter.

PS
[vlc@dvr 7]$ uptime; 11:36:09 up 1:19, 2 users, load average: 0.31, 0.35, 0.33
calc@vm001:~$ uptime; 11:37:05 up 20:33, 1 user, load average: 0.01, 0.02, 0.03

Source: https://habr.com/ru/post/234243/


All Articles