kerberos-io / agent

An open and scalable video surveillance system for anyone making this world a better and more peaceful place.
https://kerberos.io
MIT License
703 stars 88 forks source link

Feature request: Raw recording compression #32

Open GHNewbiee opened 2 years ago

GHNewbiee commented 2 years ago

Nice to have such a feature to reduce the size of the storage means.

cedricve commented 2 years ago

@GHNewbiee how would you see this? Any feedback?

olokos commented 2 years ago

Maybe we could have a config value named "archive old recordings every X hours/days"?

After those x hours, there could be a zip/7zip archive created with all of the recordings made after X hours.

So all of the old recordings could be compressed in their individual archive for a given day, considering they're older than X days, just an idea that could work well.

I already do this myself, after each day I create a new folder in /recordings and move all of the old recordings there.

With this done programmatically, instead of moving the recordings to folders, we could instead compress them into archives instead.

I suggest not using Linux timestamps for archives but regular date timestamps, or at least having an option to choose datetime format. Linux timestamps are epic for individual files, but would make those archives harder to figure out which day was the archive made on.

cedricve commented 2 years ago

wonderful idea! im just wondering what is the compression ratio you are currently experiencing? Like the total size before and after zipping..

olokos commented 2 years ago

I just tried on windows 7zip ultra and zip ultra various settings and I was hardly getting size reduction, I guess h264 is compressed enough already.

Maybe with tar on linux results will be better? If not then maybe at least creating/choosing a directory and then moving old recordings there periodically?

Some archiving feature would be amazing, if we can't get it compressed any better with reasonable speed.

cedricve commented 2 years ago

Thanks I would give tar a try, however the whole idea is to use cloud storage here for backing up, and freeing up disk space.

This cloud can also be a synology at home. So that would mean you are moving recordings from the agent to your local redundant storage.

Kind regards, Verstraeten Cédric

On 10 Sep 2022, at 00:19, olokos @.***> wrote:

 I just tried on windows 7zip ultra and zip ultra various settings and I was hardly getting size reduction, I guess h264 is compressed enough already.

Maybe with tar on linux results will be better? If not then maybe at least creating/choosing a directory and then moving old recordings there periodically?

Some archiving feature would be amazing, if we can't get it compressed any better with reasonable speed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were assigned.

bigntallmike commented 1 year ago

There's no reason to believe that archiving compressed video would save space in this way. The best way to save space with compressed video is to use a better codec or a lower bit-rate. The redundancies standard compression algorithms would find should already be gone. Re-encoding with H265 would make a huge difference to storage though.