PanelSimulator Academy

Video Surveillance, lesson 8 of 14

Recording and storage

A camera that is not recorded only helps the person watching it right now. This lesson shows where video is kept, why a recorder is always full, and how to work out the number of days a disk will hold before you buy it.

About 15 minutes. Read Compression and bitrate first.

Watch a disk fill

Pick a situation, then play or step through. Each slot on the disk holds the days written in it.

Camera Recorder Day 1 disk 1 second disk bay, empty disk 2, a mirror of disk 1 Recording

The everyday picture

Picture a whiteboard calendar in a kitchen with room for four weeks. When the board is full, you do not buy a second board. You wipe the oldest week and write the new one in its place.

The board is always full, and that is normal. What matters is how far back it reaches. If someone asks what happened five weeks ago, the answer was wiped.

A video recorder works the same way. It writes until the disk is full, then writes over the oldest video, forever. The number of days it reaches back is called the retention. Retention is the thing you design, and disk size is only how you get it.

Four places to keep video

  • Network video recorder A box made for one job, usually called an NVR. Cameras plug in, often straight into powered ports on its back. It has room for one to eight disks and its own viewing software.
  • Server with video software An ordinary server running a video management program, with disks inside it or in a separate storage unit. More work to set up, and it grows to hundreds of cameras.
  • Cloud Video travels over the internet to a provider's data center. Nothing on site can be stolen, and you pay each month. Everything depends on the upload speed of the site's internet line.
  • Card in the camera A memory card inside the camera, called edge storage. Good as a safety net that fills the gap when the network drops. Cards are small, they wear out, and a stolen camera takes its video with it.

You will also meet the DVR, the older cousin of the NVR. It takes analog cameras on coax cable and does the compressing itself. The storage ideas in this lesson apply to it unchanged.

NVRServerCloudCard in camera
Typical size4 to 64 camerasTens to thousandsAny, if the internet line allowsOne camera
Cost patternPay oncePay once, plus licensesPay monthly per cameraSmall, pay once
If the internet failsKeeps recordingKeeps recordingStops, unless the camera or a local box holds video until the line returnsKeeps recording
If the equipment is stolen or burnedVideo is lostVideo is lostVideo is safeVideo is lost
Who looks after itYou or your installerAn IT teamThe providerNobody, which is the risk

Many sites mix them. A common pattern is an NVR on site for full-quality recording, with important clips or a lower-quality copy sent to the cloud.

Check yourself

A recorder's disk shows 100 percent full. What should you do?

How many days fit

Compression and bitrate taught that each camera produces a steady stream measured in megabits per second, written Mbps. Storage is that stream multiplied by time. One figure is worth remembering:

1 Mbps, recorded all day, fills about 10.8 gigabytes.

Here is where it comes from. There are 86,400 seconds in a day, so 1 megabit per second is 86,400 megabits per day. Eight bits make a byte, so that is 10,800 megabytes, or 10.8 gigabytes.

From there, the sum is four multiplications:

  1. Cameras times bitrate gives the total stream in Mbps.
  2. Times 10.8 gives gigabytes per day.
  3. Times the days of retention gives the gigabytes needed.
  4. Add about 20 percent, because busy scenes push the bitrate up and a disk should never be planned to the last byte.

Take 8 cameras at 4 Mbps kept for 30 days. The total stream is 32 Mbps. That is 32 × 10.8 = 345.6 gigabytes per day, and 10,368 gigabytes in 30 days. Call it 10.4 terabytes, or 12.4 with the margin.

One trap: disk makers count a terabyte as 1,000 gigabytes, while many computers count in units of 1,024. A disk sold as 4 terabytes shows up on screen as about 3.6. Nothing is missing. The margin in step 4 absorbs it.

Storage calculator

Use the bitrate you measured on the real camera looking at the real scene. A figure from a brochure is a guess.

How much disk does this site need?

Change any figure. The answer includes a 20 percent margin.

written each day
needed for the days asked
with the 20 percent margin
disks of this size to buy

When to record

You do not have to record every second from every camera. The recording mode is the biggest lever on storage after bitrate.

ModeWhat it doesGood forWatch out for
ContinuousRecords all dayEntrances, cash areas, anywhere a gap would hurtUses the most disk
On motionRecords only when the picture changesQuiet rooms and corridorsRetention shrinks without warning when the scene gets busy. Rain, swaying trees and night-time picture noise all count as motion.
On a scheduleRecords in set hoursSites with clear open and closed timesIncidents do not keep office hours
Low all the time, high on motionKeeps a small stream always and a full-quality stream when something movesMost sites. Nothing is ever missing.Needs a recorder and cameras that both support it

When a recorder saves on motion, set it to keep a few seconds from before the trigger and after it ends. These are usually called pre-record and post-record. Without them, clips start a moment too late.

Disks that fail

A recorder's disk works harder than almost any other disk in a building. It writes every second of every day for years. Use disks sold for surveillance or for servers, which are built for that duty. Even so, every disk fails eventually, so plan for it.

