Page 1 of 1

Zoneminder Record

Posted: Fri Apr 01, 2016 8:23 pm
by guinoz
Hey,

I would like to know if is possible record a video not as images (.jpeg) but in a format like .avi, mp4 in the more recent version 1.29.0. Zoneminder allows to export in .avi format but generates multiple images. Any way to avoid this?

Re: Zoneminder Record

Posted: Fri Apr 01, 2016 9:24 pm
by bbunge
The video export is done in a single file of your choice. Yes, you can also export events as a bunch of files.

Re: Zoneminder Record

Posted: Fri Apr 01, 2016 9:49 pm
by guinoz
Hey bbunge.

Thank you for quick reply.

But and to record without creating several jpeg files only a single file? Is it possible?

Re: Zoneminder Record

Posted: Sat Apr 02, 2016 12:00 am
by bbunge
No, ZM saves events as a stream of single files. Think film...a series of still pictures that, when run past the projector lens, shows motion. When you export a video those individual files are put into a stream, in a single file (think film strip) that when run shows motion. Not much has changed since Eadweard Muybridge except the way we process the image stream.

Re: Zoneminder Record

Posted: Mon Apr 04, 2016 9:00 am
by inoculator
Hi all,

the direct recording as an AVI o.s. does not seem to be supported.
At the moment I am working on a script, that is fired after midnight and creates an AVI of the previous day.
Because I am running 1.25, I have still issues with the crontab of zmfilter to create the videos before putting them together using mencoder.

Here is the current bash script, to give You an idea where I started.
This is an early dev phase. You need to export the videos of the day using the web GUI and store it into the folder of the script using filename like this:
2016-05-27-ZMExport.tar.gz.
Then You can loop though the script by

for f in *zmExport.tar.gz
do ./create-full.sh $f
done

========================================
#!/bin/bash

# find /var/cache/zoneminder/events|grep $(date --date="1 day ago" +"/%y/%m/%d/")|grep ".avi"|sort

clear
filename=$(basename "$1")
dateoffile=${filename:0:11}
newfilename=${dateoffile}full.avi
echo "dateoffile = $dateoffile"
echo "newfilename = $newfilename"

echo "extracting $1"
# read -p "Press [Enter] key to continue..."

tar xzf $1

echo "moving AVIs to ./events"
for f in $(find ./events|grep '.avi$'); do mv $f ./events; done

echo "creating temp Dir"
mkdir temp

echo "reset first counter"
#mv Event-1417-r1-s1.avi ./temp/full.avi
first="1"

echo "starting loop"
for f in ./events/*.avi;
do
if [ "$first" -eq "1" ]
then
echo "moving first file "$f;
mv $f ./temp/$newfilename;
first="0";
# read -p "Press [Enter] key to continue..." dummy;
else
echo "merging "$f;
mencoder -oac copy -ovc copy -o ./temp/temp.avi ./temp/$newfilename $f;
rm -f ./temp/$newfilename;
mv ./temp/temp.avi ./temp/$newfilename;
rm $f;
# read -p "Press [Enter] key to continue..." dummy;
fi


done
mv ./temp/$newfilename .
tar zcf $newfilename.tar.gz $newfilename
rm -R ./events
rm -R ./temp
========================================

From the commented line:
# find /var/cache/zoneminder/events|grep $(date --date="1 day ago" +"/%y/%m/%d/")|grep ".avi"|sort
You can see, where the server script will point to.

Hope it helps
Carsten

Re: Zoneminder Record

Posted: Mon Apr 04, 2016 1:19 pm
by guinoz
Thank you bbunge for your explanation and inoculator for your great collaboration.

I will try to follow for the scripts solution. I would like to make one suggestion as a future functionality this because I think that create several images consumes a lot of bandwidth and mainly storage. If you can also warn us when there a deadline for this I thank you.

Best Regards

Re: Zoneminder Record

Posted: Wed Apr 06, 2016 11:14 pm
by SteveGilvarry
Recording h264 content direct when cameras provide it and encoding other formats into h264 for storage is being actively worked on, team is aiming for 1.30 release, but lots of work and testing will be needed.