Daily movie

Forum for questions and support relating to the 1.24.x releases only.
User avatar
punch-card
Posts: 39
Joined: Thu Nov 25, 2010 10:29 pm
Location: St Peters MO

Re: Daily movie

Post by punch-card »

Does anyone have the setting for ffmpeg that would make the video in a better quality?
When you watch a named event, or even convert the event to a video, it is about the same quality as watching it streaming.
But when I look at the mpgs that ffmpeg creates with the script, they a very pixelated, and the quality is very poor.
I am quite sure it is probably just a setting, I just wondered if anyone else had come up with some switches that would improve the quality.
Best Regards
Mike
Mad Professor
Posts: 106
Joined: Wed Dec 15, 2010 11:20 am
Location: Isle Of Wight, UK

Re: Daily movie

Post by Mad Professor »

Good day to you.

I am trying to use the script of post #5, but I seem to be having a few problems with it.

I am using the distribution found here: Zoneminder install DVD 1.24.x (3/7/2011)

Each time I run "sudo bash Dailyvid.sh 2" I get the follow.
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/153/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/154/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/155/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/156/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/157/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/158/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/159/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/160/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/161/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/162/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/163/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/164/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/165/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/166/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/167/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/168/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/169/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/170/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/171/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/172/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/173/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/174/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/175/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/176/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/177/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/178/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/179/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/180/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/181/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/182/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/183/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/184/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/185/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/186/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/187/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/188/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/189/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/190/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/191/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/192/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/193/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/194/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/195/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/196/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/197/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/198/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/199/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/200/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/201/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/202/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/203/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/204/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/205/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/206/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/207/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/208/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/209/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/210/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/211/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/212/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/213/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/214/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/215/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/216/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/217/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/218/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/219/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/220/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/221/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/222/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/223/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/224/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/225/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/226/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/227/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/228/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/229/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/230/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/231/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/232/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/233/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/234/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/235/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/236/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/237/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/238/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/239/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/240/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/241/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/242/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/243/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/244/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/245/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/246/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/247/*jpg: No such file or directory
Making Images and Placing them in /tmp/2 .... Please Be Patient this could take a while.
ls: cannot access /var/www/zm/events/2/248/*jpg: No such file or directory
FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers
built on Mar 6 2011 19:01:01 with gcc 4.4.3
configuration: --enable-gpl --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab
libavutil 50.36. 0 / 50.36. 0
libavcore 0.16. 1 / 0.16. 1
libavcodec 52.108. 0 / 52.108. 0
libavformat 52.93. 0 / 52.93. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1.74. 0 / 1.74. 0
libswscale 0.12. 0 / 0.12. 0
libpostproc 51. 2. 0 / 51. 2. 0
/tmp/2/img%06d.jpg: No such file or directory
The script seems to be looking in the wrong place.

Here is a file path to some real events on my system
/var/www/zm/events/2/11/05/01/00/00/11/
/var/www/zm/events/2/11/05/01/00/01/33/
/var/www/zm/events/2/11/05/01/00/04/46/
/var/www/zm/events/2/11/05/01/00/07/13/
/var/www/zm/events/2/11/05/01/00/07/43/
/var/www/zm/events/2/11/05/01/00/09/52/
/var/www/zm/events/2/11/05/01/00/11/38/
/var/www/zm/events/2/11/05/01/00/17/50/
/var/www/zm/events/2/11/05/01/00/18/41/
/var/www/zm/events/2/11/05/01/00/25/18/
Can you please advice.

Best Regards.
cpuangel
Posts: 1
Joined: Fri Sep 09, 2011 2:55 pm

Re: Daily movie

Post by cpuangel »

I'm going to pretend this isn't a dead thread and say..

The only error I'm getting is /tmp/1/img%06d.jpg: No such file or directory
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: Daily movie

Post by bb99 »

A much newer thread with an off site link to do the same thing: http://www.zoneminder.com/forums/viewto ... 29&t=18180
koceto80
Posts: 1
Joined: Thu Mar 01, 2012 11:38 am

Re:

Post by koceto80 »

Dreded wrote:Ok so I took it a step further and made this... takes about 5min to make the daily video on my system which records 24/7

you must supply the MonitorId as an argument "./makevideo 4" would make a video of all the previous days events and then put it in the first event for that day so it can be retrieved via the webinterface under the first event of the days video section

Code: Select all

#!/bin/bash
MUSER="zm"
MPASS="PASSWORD"
MHOST="localhost"
MDB="zm"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
PATHTOEVENTS="/var/www/zm/events"
MonitorId="$1"
tmpdir="/tmp"

if [ "$1" == "$null" ]
  then
    echo You Must Specify The Monitor ID i.e \'$0 4\' would specify monitor id 4
    exit
fi

EVENTS="$($MYSQL -D$MDB -u$MUSER -p$MPASS -Bse 'select id from Events WHERE (StartTime BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 1 DAY ) AND CURDATE( )) AND (MonitorId = '$MonitorId') order by id asc')"
mkdir $tmpdir/$MonitorId
x=1
for event in ${EVENTS[@]}
do
        if [ $x -eq 1 ]
          then
            mysqldate="$($MYSQL -D$MDB -u$MUSER -p$MPASS -Bse 'select StartTime from Events WHERE id = '$event'')"
            date=`date +%b%d-%Y --date="$mysqldate"`
            firstevent="$event"
            echo Making Images and Placing them in $tmpdir/$MonitorId .... Please Be Patient this could take a while.
        fi
          for i in $(ls -r -t $PATHTOEVENTS/$MonitorId/$event/*jpg)
          do counter=$(printf %06d $x)
            ln -s "$i" $tmpdir/$MonitorId/img"$counter".jpg
            x=$(($x+1))
          done
done

ffmpeg -f image2 -i $tmpdir/$MonitorId/img%06d.jpg $PATHTOEVENTS/$MonitorId/$firstevent/$date-Daily.mpg

rm -rf $tmpdir/$MonitorId
echo Video Created at $PATHTOEVENTS/$MonitorId/$firstevent/$date-Daily.mpg
Thanks for the script. The only problem is with events longer than 1000 frames. These events was with jumping frames. I solve this problem by replacing this line:

Code: Select all

          for i in $(ls -r -t $PATHTOEVENTS/$MonitorId/$event/*jpg)
with this:

Code: Select all

          for i in $(ls $PATHTOEVENTS/$MonitorId/$event/????capture.jpg; ls $PATHTOEVENTS/$MonitorId/$event/?????capture.jpg)
Since this is my first post i also want to thank to the whole team of developers for making this valuable software. I feel safer running it in my property. Wish you all best and keep up the good work!

Regards,
Konstantin
User avatar
nightcrawler
Posts: 71
Joined: Fri Aug 12, 2011 9:54 am
Location: the netherlands

Re: Daily movie

Post by nightcrawler »

Hey I didn't now that there was an other topic with an working sollution. :idea:
anyway I made an similar script on my post: http://www.zoneminder.com/forums/viewto ... =9&t=18291 with some more settings but pretty much the same thing..

But I also encounting the 1000 frames sorting issue! So I will re-engineer my script with the knowledge of this postings! 8)
Zoneminder @Ubuntu 11 server, ZM 1.25.0 , FFMPEG, 4 Analoge cameras, 1.6ghz P4mobile, 2GB ram, 60GB-HDD.
I also have an (homeseer) domotica system up-and-running with touchscreens,light controllers,weather forecast etc.
vraa
Posts: 31
Joined: Mon May 23, 2011 6:28 am

Re: Daily movie

Post by vraa »

nightcrawler wrote:Hey I didn't now that there was an other topic with an working sollution. :idea:
anyway I made an similar script on my post: http://www.zoneminder.com/forums/viewto ... =9&t=18291 with some more settings but pretty much the same thing..

But I also encounting the 1000 frames sorting issue! So I will re-engineer my script with the knowledge of this postings! 8)
Were you able to fix your script for this 1000+ frame issue?
vraa
Posts: 31
Joined: Mon May 23, 2011 6:28 am

Re: Daily movie

Post by vraa »

If you go to http://www.zoneminder.com/forums/viewto ... 1&start=15 you will see I fixed the issue and did some alterations on the script
Locked