Page 1 of 1

%EV% email created but never sent when attaching video

Posted: Sat Nov 10, 2007 6:41 pm
by john.a.sutherland
E-mails are being sent based on an alarm filter, then I tried to attach the mpg file, but it appears to be created but never sent. So email works when I do not attach an mpg file, then it does not work when I try to attach the mpg file.....Why? How can I fix it?

Here are the var logs:

Nov 10 10:28:27 cameras zmfilter[13288]: INF [Sending notification email 'ZoneMinder: Alarm - Cam1-179 (26 - 19 2)']
Nov 10 10:28:28 cameras zmfilter[13288]: INF [Notification email sent]
Nov 10 10:28:28 cameras zmfilter[13288]: INF [Creating notification email]
Nov 10 10:28:28 cameras zmfilter[13288]: INF [Sending notification email 'ZoneMinder: Alarm - Cam1-200 (39 - 19 62)']
Nov 10 10:28:29 cameras zmfilter[13288]: INF [Notification email sent]
Nov 10 10:28:29 cameras zmfilter[13288]: INF [Creating notification email]
etc......

then when I attach the mpeg with %EV% I get this:

Nov 10 10:24:00 cameras zmfilter[10541]: INF [Creating notification email]
Nov 10 10:24:01 cameras zmvideo[12786]: INF [Creating video file Event-83-r1-s1.mpg for event 83]
Nov 10 10:24:01 cameras zmfilter[10541]: INF [Creating notification email]
Nov 10 10:24:01 cameras zmvideo[12790]: INF [Creating video file Event-179-r1-s1.mpg for event 179]
Nov 10 10:24:01 cameras zmfilter[10541]: INF [Creating notification email]
Nov 10 10:24:01 cameras zmvideo[12792]: INF [Creating video file Event-200-r1-s1.mpg for event 200]

etc.... and no mail ever gets sent

Anyone have experience with attaching Mpeg or avi files to e-mails?

Thanks,

John

Posted: Sat Nov 10, 2007 7:20 pm
by cordel
Have you checked to make sure the video file is even created and compleated?

Posted: Sat Nov 10, 2007 7:31 pm
by john.a.sutherland
Cordel,

I can see the event in the Zoneminder console, and I can play it. I wonder if there is a timeout, or a way to have the email wait until the mpg file is done before trying to send? Not sure if that is the problem.

What is the best way to start troubleshooting this?

Thanks,

John

Posted: Sat Nov 10, 2007 9:03 pm
by cordel
Yes, Check and make sure the video file is actually created. If it fails and the file is not created, the process for sending the email is not complete. It should create the video file in the same folder as the saved jpgs for the event. You should also have a logfile in the same location from ffmpeg and you should also check zmvideo.log.

Posted: Sat Nov 10, 2007 9:24 pm
by john.a.sutherland
Ok, I have more info. There is not mpg or avi in the folder for the event. I guess when I click on the event in Zoneminder console it just plays back the jpegs, I assumed it was an mpg. I cannot find a zmvideo.log. I have ffmpeg installed, but I have not tested it.

What can I do to test ffmpeg and make sure it works with Zoneminder?

Thanks for all your help,

John

Posted: Sun Nov 11, 2007 2:31 pm
by zoneminder
Have a look in zmvideo.log and see if there is a problem creating the file. You can try manually creating video by running zmvideo.pl directly.

Code: Select all

Usage: zmvideo.pl -e <event_id>,--event=<event_id> [--format <format>] [--rate=<rate>] [--scale=<scale>] [--fps=<fps>] [--size=<size>] [--overwrite]
Parameters are :-
-e<event_id>, --event=<event_id>  - What event to create the video for
-f<format>, --format=<format>     - What format to create the video in, default is mpg. For ffmpeg only.
-r<rate>, --rate=<rate>           - Relative rate , 1 = realtime, 2 = double speed , 0.5 = half speed etc
-s<scale>, --scale=<scale>        - Scale, 1 = normal, 2 = double size, 0.5 = half size etc
-F<fps>, --fps=<fps>              - Absolute frame rate, in frames per second
-S<size>, --size=<size>           - Absolute video size, WxH or other specification supported by ffmpeg
-o, --overwrite                   - Whether to overwrite an existing file, off by default.
just be careful of permissions (ie if you run it as root then a root owned file will be created in the directory which may never get deleted).

FIXED!!

Posted: Sun Nov 11, 2007 4:07 pm
by john.a.sutherland
Well, I found another string on this problem, I had to change line 323 in zmvideo.pl:
occhiostanco wrote:Most likely, this error raise when the location for the log file produced along with the video (ffmpeg.log) is not writable.
This expecially if you can't fint a ffmpeg.log

Check in zmvideo.pl and change ">& ffmpeg.log" to "&> /tmp/ffmpeg.log"
and see what happens

Roberto
That fixed it for me.

Strange thing is, I have no zmvideo.log or ffmpeg.log that I can find.

So, why do we have to change the zmvideo.pl file? Can this be fixed in future releases of Zoneminder?

Thanks for everyone's help!

Posted: Sun Nov 11, 2007 4:40 pm
by zoneminder
There is no normal reason why ffmpeg.log is not writeable _unless_ you are running it as an ordinary user and not apache (or equivalent) or root.

zmvideo.pl file?

Posted: Tue Nov 27, 2007 12:36 am
by Sully
Following your thread, I cannot find the zmvideo.pl file? Where is it located?

Thanks,
Sully

Posted: Tue Nov 27, 2007 1:52 am
by Sully
Found it...