change default video export location

Forum for questions and support relating to the 1.25.x releases only.
Locked
neuronetv
Posts: 86
Joined: Mon Dec 17, 2012 10:01 pm

change default video export location

Post by neuronetv »

I'm running contos 6.5 server 64 bit with zoneminder 1.25.
I've created a filter that is automatically exporting certain events to avi video (hooray). However the videos are being saved in the same location as the event ie: buried deep inside /var/www/html/zm/etc/etc....
I'd like zoneminder to save the videos to a different location. Can zm do this? I did a google search before posting but only found stuff for manually exporting from the web gui.
BiloxiGeek
Posts: 271
Joined: Tue Feb 11, 2014 2:04 pm

Re: change default video export location

Post by BiloxiGeek »

I've looked for the same thing with no luck so far.
neuronetv
Posts: 86
Joined: Mon Dec 17, 2012 10:01 pm

Re: change default video export location

Post by neuronetv »

I've assumed that this can't be done as well however I've made a little workaround that does the job I need, so if it helps anyone else here's how I did it.
I'm impressed with a new program I'm trying lately called monit. It can watch log files for certain text strings and when it sees it it can trigger an action. So when zm creates an avi video I get "Finished Event" appearing in /var/log/messages, and in the monit control file I have:
check file zm-video with path /var/log/messages
if match "Finished Event" then exec "/root/zm-video-export.sh"
this means when monit sees "Finished Event" in /var/log/messages it triggers a script (I wrote) called "zm-video-export.sh".

Here is the zm-video-export.sh script:
#!/bin/sh
find /var/www/html/zm/events/* -iname "*.avi" -type f -exec /bin/mv {} /home/share/zm-videos \;
sleep 10
echo "'INF [Finished Event' detected by monit in /var/log/messages."| mailx -s "new video generated from event" me@so-and-so.com
exit 0
the first line finds all the avi files where zm originally saves them and moves them to /home/share/zm-videos, which for me is a shared samba folder on my LAN. The next line (ech0) sends me an email to let me know a new video has just been done.
So I no longer have to search for any avis and the above does everything within a minute of an avi being created.
mikb
Posts: 674
Joined: Mon Mar 25, 2013 12:34 pm

Re: change default video export location

Post by mikb »

It can be done, there isn't a place to put a base-path-name anywhere else (feature hint!) and so this was for ZM 1.25, adapt as needed!

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

Code: Select all

-r 25 -q:v 1 -f avi -vtag XVID -g 30 -bf 2 -vf "hqdn3d,lutyuv=y=gammaval(1.4),unsharp" /mnt/point/for/cctv/videos/`date -d "-7 days" +"%Y%m%d-%H%M%S-%N"`.avi
Yes, all that lot... now, how much of that you need depends on your settings, but the final thing after the FFMPEG file type/quality/image enhancement setup is the /path/to/your/files/ and a filename.

The tail end bit picks a date that was 7 days ago from NOW, because that's when the video being processed was a new event. If that makes sense. There's a 7 day delay between the event being created, and it being made into video on my system because of how I set up filter rules. Anywhere in that 7 day period, if I tag it as "Archive it", it gets converted to video.

You could use simply `date +"%Y%m%d-%H%M%S-%N"`.avi for a timestamp of right now.
Locked