brutella / hkcam

Open-Source HomeKit Surveillance Camera
https://hochgatterer.me/hkcam/
Apache License 2.0
925 stars 141 forks source link

Update snapshot on view #6

Closed MWDelaney closed 5 years ago

MWDelaney commented 5 years ago

This tool is a great alternative to other Homebridge based options, but one thing the Homebridge alternatives seem to do that this one doesn’t is update the Home app’s preview snapshot of the camera when look at it in the Room or House screen. Is this a possible future feature for hkcam?

Thanks again.

brutella commented 5 years ago

This should actually work.

Apple's Home app periodically (every 10 seconds) requests a new snapshot by calling POST /resource. hkcam then records an image of the camera stream using ffmpeg, stores it as a jpeg image in a temporary folder, reads the bytes of the temporary image from disk and responds to the http request.

MWDelaney commented 5 years ago

You’re absolutely right. For some reason it wasn’t happening when I first set up the camera but after a power outage, once everything came back up, snapshots were working correctly. Sorry to clutter up your inbox.