Filter to convert event to video and remove JPEGs?

Forum for questions and support relating to the 1.26.x releases only.
Post Reply
ExplodingLemur
Posts: 20
Joined: Mon Sep 17, 2007 5:48 pm

Filter to convert event to video and remove JPEGs?

Post by ExplodingLemur » Sun Jul 26, 2015 5:35 pm

I have Zoneminder currently running in continuous record mode. It creates a new event every 10 minutes. For every 10-minute event, I'd like to convert the JPEGs (from the MJPEG stream off my cameras) to a video file, and remove the individual JPEG image files (this should reduce my disk usage by about 90% for each event). In the Filter setup window I can set up a filter to match all events >=600sec, and there are checkboxes for "Create video for all matches" and "Delete all matches"...however, I suspect that the delete all matches option will delete the event entirely, converted video and all. I could execute "rm %EPI%/*.jpg" for all matches as well as create video for all matches, but I don't know what order it executes these in, and if it does execute the video creation first, I don't know if it waits for ffmpeg to return a successful exit code before moving on to the custom command. Any thoughts?

mikb
Posts: 415
Joined: Mon Mar 25, 2013 12:34 pm

Re: Filter to convert event to video and remove JPEGs?

Post by mikb » Sun Jul 26, 2015 7:43 pm

I've no idea if the delete and video creation will work in the way you say, in that delete will blow away the newly made video (or delete the JPGS and then fail to make a video!)

What I do know is this: If you force the videos to be created OUTSIDE the usual ZM event directories, it doesn't get deleted.

This is what I do :-

I have a rule that takes "archived" events and makes videos of them (7 days after they originally happened, giving a 7 day opportunity to realise i want to keep something).
I have a rule that says if it's NOT "archived" and 7 days old, delete it.
I have a rule that says if it's "archived" and 14 days old, delete it.

The events disappear and my videos are left behind where I want them.

Configure Options/Images/FFMPEG_OUTPUT_OPTIONS and set (was just "-r 25" here)

# Comments added by me

-r 25 -q:v 1 -f avi -vtag XVID -g 30 -bf 2 # File type formatting
-vf "hqdn3d,lutyuv=y=gammaval(1.4),unsharp" # Image improvements
/mnt/point/for/cctv/zoneminder/videos/`date -d "-7 days" +"%Y%m%d-%H%M%S-%N"`.avi # Full Path with filenamed by date of "7 days ago from now"

The important thing there is I specify the path where I want the video to end up.

Now, you can use whatever naming convention you want after "videos/ .... .avi" but I can assure you the videos created "over there" don't get deleted even when ZM cleans up.

ExplodingLemur
Posts: 20
Joined: Mon Sep 17, 2007 5:48 pm

Re: Filter to convert event to video and remove JPEGs?

Post by ExplodingLemur » Mon Jul 27, 2015 12:38 am

That's not quite what I'm looking for, because I want the video files to stay with the events, and get cleaned up by Zoneminder when it's time to expire them, or the disk gets full. All I want is for each event to create an MPEG or AVI and drop the JPEGs after Zoneminder has moved on to recording in the next event.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest