CCTV Calc — how the math works

Every number the app shows, and where it comes from.

The app is a planning tool. Each section below gives the formula, the constants and the standard it follows, so you can check any result by hand and know where a real installation may differ.

Storage and bandwidth

Bitrate. Unless you enter the camera's configured bitrate, each stream is estimated from a reference point of 4,000 kbps for 1080p (2.07 MP) H.264 at 30 fps in a typical scene. Bitrate grows with pixel count sublinearly, because larger frames compress better per pixel; an exponent of 0.8 reproduces the common vendor tables (about 2 Mbps at 1 MP, 6 Mbps at 4 MP, 12 Mbps at 8 MP).

kbps = 4000 × (MP ÷ 2.0736)^0.8 × (fps ÷ 30) × codec × scene
Codec factorScene factor
H.264 1.00 · H.264+ / smart 0.60 · H.265 0.55 · H.265+ / smart 0.30Low (indoor, static) 0.7 · Medium 1.0 · High (traffic, foliage, night noise) 1.4

Frame rate scales linearly, which is conservative for inter-frame codecs at high frame rates. Multi-sensor cameras multiply the stream by the sensor count.

Storage. Bytes per day = kbps × 1000 ÷ 8 × 86,400 × duty, where duty is 1 for continuous recording, the percentage you set for motion recording, or hours ÷ 24 for a schedule. Storage is shown in decimal terabytes, the unit drives are sold in; an NVR menu that shows TiB will read about 9% lower.

required TB = bytes/day × retention days ÷ 10¹²
drives = ceil( required × (1 + headroom) ÷ (drive size × (1 − overhead)) ), then RAID

RAID 1 mirrors (half the drives usable), RAID 5 spends one drive on parity (minimum 3), RAID 6 two (minimum 4), RAID 10 mirrors pairs (minimum 4). Days from installed divides the usable installed capacity by the bytes per day. Incoming bandwidth is the sum of the main streams, which flow whether or not they are being written; remote viewing assumes each viewer opens the full grid on sub-streams.

PoE budget

Power over Ethernet loses power in the cable as heat. The app solves the DC circuit for each device: the switch port pushes Vpse; the cable's loop resistance R drops it; the device draws its rated power P at whatever voltage reaches it.

V_pd = ( V_pse + √( V_pse² − 4 · P · R ) ) ÷ 2
I = P ÷ V_pd · loss = I² · R · port must source = P + loss

R = r × L for 802.3af/at (two pairs, two conductors in parallel each way) and r × L ÷ 2 for 802.3bt (four pairs), with r the conductor resistance per 100 m and L the run length. If the square root goes negative, the cable cannot deliver that power at all.

StandardPort may sourceDevice may drawSwitch minimumDevice minimumPairs
802.3af, Type 115.4 W12.95 W44 V37 V2
802.3at, Type 230 W25.5 W50 V42.5 V2
802.3bt, Type 360 W51 W50 V42.5 V4
802.3bt, Type 490 W71.3 W52 V41.1 V4
CableResistance per 100 m per conductor
Cat5e, 24 AWG copper9.38 Ω (TIA-568 maximum)
Cat6 / Cat6A, 23 AWG copper7.6 Ω (typical)
CCA, 24 AWG copper-clad aluminum14.0 Ω (not TIA-compliant; for troubleshooting existing runs)

Classes 1–8 follow IEEE 802.3: the smallest class whose device allowance covers the draw. A device is flagged when the port would exceed its limit, when the device would see less than its minimum voltage, or when it sits within 10 percent of the port limit. Max run for power searches for the longest cable that keeps all three within limits, up to 500 m; Ethernet data still stops at 100 m (328 ft), which the app states separately. The switch's minimum voltage gives the conservative result; enter the real output (often 53–54 V) for a real-world figure.

UPS runtime = battery Wh × inverter efficiency × usable charge ÷ load, where the load is the PoE the switch sources ÷ 0.9 (conversion loss) plus the NVR and anything else on the UPS.

Lens and coverage

HFOV = 2 · atan( sensor width ÷ (2 · focal length) )
scene width = 2 · distance · tan( HFOV ÷ 2 )
pixels per meter = horizontal pixels ÷ scene width · pixels per foot = px/m × 0.3048

The datasheet's horizontal field of view is the accurate input; sensor widths (1/3″ 4.8 mm, 1/2.8″ 5.4 mm, 1/2.5″ 5.8 mm, 1/1.8″ 7.2 mm, 1/1.2″ 10.7 mm) are nominal and vary by model. DORI levels follow IEC 62676-4: Detect 25, Observe 62.5, Recognize 125, Identify 250 pixels per meter. The maximum distance for a level is pixels ÷ (2 · tan(HFOV ÷ 2) · px/m). Lens for a target runs it backwards: the scene width that carries the level at the distance, the field of view that gives it, and the focal length for the chosen sensor (f = sensor width × distance × px/m ÷ pixels).

Where the real world differs