Zoneminder Record

Forum for questions and support relating to the 1.29.x releases only.
Locked
guinoz
Posts: 4
Joined: Wed Jun 11, 2014 5:29 pm

Zoneminder Record

Post 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?
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder Record

Post 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.
guinoz
Posts: 4
Joined: Wed Jun 11, 2014 5:29 pm

Re: Zoneminder Record

Post 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?
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Zoneminder Record

Post 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.
inoculator
Posts: 6
Joined: Mon Apr 04, 2016 8:21 am

Re: Zoneminder Record

Post 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
guinoz
Posts: 4
Joined: Wed Jun 11, 2014 5:29 pm

Re: Zoneminder Record

Post 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
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: Zoneminder Record

Post 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.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
Locked