In-Vehicle Video Recording System: Selection and Storage Design Practices
This article explores the architecture and design practices for in-vehicle video recording systems. It covers system layering, storage capacity estimation, media endurance, and loop recording with event protection. Additionally, it details low-power parking monitoring, data link strategies for local and remote access, common pitfalls, and a comprehensive verification checklist to ensure stable system operation.
1. Requirements Breakdown and System Layering
In-vehicle video recording devices must operate reliably under vibration, temperature fluctuations, frequent power outages, and prolonged idle periods. Their core tasks include continuous recording of driving footage, protecting critical segments during emergencies, monitoring while parked, and enabling playback and data export.
Engineering-wise, the system is typically divided into five subsystems: image capture, video encoding, storage management, power management, and communication. Each layer has distinct metrics. The capture layer focuses on sensor performance in low light; the encoding layer balances bitrate and image quality; the storage layer concerns capacity and write endurance; the power layer manages power-off protection and standby consumption; the communication layer addresses bandwidth and security. Layering first and defining metrics second prevents decisions based solely on isolated parameters.
2. Storage Capacity Estimation
Capacity should be derived from “how long the recording needs to be retained” rather than directly comparing nominal capacities. The calculation formula is:
- Data per hour (GB) = Bitrate (Mbps) ÷ 8 × 3600 ÷ 1024
- Recordable hours = Usable capacity (GB) ÷ Data per hour (GB)
The bitrate here is the average output bitrate of the encoder. With constant bitrate (CBR), it is mostly fixed. With variable bitrate (VBR), more complex scenes result in higher actual bitrates. Therefore, estimations should use the measured average bitrate with an adequate margin.
Usable capacity is also lower than nominal capacity. Formatting the storage media requires reserving space for file system metadata and indexes, and some solutions reserve system partitions. The following sample code demonstrates the conversion:
def retention_hours(capacity_gb: float, bitrate_mbps: float,reserve_ratio: float = 0.05) -> float:"""Estimate the number of hours of continuous recording at a given bitrate."""usable_gb = capacity_gb * (1 - reserve_ratio)gb_per_hour = bitrate_mbps / 8 * 3600 / 1024return usable_gb / gb_per_hourfor cap in (32, 64, 128):print(cap, "GB ->", round(retention_hours(cap, 8), 1), "hours")
Using an 8 Mbps constant bitrate as an example, approximately 1 MB is written per second, totaling about 3.5 GB per hour. Accounting for a 5% reserve, 32 GB allows for roughly 8.6 hours, 64 GB for 17.3 hours, and 128 GB for 34.6 hours. These figures are merely conversion examples; actual results depend on encoding format, resolution, frame rate, and scene complexity.
3. Storage Media Selection and Lifespan
The storage media determines whether the system can operate stably over the long term. Loop overwriting repeatedly writes to the same storage areas, making endurance more critical than raw capacity.
3.1 Soldered vs. Removable Storage
- Soldered storage is fixed directly to the motherboard, ensuring reliable contact and resistance to vibration-induced loosening. Capacity is determined at the factory, and upgrades require hardware replacement.
- Removable storage cards are easy to replace and allow users to expand capacity on demand. However, contacts are prone to oxidation, and quality varies across batches. Close attention must be paid to endurance ratings and nominal read/write speeds.
3.2 Lifespan Estimation
Flash memory has a limited number of erase/write cycles; higher write volumes mean shorter lifespans. Daily and annual write volumes can be estimated as follows:
- Daily writes (GB) = Bitrate (Mbps) ÷ 8 × 3600 × Effective recording hours ÷ 1024
- Annual writes (TB) = Daily writes (GB) × 365 ÷ 1024
Actual write volumes are also affected by write amplification. File system metadata updates and the frequent creation and deletion of small files cause physical writes to exceed application-layer statistics. Therefore, designs should base calculations on manufacturer-provided endurance metrics, leave sufficient margins, and validate through prolonged stress testing.
3.3 Write Performance
Continuous recording requires the storage device to handle sustained writes within stable timeframes. Media with poor random write performance may experience write delays under high load, ultimately resulting in dropped frames or screen tearing. Selection should consider both sequential write speeds and latency fluctuations under low load.
4. Loop Overwriting and Event Protection
Loop overwriting is the fundamental strategy for in-vehicle recording: when storage is full, the system deletes the oldest recordings to write new data. Implementations typically segment recordings into fixed durations (e.g., one or three minutes per segment) and manage overwriting at the segment level.
Event protection adds exception rules on top of loop overwriting. When the accelerometer detects an impact exceeding a threshold, the system locks the current segment and adjacent ones, and the overwrite logic skips these segments.
class SegmentStore:def __init__(self, max_locked_ratio: float = 0.3):self.segments = [] # Each segment contains timestamp, size, locked statusself.max_locked_ratio = max_locked_ratiodef lock_event(self, event_time):"""Lock relevant segments upon an impact event; locked space must not exceed the limit."""locked_bytes = sum(s.size for s in self.segments if s.locked)for seg in self.segments:if abs(seg.start - event_time) <= 60 and not seg.locked:if locked_bytes + seg.size > self.capacity * self.max_locked_ratio:breakseg.locked = Truelocked_bytes += seg.sizedef pick_overwrite_target(self):"""Select the earliest unlocked segment as the overwrite target."""candidates = [s for s in self.segments if not s.locked]return min(candidates, key=lambda s: s.start) if candidates else None
The locked space must have an upper limit. Without it, consecutive impact events could lock the entire storage space, rendering the device unable to record further. The limit balances event retention needs with daily recording continuity and is typically constrained to a certain percentage of total capacity.
Timestamps also require a reliable source. The internal real-time clock (RTC) may drift after power loss, so it should be calibrated via network or satellite time synchronization, and both time and recording duration should be recorded in filenames and metadata.
5. Low-Power Monitoring in Parking Mode
After the vehicle is turned off, the device may still need to monitor its surroundings. It cannot record at full capacity without rapidly draining the battery. A common approach involves dividing the device into operational states managed by a state machine:
- Driving state: Continuous recording at full frame rate with normal bitrate.
- Parking standby: Reduced frame rate or resolution; recording only triggered by motion detection or vibration.
- Event state: Increased bitrate, locking relevant segments, and optionally sending alert notifications.
- Low-power protection: Stops recording when voltage drops below a set lower limit, prioritizing the battery power needed to start the vehicle.
Motion detection is typically based on image differencing or an accelerometer. Image differencing offers high accuracy but higher power consumption; accelerometers consume less power but only sense vibration, unable to identify people or objects in the frame. Combining both balances power consumption and false positive rates.
The low-power threshold must be set according to the vehicle battery’s condition. If too high, the device will frequently interrupt monitoring; if too low, it risks draining the battery and preventing vehicle startup.
6. Data Link for Playback and Remote Access
Local playback is the most direct method. Devices can export files via wired interfaces or enable a local wireless network for smartphone connections. Local methods do not rely on external networks and offer low latency, but communication range is limited.
Remote access requires transmitting data over mobile or other networks to a server, raising three primary considerations:
- Traffic control: Real-time preview uses low-bitrate copies, while original high-bitrate files are uploaded or downloaded only upon explicit user request to avoid excessive data usage.
- Cloud storage: General-purpose object storage can be used to save segment files, combined with lifecycle rules to transition older data to low-cost archival tiers.
- Security and privacy: Transmissions must be encrypted, devices require authentication, default passwords must be changed at first startup, and access permissions follow the principle of least privilege. Recordings may contain license plates and pedestrian images; processing and storage must comply with regional personal data protection regulations.
The stability of the data link also depends on resumable upload capabilities. If the network drops, the device should record the position of uploaded segments and resume from the breakpoint upon reconnection, rather than re-uploading the entire recording.
7. Common Pitfalls
- Focusing solely on nominal capacity: Ignoring formatting overhead and bitrate differences often leads to actual recording times far shorter than expected.
- Focusing solely on resolution: Devices with the same resolution may have vastly different night-time image quality due to differences in sensor size, lens aperture, and image processing algorithms.
- Ignoring endurance metrics: Loop overwriting continuously writes data, and standard consumer-grade media is more prone to failure under long-term, high-frequency writes.
- Ignoring power design: Parking monitoring relies on stable power supply and low-power protection. Solutions focusing only on recording often fail after power loss or battery drain.
8. Selection and Verification Checklist
Before finalizing a solution, verify item by item against the following checklist:
- Calculate target recording duration using measured average bitrate, reserving capacity margin.
- Estimate storage lifespan based on daily write volumes and validate with prolonged stress testing.
- Test impact event locking logic to confirm the locked space limit is effective.
- Test low-power protection threshold to confirm recording stops before battery depletion.
- Test resumable uploads after network disconnection to ensure no files are lost or duplicated.
- Check authentication, encryption, and password policies to meet security requirements.
Through these verifications, the device can operate stably in real-world environments while balancing recording integrity, storage lifespan, and user experience.
