Batch delete generated videos from events?

Forum for questions and support relating to the 1.29.x releases only.
Locked
Fressikus
Posts: 13
Joined: Fri Jul 29, 2016 7:51 pm

Batch delete generated videos from events?

Post by Fressikus »

Is there a way to easily batch delete all generated videos attached to multiple events?

There's an easy way to "Create video for all matches" via the filter system, but I can't find a way to delete already generated videos in a similar fashion while keeping the events (.jpg's). You could manually remove all .avi's via command line, but I don't think that's the proper way to do it.
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: Batch delete generated videos from events?

Post by PacoLM »

Hi,

I believe the videos are not created unless ZM is programmed to do it (using a filter). The events you see are the sequences of images recorded if I'm not wrong.

Hope it helps,

PacoLM

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
mikb
Posts: 595
Joined: Mon Mar 25, 2013 12:34 pm

Re: Batch delete generated videos from events?

Post by mikb »

@PacoLM -- you are correct, but I think you have missed the point of the question :)

Given that the videos HAVE been created (easily) by a filter .... how do you delete JUST the generated video (.avi) without blowing away the whole event (DB entry and JPGs too)?

I don't think there's a ZM way to do it, and would be reaching for the "find /path -type f -iname *.avi -delete" kind of answer, if it wasn't for the fact I don't let ZM create the videos in the events directory in the first place -- I hint to FFMPEG that it should use another path totally :)
Fressikus
Posts: 13
Joined: Fri Jul 29, 2016 7:51 pm

Re: Batch delete generated videos from events?

Post by Fressikus »

mikb wrote:I hint to FFMPEG that it should use another path totally :)
If there's no built-in way in Zoneminder, I think this might be the "cleanest" way to do it. This way, your .avi files to not get split up everywhere, but stay tidy in one directory. Only downside is, that you can't delete those via the web-interface at all any more. Thanks for the suggestion.
mikb
Posts: 595
Joined: Mon Mar 25, 2013 12:34 pm

Re: Batch delete generated videos from events?

Post by mikb »

In 1.25: Under Options/Images/FFMPEG Output Options I did this ...

-r 25 -q:v 1 -f avi -vtag XVID -g 30 -bf 2 -vf "hqdn3d,lutyuv=y=gammaval(1.4),unsharp" /mnt/place/for/cctv/zoneminder/videos/`date -d "-7 days" +"%Y%m%d-%H%M%S-%N"`.avi

The back-quoted date-time bit forces a filename that closely approximates the time the video was generated (7 days ago) due to the filter that says: If 7 days old AND archived, create a video. Triggering the above. But that's just me, you will have to adapt as you need :)
Locked