# ipcam H264 IP camera streaming app + motion-extraction recording pipeline. ## Components **H264Cam** - Android app that streams raw H264 from the device camera over HTTP on port 8080. Manual exposure mode (1/500s shutter, max ISO) for motion freeze, with DAY/NIGHT toggle. Sideload `h264cam.apk`. **ipcam-record.sh** - Persistent multi-camera capture with zero-gap segmented recording. Burns timestamps via ffmpeg drawtext, encodes with VAAPI (h264_vaapi, qp 18). Auto-condenses each completed segment inline. **ipcam-condense.sh** - Extracts motion segments from a recording using scene score analysis: per-frame scene scores -> convolution blur -> median threshold -> segment clustering. Deletes the original, outputs `*_condensed.mkv`. **ipcam-merge.sh** - Appends condensed files into a rolling `motion.mkv` accumulator via stream copy. ## Setup ### Requirements - ffmpeg with VAAPI support (Intel/AMD GPU) - `/dev/dri/renderD128` accessible - systemd (user services) ### Camera config Create `ipcam-cameras.conf` with one camera per line: ``` # name url backyard http://192.168.1.168:8080/video ``` ### Install the service ```sh cp ipcam-capture.service ~/.config/systemd/user/ systemctl --user daemon-reload systemctl --user enable --now ipcam-capture ``` Recordings land in `~/Downloads/ipcam/`. Each 10-minute segment is condensed to motion-only, then merged into `motion.mkv`. ### Manual usage ```sh # record all cameras (Ctrl-C to stop) ./ipcam-record.sh # condense a single file (threshold multiplier 2x median, bridge 10-frame gaps) ./ipcam-condense.sh recording.mkv [threshold_mult] [gap_frames] # merge condensed files into accumulator ./ipcam-merge.sh [output.mkv] ``` ## Pipeline ``` camera -> H264 over HTTP -> ffmpeg segment (10min, VAAPI, timestamp overlay) | v (segment complete) condense (scene score threshold) | v merge -> motion.mkv (rolling accumulator) ``` ## Android app Build from source with `./gradlew assembleDebug` or sideload the prebuilt `h264cam.apk`. The app streams `video/h264` on `http://:8080/video` - connect with ffmpeg, mpv, or the recording pipeline.