The usual protection is to spread video across several disks so that one can die without losing anything. The trade name is RAID.

  • Mirror (RAID 1). Two disks hold the same video. You get the space of one.
  • RAID 5. Three or more disks. You lose the space of one disk, and any one disk may fail.
  • RAID 6. Four or more disks. You lose the space of two, and any two may fail. Preferred for large sets of big disks, because rebuilding onto a replacement can take a day or more and a second failure in that time would be fatal to RAID 5.

RAID guards against one thing only: a dead disk. It does nothing about a stolen recorder, a fire, or video deleted by mistake. For those you need a copy in another place.

Three examples

Simple: a small shop

A shop has 4 cameras averaging 2 Mbps and wants two weeks of video. The stream is 8 Mbps, or 86.4 gigabytes a day. Fourteen days need about 1,210 gigabytes, and 1,450 with the margin. A recorder with one 2-terabyte surveillance disk does the job. The owner accepts that a dead disk means lost video, and asks for an email alert if the disk reports a fault.

Medium: thirty days in four bays

An office has 16 cameras at 4 Mbps and a written policy of 30 days. The stream is 64 Mbps, or 691 gigabytes a day. Thirty days need 20.7 terabytes, and 24.9 with the margin.

The recorder has four disk bays. Four 8-terabyte disks in RAID 5 give 24 terabytes of space, just short. Four 10-terabyte disks give 30. The designer quotes the larger disks, because the day the policy is tested is the wrong day to find that retention is 29 days.

Advanced: the retention nobody chose

A warehouse has 32 cameras at 4 Mbps recording on motion. The designer assumed motion about 30 percent of the time and fitted 16 terabytes for 30 days. On paper it worked: 128 Mbps, times 10.8, times 30 percent, is about 415 gigabytes a day, or 12.4 terabytes a month.

Three weeks after a pallet went missing, the manager asked for the video. The oldest recording was 11 days old.

The cause was the yard cameras. At night their pictures were grainy, and the recorder read the grain as motion. Most cameras were recording nearly all the time, and 16 terabytes holds under 12 days of that.

The fix had three parts. Better lighting and tuned motion zones cut the false triggers. More disks covered the true need. And the recorder was set to raise an alarm when the oldest video is younger than 30 days, so the shortfall can never again go unnoticed.

From the field

  • Check retention by looking, not by calculating. A month after handover, open the recorder and find the oldest video on the busiest camera.
  • Set the clock from a time server. Video with the wrong time is hard to match to an access control event or a receipt.
  • Turn on health alerts for disk faults, recording stopped and camera offline, and send them to a person who will act.
  • Put the recorder in a locked, cool room. Heat shortens disk life, and a recorder on the shop counter leaves with the thief.
  • Give the recorder a battery backup large enough to shut down cleanly. A sudden power cut in the middle of a write can damage the stored video.
  • Write the install date on each disk. When one fails after several years, the others of the same age deserve suspicion.

Common mistakes

  • Sizing storage from the brochure bitrate and never measuring the real one.
  • Promising a number of days on motion recording without a margin for busy weeks.
  • Using desktop computer disks in a recorder that writes around the clock.
  • Treating RAID as a backup.
  • Discovering a failed disk on the day the video is needed, because no alert was set.

Summary

  • A recorder is always full. It overwrites the oldest video, and retention is how far back it reaches.
  • 1 Mbps recorded all day is about 10.8 gigabytes.
  • Storage is cameras × Mbps × 10.8 × days, plus a margin.
  • Motion recording saves space but makes retention depend on how busy the scene is.
  • RAID survives a dead disk. Only a second copy elsewhere survives theft, fire or deletion.

Exercises

Answer each one yourself first, then open the answer.

Exercise 1. One camera averages 3 Mbps and records all day. How many gigabytes does it write in a day?

Show answer
3 × 10.8 = 32.4 gigabytes.

Exercise 2. A site has 8 cameras at 3 Mbps, recording all day, and wants 30 days. How much storage, with a 20 percent margin?

Show answer
8 × 3 = 24 Mbps. 24 × 10.8 = 259.2 gigabytes a day. Times 30 is 7,776 gigabytes, about 7.8 terabytes. With the margin, about 9.3 terabytes.

Exercise 3. A recorder has two 8-terabyte disks set up as a mirror. How much video space is there, and what does the mirror protect against?

Show answer
8 terabytes, the space of one disk. It protects against one of the two disks failing. It does not protect against theft, fire or deletion, because both disks are in the same box.

Exercise 4 (think, don't memorize). A customer's recorder keeps 30 days. They now want 90 days and ask you to "just change the setting". What do you tell them, and what choices do you offer?

Show answer
The setting cannot create space. Ninety days needs three times the storage, or a third of the data. Start by asking why 90 days, and for which cameras. Then offer choices: add disks or a storage unit; keep every camera for 30 days and only the important ones for 90; record quiet cameras on motion, with an alarm on retention; or lower the bitrate or frame rate on cameras where detail matters less, after showing the customer what the picture then looks like.