SlimNVRSlimNVR

Extensible technical reference

Technical Knowledge Base

Last updated: September 20, 2026

A shared vocabulary for cameras, recorders, network media, and smart-home systems. The articles emphasize verifiable standards, operational trade-offs, and honest capability boundaries for solution design and client education.

Search titles, article text, and keywords. Suggestions update as you type.

SlimNVR
Video hardwareMap the path from lens to recordingCameras, DVRs, NVRs, and browsers do different jobs. A clear data path is the foundation of a sound design.

An analog camera sends a signal to a DVR for digitization and encoding. An IP camera normally encodes at the camera and sends a network stream to an NVR. Hybrid recorders can accept both.

Estimate capture, live viewing, continuous recording, event extraction, and AI inference separately. They may share a source without sharing one processing pipeline.

  • Record resolution, frame rate, bitrate, audio, and night-view requirements per channel.
  • Keep a main stream for evidence and consider a substream for grids or low-rate analysis.
  • Size networking and SSD retention for the worst credible case.
cameraDVRNVRIPCmain streamsubstreamtopology
Video hardwareCamera product families and use casesBullet, dome, PTZ, fisheye, thermal, and doorbell cameras solve different problems; megapixels alone are not a design method.

Bullet cameras provide an obvious fixed direction; dome and turret models suit interiors and eaves; PTZ cameras can pan and zoom but see only one direction at a time; fisheye cameras trade distortion for broad coverage. Multi-sensor panoramas, dual-light or low-light models, and thermal cameras target wide areas, night color, and temperature contrast respectively.

Doorbell, battery, and cellular cameras emphasize two-way audio, wake time, and cloud dependence. Industrial, mobile, and body-worn products add vibration, ingress protection, shutter, and mobile-network constraints. Validate field of view, target pixel density, backlight, night motion, audio, ONVIF/RTSP, power, and maintenance rather than relying on a family name.

  • For long-range identification, focal length and pixels on target often matter more than total sensor resolution.
  • A PTZ tour cannot preserve every direction simultaneously; fixed cameras still protect critical views.
  • Thermal contrast detection is not the same as visible-light face or license-plate identification.
bulletdometurretPTZfisheyepanoramicthermaldoorbelllow lightcellular camera
Video hardwareAnalog, HD-over-coax, and IP camerasCVBS, HD-TVI, AHD, HDCVI, and IP belong to different transport families; a familiar connector does not guarantee compatibility.

CVBS carries standard-definition analog video. HD-TVI, AHD, and HDCVI can carry higher-definition video over coax, but the receiver must support the same format. IP cameras send encoded data over Ethernet and commonly use PoE.

A coax installation can often retain cabling with a compatible DVR. New projects should plan switching, PoE budget, segmentation, and security together.

CVBSHD-TVIAHDHDCVIcoaxPoEanalogdigital
Video hardwareONVIF and multi-vendor interoperabilityAn ONVIF Profile describes a declared set of capabilities; it does not make every feature identical across brands.

Profile S covers fundamental streaming, Profile T adds newer media and event capabilities, and Profile G addresses edge storage and retrieval. Verify the conformance entry and firmware, then test video, audio, time, events, and playback.

ONVIFProfile SProfile TProfile Ginteroperability
Streaming and codecsRTSP, RTP, TCP, and UDPRTSP controls a media session and RTP commonly carries the media. TCP and UDP are transport choices, not quality modes.

UDP minimizes transport delay but packet loss can produce visible corruption. RTSP interleaved TCP carries RTP over the control connection, often improving completeness and firewall traversal while potentially adding delay under congestion.

SlimNVR separates preview from recording: preview optimizes latency and browser compatibility; recording prioritizes continuity. WebRTC is not synonymous with UDP because connectivity negotiation may fall back to other paths.

  • TCP is often the safer capture choice for legacy DVRs.
  • Do not expose RTSP directly to the Internet; use a VPN or protected gateway.
  • Separate workers can reconnect independently so viewing does not interrupt evidence recording.
