Page 1 of 1
Illegal division by zero at /usr/bin/zmvideo.pl line 292.
Posted: Sun Feb 15, 2009 7:34 pm
by madmax
I was getting movies mailed to myself for months and all of the sudden they stopped.
When I execute: /usr/bin/zmvideo.pl -e 7220 -r 1 -s 1 -f mov
Any ideas? I'm using v1.23.3
Posted: Mon Feb 16, 2009 7:02 pm
by zoneminder
There is a zmvideo.log file plus there will be an ffmpeg.log file in each event directory that has had video generated. There may be something in there that helps.
Posted: Fri Feb 20, 2009 5:33 pm
by madmax
Thanks.
I checked the ffmpeg.log file and it shows "Incorrect frame rate"
02/20/09 12:30:15.595455 zmfilter[6182].ERR [Video generation '/usr/bin/zmvideo.pl -e 7218 -r 1 -s 1 -f mov' failed with status: 255]
Any ideas why it would be picking up the wrong framerate?
Posted: Fri Feb 20, 2009 5:44 pm
by cordel
Try setting the rate to 20 or 25 and see what happens.
-r 25
Have you made any changes before this started?
Posted: Fri Feb 20, 2009 5:54 pm
by madmax
I have -r 25 in the config.
I do not recall making any changes. This is really strange. I'll keep digging.
Posted: Fri Feb 20, 2009 6:22 pm
by madmax
It looks like it was getting hung up trying to encode some old events. Not sure what I change at that time but I just flagged all the events (update events set videoed = 1;) and now new events are working. I'll cross my fingers for now. Thanks!
Posted: Sat Feb 21, 2009 2:10 am
by cordel
Might run a test on the database just to make sure it is good.
Posted: Wed Mar 11, 2009 1:41 am
by satz
I was getting the same error in zmvideo.pl for a camera that I am recording 0.1 frames a second which is basically one frame every 10 seconds. The Frames entry in the database looks like:
203461 60 Normal 2009-03-10 16:40:06 599.98 0
So delta is 599.98. It looks like the code to extract the event in zmvideo.pl:
Code: Select all
my $sql = "select max(F.Delta)-min(F.Delta) as FullLength, E.*, unix_timestamp(E.StartTime) as Time, M.Name as MonitorName, M.Width as MonitorWidth, M.Height as MonitorHeight, M.Palette from Frames as F inner join Events as E on F.EventId = E.Id inner join Monitors as M on E.MonitorId = M.Id where EventId = '$event_id' group by F.EventId";
This will get 0 for FullLength for the above event frame. I added code to zmvideo.pl so that if FullLength is zero to set it to 1.
Code: Select all
*** /usr/bin/zmvideo.pl- 2008-09-24 02:45:58.000000000 -0600
--- /usr/bin/zmvideo.pl 2009-03-10 19:27:20.000000000 -0600
***************
*** 289,294 ****
--- 289,297 ----
}
elsif ( ZM_OPT_MPEG eq "ffmpeg" )
{
+ if ($event->{FullLength} == 0) {
+ $event->{FullLength} = 1;
+ }
my $frame_rate = sprintf( "%.2f", $event->{Frames}/$event->{FullLength} );
if ( $rate )
{
This allows me to get mpeg files via ffmpeg now.
Posted: Tue Mar 24, 2009 4:59 pm
by chika_nidza
I am having the same problem. The thing is that for some events, there's only one frame inserted into the Frames table, so the max(F.Delta)-min(F.Delta) always gives 0 for them.
I solved the problem by replacing max(F.Delta)-min(F.Delta) by max(F.Delta):
Code: Select all
select max(F.Delta) as FullLength, E.*, unix_timestamp(E.StartTime) as Time, M.Name as MonitorName, M.Width as MonitorWidth, M.Height as MonitorHeight, M.Palette from Frames as F inner join Events as E on F.EventId = E.Id inner join Monitors as M on E.MonitorId = M.Id where EventId = '$event_id' group by F.EventId
This works fine for me, but I don't know if it will affect video generation in case the framerate isn't 25.
So does anyone know how come there's only one frame inserted for some videos, and why is FullLength calculated by substracting the deltas?
Thanks.