Equipment technician: retention-days calculator, single file - days retained computed per channel through disk allocation, never total capacity over aggregate bitrate (that blend dilutes the critical cameras' shortfall); remediation follows a fixed order - lower non-critical bitrates first, then shorten non-critical retention, add disk last - and the tool drafts the client-facing explanation for you
You are a coding agent. Build a single-file HTML "video retention
days calculator" for equipment technicians on guarding
projects. Runs locally, no network, no external dependencies.
Positioning (design to this; do not build a recorder manager):
storage shortfall is a silent risk - invisible daily, fully
due the day the client asks for footage. The tool computes
three things: how many days each channel retains, where the
gap is, and which remediation path applies. Changing configs
and placing purchase orders stay human.
Three input blocks:
1. Disk configuration (disk by disk; no "total capacity"
field):
- Each disk: usable capacity (nominal capacity times
[ ]% for usable - blank, no default) and which
channels it carries
- Where critical points (entries, cashier, perimeter)
sit on dedicated disks, record the real allocation -
this is what makes per-channel math possible instead
of blending
2. Channel list (channel by channel):
- Name, location, critical-point checkbox, main-stream
bitrate
- Bitrate entered from the platform's measured value;
the UI states "enter the platform's measured bitrate,
not the datasheet value"
- Codec (H.264 / H.265 / other) recorded as a channel
attribute for the user's own judgment; the tool embeds
no conversion factor
3. Requirement: retention days required by contract or
client (one global value, overridable per point group
where critical points demand longer)
Calculation logic (formulas shown on the page, each channel
expandable to the full computation - no black box):
- Per disk: daily data growth = sum of (channel bitrate
/ 8 x 86400 s) across its channels
- Per channel retention days = its disk's usable capacity
/ that disk's daily growth
- Gap = required days - measured days, listed per channel
- Blended-comparison row: also show "total capacity /
total bitrate" beside the per-channel minimum - the
distance between the two numbers is exactly what
blended math hides
Checks (trigger red flags; never silently trim inputs to
pass):
1. Unassigned channel: a channel mapped to no disk - red
flag, listed
2. Critical point on a shared disk whose measured days fall
below the site-wide requirement - red flag: "critical
points should be secured first"
3. Bitrate blank or an obviously canned integer - yellow
flag to re-verify against the platform
Remediation (fixed priority, displayed in this order,
never rearranged):
1. Lower non-critical bitrates: candidate channels and
reduction options, each with the standing note "lower
bitrate degrades playback quality; not recommended for
critical points"
2. Shorten non-critical retention: option to set separate,
lower retention for non-critical channels
3. Add disk: minimum capacity converted from the gap, with
the standing note "consider only after the above two are
exhausted"
The tool shows the numbers and impacts of the three paths
and chooses nothing.
Output:
- Per-channel table: channel / disk / bitrate / measured
days / required days / gap (gap column highlighted,
critical-point rows marked)
- Blended comparison: blended days vs per-channel minimum
- Red/yellow flag list: which check failed, how to fix
- Client-facing text: one click generates a paragraph
(current status, measured days by point class, the gap,
the three remediation paths and their impacts) - measured
wording, no marketing language, ready to paste into the
review minutes
Implementation requirements:
- Single-file HTML, inline CSS and JS, opens on double
click, no network requests
- Nothing persists; refresh clears. Ship one preset
example (two disks, eight channels, one critical-point
gap and one blended-vs-minimum spread) so red flags are
visible on open
- No platform APIs of any kind; bitrates are transcribed by
hand from the platform
You must not:
- Build "smart bitrate optimization" - the bitrate-versus-
quality tradeoff belongs to people and the client; the
tool only lays out numbers
- Predict "how long it will last" - disk lifespan and bad
sectors are out of scope
- Hard-code the usable-capacity percentage - recorders and
disks differ widely; leave it blank for measurement
- Let marketing phrases ("superior performance", "industry-
leading") anywhere near the generated client text - that
paragraph is destined for review minutes, not a brochure
Why it is written this way
Per-channel math instead of blended math is the reason this tool deserves to exist. Storage shortfalls are never evenly distributed: critical points usually sit on dedicated high-bitrate disks while shared disks carry a pile of low-bitrate channels - divide total capacity by total bitrate and the low-bitrate channels inflate the result, diluting the critical cameras' gap into invisibility. And the footage the client requests is precisely from entries and cashiers. Showing the blended number and the per-channel minimum side by side puts the spread on the table, so the technician can explain the most common true problem - "the average is fine, the critical points are not".
Writing remediation as a fixed priority (bitrate, then retention, then disk) installs a brake on field decisions. The technician's first instinct facing a gap is often a purchase order, because adding a disk touches no existing configuration; but zero-cost room is usually hiding in non-critical bitrates and retention, and leading with a purchase order invites the client's first reaction: "why does this start with spending money?" Laying out the three paths with numbers, impacts, and a fixed order - and leaving the choice to the human - keeps the tool on its side of the "show numbers, decide nothing" boundary.
Measured bitrates mandatory, usable-capacity percentage blank: two lines of resistance to "looking precise". Datasheet and actual bitrates diverge enough to skew the days materially, and usable-capacity conventions vary even more between recorders. Better to make the user transcribe one more number than to embed a professional-looking coefficient that is actually wrong - a calculator's credibility rests on every input being checkable, which is also why every channel's full computation is expandable on the page.
The generated client-facing text is the closing piece: results end up in review meetings, and when wording is improvised by different people each time, the client starts suspecting the numbers move. One click, fixed wording, facts and options only - the tool's output becomes the raw material for client communication instead of a technician's private spreadsheet.
Variables
| Variable | Description |
|---|---|
| Retention requirement | Days required site-wide / per point group by contract or client - where no written requirement exists, use this calculation as the occasion to put one into the service confirmation; silent requirements turn into disputes on footage day |
| Where measured bitrates come from | Which platform page shows each channel's main-stream bitrate - write it into the work instruction; transcribe one channel wrong and that channel's days are wrong |
| Usable-capacity percentage | Each disk's nominal-to-usable factor - fill from the actual post-format value on this site's recorder, not from habit |