RTSPRTPTCPUDPinterleavedpreviewrecording
Streaming and codecsH.264, H.265, and smart codecsEncoding, containerization, and transport are separate layers. Parameter sets, timestamps, and keyframes all affect compatibility.

H.264 has broad playback support. H.265 can reduce bitrate at similar subjective quality but has less support on older browsers and hardware. Vendor H.264+ or H.265+ modes may use dynamic GOP and scene-aware bitrate strategies.

When a third-party decoder shows corruption, first disable enhanced modes, select standard H.264, choose stable frame/keyframe settings, and compare RTSP/TCP. Not every decoder error proves a proprietary codec.

  • Stream copy changes the container without generation loss or heavy CPU use.
  • Transcode only when timestamps, dimensions, or decoder requirements demand it.
  • Retain a short original sample and logs for reproducible diagnosis.
H.264AVCH.265HEVCH.264+macroblockSPSPPSGOP
Streaming and codecsBrowser playback: WebRTC, MSE, and HLSBrowsers generally do not open RTSP directly; a gateway presents a browser-compatible transport and container.

WebRTC targets interactive low latency. MSE lets JavaScript append compatible media segments to a player. HLS uses playlists and segments for broad compatibility and caching. A gateway can repackage compatible codecs without re-encoding and normalize only incompatible tracks when necessary.

WebRTCMSEHLSM3U8browserremuxlatency
Edge intelligenceAIoT and edge computingFiltering near the site reduces upstream data and keeps sensitive data under local control.

AIoT connects sensors, networks, event rules, and machine learning. A DVR motion event can cheaply gate work before SlimNVR extracts a high-quality segment, avoiding continuous inference on every main stream.

Keep model confidence, version, and human labels. Image-derived accident, weather, or earthquake signals are supplementary and do not replace certified sensors.

AIoTedge computingevent gatinginferenceYOLOdata sovereignty
Edge intelligenceNTP, OSD, and event-time calibrationMulti-camera editing depends on a shared clock; filenames, container timestamps, and on-screen time should be cross-checked.

NTP brings devices close to a common reference, but encoding buffers, time zones, and load can still offset an OSD. Compare the email body event time with the first-image OSD statistically rather than trusting configuration alone.

Record each event-to-OSD delta and inspect its median, dispersion, and outlier rate. Apply the correction only after it meets a defined trust threshold, and retain the quality result.

NTPOSDtimestampcalibrationevent emailoffset
Security and governanceNetwork and data governance for security videoRecording reliability, access control, and privacy are equally important. Cameras should not be exposed directly to the public Internet.

Use a controlled segment, unique strong credentials, VPN, least privilege, and current firmware. Publish only an authenticated reverse proxy—not camera administration, RTSP, or container ports.

Define rolling recording, long-lived event, export, deletion, and audit policies. Back up critical evidence because one NVR is not disaster recovery.

securityVPNVLANHTTPSreverse proxyprivacybackup
Smart homeMatter, Thread, and home automationMatter defines application interoperability; Thread is one low-power IPv6 network it can use. They are not the same layer.

Matter may run over Thread, Wi-Fi, or Ethernet. High-bandwidth NVR video should not be reduced to a Matter feature. A better boundary exposes authorized events, doorbell, or occupancy state to automation while keeping raw video in a dedicated security path.

MatterThreadBorder RouterIPv6smart home
Smart homeGoogle Home technology pathGoogle Home combines Home APIs, Matter, and platform services for devices, automations, and mobile applications.

A device can join through Matter or a platform-supported cloud path. Developers should choose by device type, certification, control latency, and offline behavior.

An NVR should expose only authorized events or automation state, not publish its administration interface or private RTSP feed as a public service.

Google HomeHome APIsMatterNestautomation
Smart homeApple Home and HomeKit/MatterApple Home uses Apple devices, a home hub, and compatible accessories for local control, automation, and secured access.

New accessories can use Matter or Apple accessory technologies. A home hub provides remote access and some automations; exact capabilities depend on device class, software version, and region.

A video design must distinguish official Apple camera capabilities from a private web player. Playback in Safari alone is not a HomeKit integration.

