#Automatically re-encode Synology Surveillance Station Smart Time Lapse files as they complete.

1 messages · Page 1 of 1 (latest)

gilded drift
#

I have a Synology NAS running Surveillance Station, and I have a camera configured for Smart Time Lapse which saves an mp4 file to '/volume1/surveillance/@TimeLapse/Smart Timelapse' and a subfolder formatted as YYYYMMDD{AM/PM} depending on when the timelapse begins. I have Smart Time Lapse Task settings configured to create time lapse files over 24-hour durations, where the final video is 1 minute long. The file details are 5120x1552 resolution, 60906 kb/s, 30 fps, and as such are about 500 MB each. Network and power snags can terminate recordings prematurely, so the files aren't always finished at the same time. Furthermore, the files are written in real time, so currently recording time lapses will be in folders titled with dates from today or yesterday. The most recent/current folder/file should not be touched.

I would like to set up an automated task that detects completed time lapse files and encodes them into a smaller file in '/volume1/Files/Video/TimelapseAutomation'. I think that the best detection method would be to recognize when a newer folder/file is created, which would indicate that the second-newest folder/file has just completed recording. I would like new files to begin encoding as soon after their completion as feasible (not something that just checks once every 24 hours). How can I implement this? I realize that this isn't specifically a Home Assistant question, so feel free to direct me elsewhere if necessary.

unkempt acorn
#

I don't know precise solution, but for sure there are already existing apps which detect changes between current run and previous run. Then compress files and move somewhere.

Try to find shell commands / NAS plugins for backup.

#

Actually some NAS app for backup should do the job.

#
  • setting to keep original files shorter. 1 day? 3 days? Just to reduce unecessary lost of GB for redundancy.
#

The above is probably the simplest solution, but at the same time should be very stable.

#

If videos are critical add watchdog which will check everyday if the automation really work and compress and move files

gilded drift
#

I found synology task scheduler in the control panel so I'm trying to write a bash script

#

something that creates an array of all of the folder names and their last modified dates, and then goes into the second-newest folder (to skip the currently recording timelapse) and encodes it to a new directory

#

and when it does this it adds that filename to a log so it won't try to re-encode anything