zoneminder wrote:If you edit zm_funcs.php, find the createVideo function and add in a line
before the exec line it will output the command to your web error log. You could then try running that command directly from a shell to see if you get the same size file.
Likewise, you can edit zmfilter.pl and search for zmvideo.pl in that file. Add a line afterwards thus
and save and restart. This will output the command into zmfilter.log.
It will be interesting to see if they are the same.
I followed the suggestions in the post above. I alos added
Code: Select all
Info( "ffmpeg command '$command'\n" )
to zmvideo.pl to see if ffmpeg gets called differently.
Here are the results.
WHEN VIDEO GENERATED BY FILTER
ZMFILTER.LOG
Code: Select all
01/19/08 10:23:19.779201 zmfilter[4661].INF [zmvideo.pl command '/usr/bin/zmvideo.pl -e 484 -r 1 -s 1 -f mpeg']
ZMVIDEO.LOG
Code: Select all
01/19/08 10:23:20.028185 zmvideo[4871].INF [Creating video file Event-484-r1-s1.mpeg for event 484]
01/19/08 10:23:20.028961 zmvideo[4871].INF [ffmpeg command '/usr/bin/ffmpeg -y -r 24.40 -i %03d-capture.jpg -s 352x288 -r 25 'Event-484-r1-s1.mpeg' > /tmp/ffmpeg.log']
WHEN VIDEO GENERATED FROM THE MONITOR PAGE:
APACHE ERROR.LOG
Code: Select all
[Sat Jan 19 16:17:37 2008] [error] [client 192.168.4.22] /usr/bin/zmvideo.pl -e 484 -f mpeg -r 1.00 -s 1.00, referer: http://192.168.4.1/zm/index.php?view=video&eid=484
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-pp --enable-pthreads --enable-vorbis --enable-libogg --enable-a52 --enable-dts --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 0d.49.0.0
libavcodec version: 0d.51.11.0
libavformat version: 0d.50.5.0
built on Jan 28 2007 22:48:38, gcc: 4.1.2 20070106 (prerelease) (Ubuntu 4.1.1-21ubuntu7)
Input #0, image2, from '%03d-capture.jpg':
Duration: 00:00:05.0, start: 0.000000, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj420p, 352x288, 24.40 fps(r)
Output #0, mpeg, to 'Event-484-r1-s1.mpeg':
Stream #0.0: Video: mpeg1video, yuv420p, 352x288, q=2-31, 200 kb/s, 25.00 fps(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 59 q=29.0 size= 198kB time=2.3 bitrate= 699.1kbits/s
frame= 121 q=20.9 size= 272kB time=4.8 bitrate= 464.2kbits/s
frame= 124 q=29.6 Lsize= 276kB time=4.9 bitrate= 459.6kbits/s
video:271kB audio:0kB global headers:0kB muxing overhead 1.887241%
ZMVIDEO.LOG
Code: Select all
01/19/08 16:17:37.510977 zmvideo[5711].INF [Creating video file Event-484-r1-s1.mpeg for event 484]
01/19/08 16:17:37.511732 zmvideo[5711].INF [ffmpeg command '/usr/bin/ffmpeg -y -r 24.40 -i %03d-capture.jpg -s 352x288 -r 25 'Event-484-r1-s1.mpeg' > /tmp/ffmpeg.log']
I noticed they call zmvideo slightly differently:
From filter:
Code: Select all
/usr/bin/zmvideo.pl -e 484 -r 1 -s 1 -f mpeg
From Monitor Window:
Code: Select all
/usr/bin/zmvideo.pl -e 484 -f mpeg -r 1.00 -s 1.00
but then when zmvideo.pl calls ffmpeg, it is called the same for both:
Code: Select all
/usr/bin/ffmpeg -y -r 24.40 -i %03d-capture.jpg -s 352x288 -r 25 'Event-484-r1-s1.mpeg' > /tmp/ffmpeg.log
The filter generated mpeg has the text
Code: Select all
Output #0, mpeg, to 'Event-484-r1-s1.mpeg':
Stream #0.0: Video: mpeg1video, yuv420p, 352x288, q=2-31, 200 kb/s, 25.00 fps(c)
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
prepended at the start of the file, and that is what's causing it not to play in WMP and GOMplayer.
This text you will notice appear in the Apache error.log when generated from the monitor window.
Any suggestions, anyone?
PPS:
I've now also ran from the command line:
FILTER GENERATED command
Code: Select all
sudo -u www-data /usr/bin/zmvideo.pl -e 484 -r 1 -s 1 -f mpeg
and MONITOR MANUAL GENERATED command
Code: Select all
sudo -u www-data /usr/bin/zmvideo.pl -e 484 -f mpeg -r 1.00 -s 1.00
Both produced a valid working 'mpeg' file.