feat(gateway): split video recording into silence-based segments like voice

Video (camera + screen share) DAVE stream-watch now produces per-burst
MP4 segments instead of one long .h264 per watch:
- Detects VIDEO_SILENCE_MS (4000ms) of no H264 packets → closes the
  current segment, muxes to MP4, registers in voice_recordings + uploads
  to TeleUploader, then reopens for the next burst (mirrors voice AfterSilence).
- Per-watch segment counter + per-segment depacketizer reset + closing
  guard + write-error swallow so races (silence close vs in-flight UDP
  packet) never corrupt files or crash the gateway.
- Frontend: recordings deck renders a native <video> player for MP4 rows
  (detected by filename), keeps single-playback registry across audio+video.
This commit is contained in:
asepharyana authored and asepharyana committed 2026-09-01 21:51:44 +07:00
1 parent eb2f8f5b6f
commit 4ec9685194
5 files changed
+417 -49

No files matched your search

@@ -16,6 +16,11 @@ export interface VoiceRecording {
transcription?: string | null;
}
/** True when the recording file is video (camera/screen-share MP4). */
export function isVideoRecording(r: Pick<VoiceRecording, "filename">): boolean {
return /\.(mp4|webm|mov|h264)$/i.test(r.filename);
}
export interface PaginatedRecordings {
items: VoiceRecording[];
nextCursor: string | null;