Apple HomeHomeKithome hubMatterHomePodApple TV
Smart homeXiaomi and Huawei smart-home ecosystemsEach platform has its own device model, accounts, gateways, and certification path; LAN reachability is not ecosystem integration.

Xiaomi IoT combines device specifications, cloud/local connectivity, and the Mi Home entry point. HarmonyOS Connect provides onboarding, distributed capabilities, and a certification path. Check the current developer program for the intended market.

A cross-ecosystem design can begin with Matter or a well-defined event API. Camera work still needs explicit authorization, privacy, regional-data, and streaming decisions.

XiaomiMi HomeXiaomi IoTHuaweiHarmonyOS Connectecosystem
Video hardwareCommon terms and specification checklistRead specifications by layer: resolution, frame rate, bitrate, GOP, container, and channel answer different questions.

Resolution counts pixels per frame; FPS counts frames per second; bitrate measures data per second; CBR and VBR are rate-control strategies; GOP describes key and predicted-frame structure; a codec defines compression while MP4 and MPEG-TS are containers.

PoE supplies power over Ethernet, BNC is common on coax equipment, WDR addresses high-contrast scenes, and a channel is a recorder's logical input. Always compare units, stream selection, and feature preconditions.

resolutionFPSbitrateCBRVBRGOPI-framecodecMP4PoEBNCWDRchannel
Streaming and codecsLegacy Hikvision DVR compatibility layer: implementation and limitsSlimNVR separates control, containers, RTP packetization, timestamps, and coded video instead of labeling every fault “proprietary H.264.”

A standard RTSP path uses DESCRIBE, SETUP, and PLAY; SDP describes H.264 and RFC 6184 defines carriage over RTP. Hikvision's SDK is a separate acquisition path: its official structures distinguish private-protocol PS or RTP, standard RTSP, several container types, and “private 264” versus standard H.264. SlimNVR currently uses RTSP, does not load the native Hikvision SDK, and does not disguise an SDK PS/RTP path as ordinary RTSP.

H.264+ is a third layer: a vendor smart-compression strategy that can alter GOP and bitrate allocation. It is neither a PS container nor an RTP packetization mode. Disabling H.264+ and establishing a standard-H.264 baseline is a useful diagnostic step, but does not prove every observed failure came from H.264+.

On this DS-7104HC-E1 playback SDP advertises packetization-mode=0, while field captures commonly contain a single NAL payload of about 8 KiB in TCP-interleaved RTP. RFC 6184 mode 0 permits single-NAL packets and not FU-A. A large NAL may reach one client over the DVR's TCP connection yet fail at a relay with a standards-sized packet limit. This is an observation for this device and firmware, not a claim about all Hikvision products.

For A1, gortsplib requests an absolute Range: clock and creates a one-shot RTSP service on container loopback. Its downstream SDP advertises mode 1. NAL payloads above 1300 bytes are split into RFC 6184 FU-A packets while preserving timestamps, marker, NAL type, and start/end bits and assigning continuous sequence numbers. FFmpeg reads that local feed over TCP. The operation changes RTP boundaries, not H.264 picture semantics, and exposes no host port.

A2 takes a different transparent-control path. SlimNVR performs Digest authentication, URL rewriting, and absolute PLAY Range injection. After PLAY succeeds, it forwards the TCP-interleaved media bytes between DVR and local FFmpeg byte-for-byte, without depacketizing or repacketizing. This retains FFmpeg's verified native behavior for that legacy track instead of assuming A1's repair is universally correct.

The post-processing fallback is layered: capture over RTSP/TCP and stream-copy the source bitstream while generating timestamps and discarding explicitly corrupt packets; verify the event second with one OSD read; then decode only the short event window and produce a precise 352×288, CFR 25 fps, H.264 Baseline Level 3.0, two-second-GOP, AAC file. Remuxing, timestamp repair, and re-encoding solve different classes of failure.

With live555, VLC can use a larger receive frame buffer together with RTP reordering and TCP or transport fallback paths, so it may tolerate a legacy DVR better than a stricter default pipeline. Those are buffering and transport safeguards, not a secret Hikvision decoder.

