Page 1 of 1

Batch delete generated videos from events?

Posted: Fri Jul 29, 2016 7:56 pm
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.

Re: Batch delete generated videos from events?

Posted: Sat Jul 30, 2016 12:51 am
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

Re: Batch delete generated videos from events?

Posted: Sat Jul 30, 2016 6:12 pm
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 :)

Re: Batch delete generated videos from events?

Posted: Sat Jul 30, 2016 10:07 pm
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.

Re: Batch delete generated videos from events?

Posted: Sun Jul 31, 2016 4:27 pm
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 :)