mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.47k stars 151 forks source link

Ability to call Snapshots via the API? #1030

Open jarrah31 opened 8 months ago

jarrah31 commented 8 months ago

Would it be possible to trigger a snapshot image via the API instead of the current method of using SNAPSHOT=RTPS within environment variables please?

I ask because I'd like to only trigger snapshots during daylight hours via a local script (or some other method) that automatically adjusts when they are taken as the days shorten. At the moment I have to manually delete all the nighttime shots before I create a Timelapse, and being able to trigger them via an API will make things easier.

I would still like to use the environment settings such as SNAPSHOT_FORMAT and IMG_DIR that hopefully the API call can utilise.

Many thanks!

mrlt8 commented 8 months ago

Does the update_snapshot command work? You should be able trigger it via the API /api/<cam-name>/update_snapshot or as the topic for MQTT wyzebridge/<cam_name>/update_snapshot/get.

jarrah31 commented 8 months ago

Hi @mrlt8, I did see that API option but discounted it due to the description saying it only updates the WebUI snapshot for that camera, but now looking at it in a different light I see where you are coming from as it mentions the same /img/cam-name.jpg filename. Does calling /img/cam-name.jpg take into account environment options such as SNAPSHOT_FORMAT and IMG_DIR?

mrlt8 commented 8 months ago

@jarrah31 Can you try the new /api/all/update_snapshot endpoint?

jarrah31 commented 8 months ago

Thank you very much @mrlt8, I should be able to test this when back home tomorrow.

Just out of interest, will I be able to specify a camera name as well as the all option?

jarrah31 commented 8 months ago

I have tested and can confirm the /api/all/update_snapshot endpoint works. Thank you!