No compatibility algorithm can reconstruct pixels when a packet, NAL slice, SPS/PPS, or reference picture was already lost upstream. SlimNVR validates duration, frame count, maximum frame gap, and OSD, rejecting a bad sequence instead of presenting interpolation or decoder concealment as original evidence.

  • A1: mode-0 large NAL → loopback mode-1 FU-A repacketization.
  • A2: proxy only the control plane; pass media bytes unchanged after PLAY.
  • Both tracks use absolute DVR playback time and an OSD gate.
  • Standards-conforming output cannot restore missing evidence.
HikvisionDS-7104HC-E1RTSPHik SDKPSRTPH.264+packetization-mode 0mode 1FU-A8 KiB NALTCP interleavedgortsplibFFmpegOSDVLClive555
Security and governanceSlimNVR rate limits, media reuse, and training retentionSmall previews, on-demand HD, and retained labelled evidence. Caching never makes private footage public.

Safety rollout: expired unlabelled media currently moves to recoverable quarantine, not permanent deletion. Quarantined files still occupy disk space.

Public static assets use one-hour caching and content-hash ETags. Only an actual SHA-256 version parameter receives immutable caching. Login, OAuth, and APIs default to private/no-store; specific media handlers may permit private browser caching, never shared caching.

Google administrator sessions, ingest tokens, and the Telegram secret header remain mandatory. Nginx enforces trusted-client-IP limits for login/API requests; bounded application token buckets provide aggregate proxy-peer limits and ignore arbitrary forwarded IP headers. Valid machine credentials have separate budgets from invalid requests. A 429 asks senders to retry, while mutations also check origin and body size. Streaming frames are not individually throttled.

Continuous recordings and unlabelled event images, previews, HD sources, and exports expire after 24 hours and are removed in bounded batches. Any human label, including false positives, protects the entire related event group and its training sources. Cleanup checks references, active jobs, labels, and paths and refuses symlinks or unknown locations. Text records and expiry tombstones remain to prevent old jobs from recreating expired media. Telegram, mail-gateway, and backup copies have independent lifecycles.

Intros and outros are pre-cropped. Motion mail sends only its first original photo and labeling buttons; automatic 176×144 video generation is disabled. Request a branded 704×576 A1/A2 export within 24 hours from Telegram or the event page. Only then are clips retrieved, aligned and rendered, with download and Telegram delivery. Pending jobs protect local sources; DVR recordings must remain available. Calibrated sources and completed exports are cached; labeled originals remain retained.

Observed costs include DVR playback retrieval, OSD calibration, decoding, and final rendering. Expired unlabelled replay jobs should stop before adding CPU. Docker local logs rotate at 10 MB × 3 per container; NVR access logs omit query strings, cookies, and webhook path secrets. These controls do not replace patching, independent backups, or upstream DDoS protection.

rate limit429ETagcache24 hoursdatasetlabelslogsHD exportperformance
Edge intelligenceHourly weather observations: trustworthy inputs before dashboardsSunny, cloudy, and rain samples accumulate daily. Image features, model estimates, and on-site measurements remain distinct.

SlimNVR first reuses a recent DVR motion email image each hour; if none is available, it requests one small frame from the local stream. It stores brightness, contrast, and blue-pixel ratio without uploading images, retaining extra photos, or running continuous weather inference. Without a confirmed sky region, image classification stays unknown; a single photograph does not establish rainfall.

Open-Meteo nearby-grid weather codes, temperature, cloud cover, precipitation fields, and original timestamps are stored separately and labelled as numerical-model estimates, not rain-gauge readings. An available model reply supplies the primary classification. Missing or stale replies are not invented observations, and clear nights are not sunshine.

Statistics show hourly samples and daily sunny, cloudy, rain, other, unknown, and missing counts. Numeric observations and daily aggregates are retained long term; retries cannot duplicate an hour. Days containing different conditions can overlap. Counts are neither measured weather durations nor all-day classifications and can later be calibrated against professional sensors.

