VisionIPC frames from camerad → OMX H.264 hardware encoder → 3-min MP4
segments + SRT GPS subtitles in /data/media/0/videos/<trip>/. Manages
its own trip lifecycle (WAITING/RECORDING/IDLE_TIMEOUT) and writes
DashcamState/DashcamFrames memory params for the UI's Status window.
Honors DashcamShutdown for graceful close before power-off.
Files added:
- selfdrive/clearpilot/dashcamd.cc + SConscript
Files modified:
- selfdrive/frogpilot/screenrecorder/omx_encoder.{cc,h}: ported broken's
version, which adds encode_frame_nv12() (direct NV12 input from camerad,
alongside the existing encode_frame_rgba used by the disabled screen
recorder) and simplifies the libyuv conversion paths to NEON-only since
this device is aarch64.
- selfdrive/SConscript: register selfdrive/clearpilot/SConscript so the
dashcamd binary is part of the build.
- selfdrive/manager/process_config.py:
- camerad gating driverview → always_run so dashcamd can record the
moment ignition+drive arrives without waiting for camera startup.
- Register dashcamd as NativeProcess gated always_run.
- system/loggerd/deleter.py:
- MIN_BYTES 5 GB → 9 GB to leave headroom for dashcam footage.
- delete_oldest_video(): trip-aware cleanup. Drops entire oldest trip
dir first; if only the active trip remains, drops oldest segment
inside it; cleans up legacy flat .mp4s too.
- cleanup_log2(): keeps /data/log2 session logs under 4 GB total.
- Hooked into deleter_thread: video first when out of bytes/percent;
log2 quota check on the idle path. New code uses print(stderr) per
the no-cloudlog rule.
Verified: built clean, manager started, dashcamd in WAITING state
(DashcamState=waiting, DashcamFrames=0), camerad running, no errors.
loggerd
openpilot records routes in one minute chunks called segments. A route starts on the rising edge of ignition and ends on the falling edge.
Check out our python library for reading openpilot logs. Also checkout our tools to replay and view your data. These are the same tools we use to debug and develop openpilot.
log types
For each segment, openpilot records the following log types:
rlog.bz2
rlogs contain all the messages passed amongst openpilot's processes. See cereal/services.py for a list of all the logged services. They're a bzip2 archive of the serialized capnproto messages.
{f,e,d}camera.hevc
Each camera stream is H.265 encoded and written to its respective file.
- fcamera.hevc is the road camera
- ecamera.hevc is the wide road camera
- dcamera.hevc is the driver camera
qlog.bz2 & qcamera.ts
qlogs are a decimated subset of the rlogs. Check out cereal/services.py for the decimation.
qcameras are H.264 encoded, lower res versions of the fcamera.hevc. The video shown in comma connect is from the qcameras.
qlogs and qcameras are designed to be small enough to upload instantly on slow internet and store forever, yet useful enough for most analysis and debugging.