DIY outdoor CCTV system short how-to. ------------------------------------- Requirements: ------------- - keep video streams on disk for 30+ days; - online access to the streams from desktop browser and iOS devices (no flash); - unstable ip uplink tolerance; - night vision; - no clouds (thanks); - minimum wiring (i.e. PoE) and reasonable CPU power requirements; - moderate costs; - learn nginx-rtmp-module; - get some fun. At this point these are not required: - motion detection; - face recognition; ... Hardware: --------- 1. Cameras: 2x HiWatch DS-N201, 1x DS-I110. All are IP66, rtsp/h.264, PoE. With the default settings (1024x768, up to 2mbps stream, medium quality, 25fps) each camera creates ~40MB in 5 mins. This gives us 24 hours * 12 t/slots * 40MB * 3 cams = 40GB/day roughly or 1.2TB/month. This is not that big these days but you can decrease this amount greatly by reducing fps or quality or resolution. 2. It makes all sense to use a simple PoE switch. Mine is TP-Link TL-SF1008P. 3. Server box with moderate CPU power and big enough storage. Mine is HP Microserver Gen8 with 2x3TB 3.5" SATA HDDs. Software: --------- 1. Unix-like system: I'm happy with FreeBSD 10.3, your mileage may vary (tm). 2. nginx + nginx-rtmp-module: super-powerful combo. 3. ffmpeg: even more powerful -- I don't know anybody who was able to read ffmpeg man page from the beginning to the end. Configuration: -------------- Some essential parts of nginx.conf: # nginx-rtmp-module wiki: https://github.com/arut/nginx-rtmp-module/wiki # nginx-rtmp-module habrahabr (on Russian): https://habrahabr.ru/post/162237/ http { <...> # HLS location for iOS devices. location /hls { root /var/tmp/nginx; } } rtmp { server { listen 1935; application cctv { allow publish 127.0.0.0/24; allow publish 10.82.64.3; deny publish all; allow play all; live on; # HLS fragments generation. hls on; hls_path /var/tmp/nginx/hls; hls_fragment 5s; # nginx will record all cameras streams # in 5 mins fragments. record video; record_path /cctv/spool; record_interval 5m; record_suffix -%Y-%m-%d-%H-%M.flv; } } } /var/tmp/nginx/hls/index.html: A part of html page for playing flash/rtmp with jwplayer: