Video · Retrieve a clip

Pull a clip on demand. Ship it to your cloud.

Seven service operations cover the stored-media lifecycle. Stream-copy clip extraction — no decode, no re-encode, ~1–2 s GOP slop per edge. SFTP upload with host-key pinning, path-traversal guard, and mp4-reduce.

How it works

Seven service operations. One upload path.

GetSegments queries the segment index by lens and time range; ExtractClip performs stream-copy mux-only extraction with ~1–2 s GOP slop; Upload sends to SFTP with host-key pinning; mp4-reduce strips free/skip atoms and patches stco offsets. Snapshot (keyframe to JPEG ~50 ms) and Protect/Unprotect are shown as dotted-line sidepaths.

flowchart LR
  G[GetSegments<br/>by lens + time range] --> X[ExtractClip<br/>mux-only · ~1–2 s GOP slop]
  X --> U[Upload<br/>SFTP · host-key pinned]
  U --> M[mp4-reduce<br/>strip free/skip · patch stco]
  S[Snapshot<br/>keyframe → JPEG ~50 ms] -.-> X
  P[Protect / Unprotect] -.-> G
GetSegments → ExtractClip (mux-only) → Upload (SFTP) → mp4-reduce — Snapshot and Protect/Unprotect as sidepaths
mos-dashcam service surface — clip retrieval and media lifecycle
Operation Input Output
GetSegments lens, start_ts, end_ts list of SegmentRow
ExtractClip segment_id, start_offset, end_offset clip path on disk
Snapshot segment_id, keyframe_offset JPEG path
Protect segment_id — (idempotent)
Unprotect segment_id — (idempotent)
Remove segment_id — (deletes file + row)
Upload paths, destination_uri, options upload status stream
7 service operations GetSegments · ExtractClip · Snapshot · Protect · Unprotect · Remove · Upload
~50 ms keyframe→JPEG qtic2vdec · jpegenc · no full decode
~1–2 s GOP slop per edge stream-copy; no decode; no re-encode
0 re-encode ExtractClip mux-only · mp4-reduce atom-patch only

Architecture

What you do not write — the infrastructure MOS4 ships.

service mos-dashcam

Segment index (SQLite, in-memory with snapshots), retention enforcer, and all seven service operations ops — GetSegments, ExtractClip, Snapshot, Protect, Unprotect, Remove, Upload. Gamma tier: production-ready on internal recording paths.

pipeline splitmuxsrc ! qtmux ! filesink

GStreamer mux-only pipeline for ExtractClip — splitmuxsrc reads the source segment; qtmux re-muxes the stream; filesink writes the output clip. No decode, no re-encode, no pixel round-trip.

transport russh-sftp ring backend

SFTP upload transport — russh-sftp with a ring backend, host-key pinning, path-traversal guard, and context-token URL substitution. Integration supplies a URI; the micro service handles the SSH handshake and stream transfer.

post-upload mp4-reduce

Strips free and skip atoms from the MP4 container, then patches stco / co64 chunk-offset tables to keep the file valid. Reduces upload payload without re-encoding a single frame.

service dashcam-controller BETA

White-label external dashcam integration over Wi-Fi HTTP and TCP notification. Pending-request queue with TTL handles connectivity gaps. Distinct from mos-dashcam — this micro service drives an external hardware unit, not the internal recording pipeline on the MOS4 box.

mos-dashcam vs dashcam-controller

mos-dashcam (gamma) is the internal recorder: it runs on the MOS4 box, owns the segment FIFO, and exposes the seven service operations documented above. dashcam-controller (BETA) drives an external white-label dashcam unit over Wi-Fi HTTP and TCP notification — separate hardware, separate lifecycle, same vehicle. Both can run simultaneously; they do not share state.

FAQ

Frequently asked questions

  • Can I ask for a clip from a specific time window?

    Yes — GetSegments(lens, start_ts, end_ts) returns the matching segments; ExtractClip(segment_id, start_offset, end_offset) writes a stream-copied MP4 with ~1–2 s GOP slop per edge.

  • How fast is a thumbnail?

    ~50 ms keyframe→JPEG on QCS6490 via qtic2vdec and jpegenc — no full decode pass, no re-encode.

  • How does upload survive cellular drops?

    The micro service exposes upload status via a service call; retry logic at the integration layer handles cellular drops. mp4-reduce shrinks the payload before upload — no re-encode, only free/skip atom stripping and stco offset patching.

  • What is the difference between mos-dashcam and dashcam-controller?

    mos-dashcam (gamma) is the internal recorder running on the MOS4 box — it owns the segment index, the retention enforcer, and all seven service operations. dashcam-controller (BETA) drives external white-label dashcam hardware over Wi-Fi HTTP and TCP notification. Both can compose on the same vehicle.

  • What if I need internal recording AND a connected external dashcam?

    They compose. Internal recording uses mos-dashcam; the external dashcam is driven by dashcam-controller (BETA) — pending-request queue with TTL handles connectivity gaps between the two.

Bring your cameras and your job-to-be-done.

MIPI / GMSL / RTSP / WebRTC / SRT, internal recording, external white-label dashcam, wake on event — pick your function and we'll sketch the pipeline.