weathersunnycloudyrainhourlydaily statisticsOpen-Meteosky ROIbrightnesssunshineIoT
Streaming and codecsAudible recording replay and browser autoplay limitsReplay attempts sound by default and remembers mute choices. Browser policy is not a missing soundtrack.

A1 recordings preserve AAC sound. Both historical playback and the optional continuous playlist retain that track without re-encoding the full recording. A2/A3 recordings remain silent when their source has no microphone audio. A multi-camera event's continuous A1 audio bed is a separate composition feature, not evidence of an A2 microphone.

Browsers may reject audible autoplay without a user gesture. Only that policy rejection falls back to visible muted playback with an Enable sound action; codec and network failures remain errors. Mute preference stays in the browser. The old soundtrack stops before segment handoff, the standby player remains silent, and closing the event dialog stops its audio.

audiomuteAACautoplayNotAllowedErrorplaylistrecording replay
Security and governancePrivate visitor analytics: notifications, pacing, and minimizationMeasure product interest without publishing visitor records or displacing camera-event delivery.

Only successful public HTML page views count. Login, administration, APIs, assets, prefetches, and known bots are excluded; automatic language redirects avoid counting one arrival twice. These are page views, not unique visitors or guaranteed humans. No public visitor-statistics interface is exposed.

At low volume, Telegram sends individual notices or batches of at most five with time, page, browser/system, IP, and approximate city. Above 1,000 views in a Taipei calendar day, outstanding notices use completed-hour summaries. Delivery-ready camera images and videos take priority, and analytics respects the same Telegram backoff deadline; immediate delivery is not guaranteed.

Raw IP, browser, and city records expire after 48 hours in bounded cleanup. Identity-free daily and lifetime totals remain. The existing private lookup service estimates an IP's network-exit location, leaving uncertainty explicit. Only a validated edge proxy can forward client addresses. Records are used by controlled backend services, the lookup provider, and the administrator's Telegram chat; Telegram and backup copies have independent retention.

2026-09-21 update: direction statistics no longer depend on video rendering. Reciprocal unique A1/A2 events within two seconds use notification order as an estimate and count once. Simultaneous, crowded, false-positive or conflicting events remain unknown. This is not an exact vehicle count. Geo lookups retain a one-second response-header budget with a longer bounded background connection allowance; successes persist for 24h, temporary failures for 30s, and missing cities are explicitly identified.

visitor analyticsbrowserIPcityTelegram48 hours1000privacyrate limit
Security and governanceHomepage cache, Redis limits and Cloudflare provenanceHomepage cache, Redis limits and Cloudflare provenance

Nginx and browsers cache only the three public landing pages for seven days. Login, admin pages, APIs and private footage are excluded. A same-origin beacon preserves visit counting on cache hits. Redis atomic token buckets expire; a bounded local limiter remains available during Redis outages, behind Nginx edge limits. These measures cannot absorb a bandwidth-saturating DDoS. Orange-cloud activation also requires Add visitor location headers; only official Cloudflare proxy ranges are trusted. Locations are approximate, not GPS. Successfully persisted labels queue deletion of their Telegram photo within the platform's 48-hour limit. Training originals remain protected; HD exports can still be requested from website events.

NginxRedisCloudflareTelegramcacheDDoS
Video hardwareLow-budget direction lab and single-image learningLow-budget direction lab and single-image learning

Background sampling reads five gray frames from finalized recordings, comparing five-frame tracking, two-frame patch matching and paired alert order. An outline axis does not identify a vehicle front, so it supplies no labels. Administrators separately review motion and heading. A tiny pure-Go per-camera MLP candidate trains at22:00 using human labels, with time-held-out tests, coverage, balanced recall and Wilson confidence bounds. This shadow experiment does not alter production traffic counts or promise80% in one week. A still cannot prove motion. Reviewed compact evidence persists; unreviewed evidence expires after24h, with a256MiB research cap. Review sequences require matching the email photo and recording OSD within one second. Filenames only locate candidates; failed clock checks never become review or training evidence. Each job reads at most five recording clock frames within a20-second deadline. Legacy unverified evidence is quarantined without deleting human labels.

方向取幀光流MLPtrainingbenchmarkmotionheading