Skip to content

Footage ​

The timeline, the event feed and the footage tools in the monitor

Footage is an event log, not video

The server never stores video. A camera "records" when something happened in front of it. A clip is a saved window of that log, and a still is a clip with one picture. Playback never replays the scene: the timeline head moves, and the big view shows the nearest saved still or an archive placeholder.

What a camera records ​

Every camera keeps a rolling log of events. The monitor draws them on the 24 hour timeline and in the feed.

Kind Written when
motion A person or vehicle is inside the camera's view cone while the site is open
after_hours The same, while the site is closed. Shown in orange
offline The camera lost its recorder (carried away, destroyed, out of range)
restored It is back online
blinded Somebody covered the lens
cleaned Somebody cleaned it
tamper A recorder was stolen or smashed. Written after the footage is wiped, so it survives
register A till opened. By np_shops, or by your own script with logEvent
footage Footage of the camera was handed over (for example to the police)
custom Anything else: a robbery clip from np_shops or np_banking, a prison alert, your own logEvent

Status events (offline, blinded, cleaned, restored, tamper) are written even when the camera is not recording. Other events need an online, unblinded camera. A camera keeps at most Config.Recording.eventsPerCamera (600) events.

Motion sensing ​

Every Config.Recording.motion.tickSeconds (3 s) each recording camera looks for people and vehicles inside its current view cone, which follows PTZ pan, tilt, zoom and the patrol sweep. Positions come from the server.

  • Subjects. Players on foot are person, a player in a vehicle is vehicle. Config.Recording.motion.subjects switches either off. The motionSubjects hook can replace the list (Exports).
  • Merging. Sightings within mergeSeconds (25 s) of the last one extend a single event instead of writing a new one.
  • Authorised people. With ignoreAuthorised = true, people who hold a key or have job access to the site do not trigger events.
  • No line of sight. Motion is judged by position and cone. A person behind a wall but inside the cone is seen.

After hours ​

A site can have opening hours (hours = { open = 8, close = 22 }, a wrapping range such as 20 to 6 works too). While the site is closed, motion is logged as after_hours instead of motion. The clock is Config.World: the server's wall clock ('real') or the GTA day ('game'), shifted by hourOffset.

A site without hours is always open and logs plain motion. Opening hours come from Config.Networks or exports.np_cctv:registerNetwork (Monitor); sites that players create by placing a recorder have none.

Owner alerts ​

When a camera logs motion, the owner of the site gets an np_phone banner with the event and the camera name, without np_phone a toast. By default only after_hours alerts, with a cooldown of 120 seconds per camera (Config.Recording.motion.alert). Job networks have no owner, so nobody is alerted. tamper and blinded events are also logged to np_discord's cctv channel when np_discord runs.

Retention ​

  • A recorder keeps events for its buffer: 48 hours, or a week on the Pro (Cameras). A sweep every pruneSeconds (600) deletes older events. A script can change this with the retentionHours hook.
  • Events of a camera whose recorder is gone are kept for the length of the feed window plus a day and a half.
  • Cloud backup. A manager switches it on per recorder in the monitor. The footage is then kept for Config.Recording.backupHours (168) and survives the recorder being stolen or smashed. It costs Config.Backup.fee once (np_payments, else framework money).
  • A destroyed recorder without backup loses its events and the clips saved on it.

Clips and stills ​

Clip A saved window of one camera's log. The Clip button saves the last Config.Clips.defaultSeconds (180 s) up to now; at most maxSeconds (900 s), at most maxPerNetwork (60) clips per site. It must lie within what the recorder still has
Still One picture from the camera, taken with screenshot-basic on the viewer's client. Without it a still is saved without a picture. The upload is ticketed, one use, size-capped at stillMaxBytes and must be a JPEG

Anybody who may watch can save a clip or a still. Managers can delete clips. A clip lives on its recorder like the events do, until it is exported. Hooks can refuse: beforeClip.

Sharing ​

Sharing is for managers of the site. Each route detaches the clip from the recorder, so it lives on without it.

A clip on a USB stick, opened in viewer mode

USB export ​

Export to USB gives you a cctv_usb item that holds the clip (clipId, serial, networkId, description). Using the stick opens the monitor in viewer mode on that clip, for anybody who holds it. It needs an inventory.

Hand to police ​

Hand to police asks for a case id:

  • With an inventory, the stick goes into the case's evidence stash (Config.Share.evidenceStash, default evidence:<case>, registered through the inventory). If the stash cannot take it, you get the stick instead.
  • With np_surveillance, a cctv_event intel is filed on that case (Integrations), whatever the site kind. This is how footage reaches a case. Config.Share.intel = false switches this off.
  • A footage event is written on the camera and np_discord's cctv channel gets a line.
  • Without a case id you get the stick to hand over yourself, and the intel is filed without a case.

Hooks can refuse USB export and case hand-over: beforeExport.

Push a still to a screen ​

To screen shows a saved still on the nearest np_screens screen. np_cctv serves the picture under /np_cctv/still/<token>.jpg and np_screens fetches that link, which is valid for Config.Share.tokenSeconds (600 s).

lua
-- shared/config/monitor.lua
Config.Share.baseUrl = 'http://127.0.0.1:30120'   -- how np_screens reaches this server

baseUrl must be an address np_screens can reach (http://127.0.0.1:30120 on the same machine). Empty switches pushing to screens off. The clip must have a picture, so this needs screenshot-basic. Any viewer may use it.

Evidence from other resources ​

  • np_shops: a purchase is logged as register on the camera within Config.Share.registerRadius (14 m) of the buyer. A robbery saves what up to four cameras within evidenceRadius (45 m) saw as clips of the last 180 seconds.
  • np_banking: robbery evidence of type cctv becomes the same clips for the cameras around the bank.
  • np_prison: the alert level of a facility becomes a custom event on the first camera of every network with feeds = { np_prison = true }.
  • Your script: logEvent and saveClip (Exports).