Hello,
I recently installed a camera doorbell which is working fine, I can get the RTSP stream in HA as expected.
Now this camera has the possibility to record on motion detection and I use that one.
when a motion gets detected it sends the filename to HA via MQTT and it records for 60 seconds to the SD card.
It also adds some additional time just before the motion.
In HA I created an automation which waits for 1 minute and then starts downloading the mp4 file.
this works really great.
But it leaves a gap, whenever a burglar decides to first destroy the camera, I think this can be done within a minute easily. I won’t be able to download the most important video file.
my question is, is there a way to download the file in realtime, so actually while it is getting created and not ready yet.
Personally I was thinking about donwloading the file, it will fail, but it’s partially downloaded,
then use the
downloader_download_failed
event, wait 1 second and try again.
but there are several issues using this method.
I should apply a loopcount, just in case the file is really not downloadable.
and will a broken mp4 file even be stored in HA, and will it play?
or maybe, are there some better ways to approach the problem.
I know I get set HA to record, but then I will probaly loose the first few seconds of the video.
Also my RPI3 probably will crash while trying to record.