Merge branch 'depracation_nation' of https://github.com/SteveGilvarry/ZoneMinder into SteveGilvarry-depracation_nation

This commit is contained in:
Andy Bauer 2016-04-04 20:44:53 -05:00
commit 7ff8d36598
54 changed files with 416 additions and 4200 deletions

1
.gitignore vendored
View File

@ -63,7 +63,6 @@ src/zma
src/zmc src/zmc
src/zmf src/zmf
src/zms src/zms
src/zmstreamer
src/zmu src/zmu
web/includes/config.php web/includes/config.php
zm.conf zm.conf

View File

@ -13,9 +13,7 @@ Depends: ${misc:Depends},
zoneminder-database (>= ${source:Version}), zoneminder-database (>= ${source:Version}),
zoneminder-core (>= ${binary:Version}), zoneminder-core (>= ${binary:Version}),
zoneminder-ui-base (>= ${source:Version}), zoneminder-ui-base (>= ${source:Version}),
zoneminder-ui-classic (>= ${source:Version}), zoneminder-ui-classic (>= ${source:Version})
zoneminder-ui-mobile (>= ${source:Version}),
zoneminder-ui-xml (>= ${source:Version})
Description: Video camera security and surveillance solution (metapackage) Description: Video camera security and surveillance solution (metapackage)
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child
@ -103,22 +101,3 @@ Description: Classic web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution. ZoneMinder is a video camera security and surveillance solution.
. .
This package provides the classic web user interface. This package provides the classic web user interface.
Package: zoneminder-ui-mobile
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: Mobile web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the web user interface for mobile devices.
Package: zoneminder-ui-xml
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: XML interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides a XML interface mainly intended for use with the eyeZm
iPhone Application, but can be used with any other custom programs as well.

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/mobile

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/xml

View File

@ -140,7 +140,6 @@ fi
# zmfix removed from zoneminder 1.26.6 # zmfix removed from zoneminder 1.26.6
#%attr(4755,root,root) %{_bindir}/zmfix #%attr(4755,root,root) %{_bindir}/zmfix
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -232,7 +232,6 @@ fi
# zmfix removed from zoneminder 1.26.6 # zmfix removed from zoneminder 1.26.6
#%attr(4755,root,root) %{_bindir}/zmfix #%attr(4755,root,root) %{_bindir}/zmfix
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -142,7 +142,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -142,7 +142,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -0,0 +1,408 @@
%define zmuid $(id -un)
%define zmgid $(id -gn)
%define zmuid_final apache
%define zmgid_final apache
%global _hardened_build 1
### Delete the lines below to build with ffmpeg and/or x10
%define _without_ffmpeg 1
%define _without_x10 1
Name: zoneminder
Version: 1.29.0
Release: 1%{?dist}
Summary: A camera monitoring and analysis tool
Group: System Environment/Daemons
# jscalendar is LGPL (any version): http://www.dynarch.com/projects/calendar/
# Mootools is inder the MIT license: http://mootools.net/
License: GPLv2+ and LGPLv2+ and MIT
URL: http://www.zoneminder.com/
#Source: https://github.com/ZoneMinder/ZoneMinder/archive/v%{version}.tar.gz
Source: ZoneMinder-%{version}.tar.gz
BuildRequires: cmake gnutls-devel systemd-units bzip2-devel
BuildRequires: mariadb-devel pcre-devel libjpeg-turbo-devel
BuildRequires: perl(Archive::Tar) perl(Archive::Zip) perl-podlators
BuildRequires: perl(Date::Manip) perl(DBD::mysql)
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent)
BuildRequires: perl(MIME::Entity) perl(MIME::Lite)
BuildRequires: perl(PHP::Serialization) perl(Sys::Mmap)
BuildRequires: perl(Time::HiRes) perl(Net::SFTP::Foreign)
BuildRequires: perl(Expect) perl(Sys::Syslog)
BuildRequires: gcc gcc-c++ vlc-devel libcurl-devel libv4l-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg-devel}
%{!?_without_x10:BuildRequires: perl(X10::ActiveHome) perl(Astro::SunTime)}
# cmake needs the following installed at build time due to the way it auto-detects certain parameters
BuildRequires: httpd polkit-devel
%{!?_without_ffmpeg:BuildRequires: ffmpeg}
Requires: httpd php php-gd php-mysql cambozola polkit net-tools psmisc
Requires: libjpeg-turbo vlc-core libcurl
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
Requires: perl(DBD::mysql) perl(Archive::Tar) perl(Archive::Zip)
Requires: perl(MIME::Entity) perl(MIME::Lite) perl(Net::SMTP) perl(Net::FTP)
Requires: perl(LWP::Protocol::https)
%{!?_without_ffmpeg:Requires: ffmpeg}
Requires(post): systemd-units systemd-sysv
Requires(post): /usr/bin/gpasswd
Requires(post): /usr/bin/less
Requires(preun): systemd-units
Requires(postun): systemd-units
%description
ZoneMinder is a set of applications which is intended to provide a complete
solution allowing you to capture, analyse, record and monitor any cameras you
have attached to a Linux based machine. It is designed to run on kernels which
support the Video For Linux (V4L) interface and has been tested with cameras
attached to BTTV cards, various USB cameras and IP network cameras. It is
designed to support as many cameras as you can attach to your computer without
too much degradation of performance.
%prep
%setup -q -n ZoneMinder-%{version}
# Change the following default values
./utils/zmeditconfigdata.sh ZM_PATH_ZMS /cgi-bin-zm/nph-zms
./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes
./utils/zmeditconfigdata.sh ZM_PATH_SWAP /dev/shm
./utils/zmeditconfigdata.sh ZM_UPLOAD_FTP_LOC_DIR /var/spool/zoneminder-upload
./utils/zmeditconfigdata.sh ZM_OPT_CONTROL yes
./utils/zmeditconfigdata.sh ZM_CHECK_FOR_UPDATES no
./utils/zmeditconfigdata.sh ZM_DYN_SHOW_DONATE_REMINDER no
%build
%cmake \
-DZM_TARGET_DISTRO="f22" \
%{?_without_ffmpeg:-DZM_NO_FFMPEG=ON} \
%{?_without_x10:-DZM_NO_X10=ON} \
.
make %{?_smp_mflags}
%install
export DESTDIR=%{buildroot}
make install
%post
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
# Allow zoneminder access to local video sources, serial ports, and x10
/usr/bin/gpasswd -a %{zmuid_final} video
/usr/bin/gpasswd -a %{zmuid_final} dialout
# Upgrade from a previous version of zoneminder
if [ $1 -eq 2 ] ; then
# Freshen the database
/usr/bin/zmupdate.pl -f
# We can't run this automatically when new sql account permissions need to
# be manually added first
# Run zmupdate non-interactively
#/usr/bin/zmupdate.pl --nointeractive
fi
# Warn the end user to read the README file
echo -e "\nVERY IMPORTANT: Before starting ZoneMinder, read README.Fedora to finish the\ninstallation or upgrade!\n"
echo -e "\nThe README file is located here: %{_docdir}/%{name}\n"
%preun
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable zoneminder.service > /dev/null 2>&1 || :
/bin/systemctl stop zoneminder.service > /dev/null 2>&1 || :
fi
%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
fi
%triggerun -- zoneminder < 1.25.0-4
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply zoneminder
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save zoneminder >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del zoneminder >/dev/null 2>&1 || :
/bin/systemctl try-restart zoneminder.service >/dev/null 2>&1 || :
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README.md distros/fedora/README.Fedora distros/fedora/README.https distros/fedora/jscalendar-doc
%config %attr(640,root,%{zmgid_final}) /etc/zm/zm.conf
%config(noreplace) %attr(644,root,root) /etc/httpd/conf.d/zoneminder.conf
%config(noreplace) /etc/tmpfiles.d/zoneminder.conf
%config(noreplace) /etc/logrotate.d/zoneminder
%{_unitdir}/zoneminder.service
%{_bindir}/zma
%{_bindir}/zmaudit.pl
%{_bindir}/zmc
%{_bindir}/zmcontrol.pl
%{_bindir}/zmdc.pl
%{_bindir}/zmf
%{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl
%{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl
%{_bindir}/zmu
%{_bindir}/zmupdate.pl
%{_bindir}/zmvideo.pl
%{_bindir}/zmwatch.pl
%{_bindir}/zmcamtool.pl
%{_bindir}/zmsystemctl.pl
%{!?_without_x10:%{_bindir}/zmx10.pl}
%{perl_vendorlib}/ZoneMinder*
%{_mandir}/man*/*
%dir %{_libexecdir}/zoneminder
%{_libexecdir}/zoneminder/cgi-bin
%dir %{_datadir}/zoneminder
%{_datadir}/zoneminder/db
%{_datadir}/zoneminder/www
%{_datadir}/polkit-1/actions/com.zoneminder.systemctl.policy
%{_datadir}/polkit-1/rules.d/com.zoneminder.systemctl.rules
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/events
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/images
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/sock
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/swap
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/lib/zoneminder/temp
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/log/zoneminder
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /var/spool/zoneminder-upload
%dir %attr(755,%{zmuid_final},%{zmgid_final}) /run/zoneminder
%changelog
* Sat Feb 14 2015 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.1
- Bump version for 1.28.1 release on Fedora 21.
* Sun Oct 5 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.28.0
- Bump version for 1.28.0 release.
* Fri Mar 14 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
- Tweak build requirements for cmake
* Sat Feb 01 2014 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.27
- Add zmcamtool.pl. Bump version for 1.27 release.
* Mon Dec 16 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.5
- This is a bug fixe release
- RTSP fixes, cmake enhancements, couple other misc fixes
* Mon Oct 07 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
- Initial cmake build.
* Sat Oct 05 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.4
- Fedora specific path changes have been moved to zoneminder-1.26.0-defaults.patch
- All files are now part of the zoneminder source tree. Update specfile accordingly.
* Sat Sep 21 2013 Andrew Bauer <knnniggett@users.sourceforge.net> - 1.26.3
- Initial rebuild for ZoneMinder 1.26.3 release.
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Mon Jan 21 2013 Adam Tkac <atkac redhat com> - 1.25.0-12
- rebuild due to "jpeg8-ABI" feature drop
* Mon Jan 7 2013 Remi Collet <rcollet@redhat.com> - 1.25.0-11
- fix configuration file for httpd 2.4, #871502
* Fri Dec 21 2012 Adam Tkac <atkac redhat com> - 1.25.0-10
- rebuild against new libjpeg
* Thu Aug 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-9
- Add patch to work around v4l2 api breakage in 3.5 kernel.
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.25.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Sat Jun 23 2012 Petr Pisar <ppisar@redhat.com> - 1.25.0-7
- Perl 5.16 rebuild
* Wed Mar 21 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-6
- Fix stupid thinko in sql modifications.
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-5
- Clean up macro usage.
* Sat Feb 25 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-4
- Convert to systemd.
- Add tmpfiles.d configuration since the initscript isn't around to create
/run/zoneminder.
- Remove some pointless executable permissions.
- Add logrotate file.
* Wed Feb 22 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-3
- Update README.Fedora to reference systemctl and mention timezone info in
php.ini.
- Add proper default for EYEZM_LOG_TO_FILE.
* Thu Feb 09 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-2
- Rebuild for new pcre.
* Thu Jan 19 2012 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.25.0-1
- Update to 1.25.0
- Fix gcc4.7 build problems.
- Drop gcc4.4 build fixes; for whatever reason they now break the build.
- Clean up old patches.
- Force setting of ZM_TMPDIR and ZM_RUNDIR.
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-3
- Re-add the dist-tag that somehow got lost.
* Thu Sep 15 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-2
- Add patch for bug 711780 - fix syntax issue in Mapped.pm.
- Undo that patch, and undo another which was the cause of the whole mess.
- Fix up other patches so ZM_PATH_BUILD is both defined and useful.
- Make sure database creation mods actually take.
- Update Fedora-specific docs with some additional info.
- Use bundled mootools (javascript, so no guideline violation).
- Update download location.
- Update the gcrypt patch to actually work.
- Upstream changed the tarball without changing the version to patch a
vulnerability, so redownload.
* Sun Aug 14 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.4-1
- Initial attempt to upgrade to 1.24.4.
- Add patch from BZ 460310 to build against libgcrypt instead of requiring the
gnutls openssl libs.
* Thu Jul 21 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-7.20110324svn3310
- Perl mass rebuild
* Wed Jul 20 2011 Petr Sabata <contyk@redhat.com> - 1.24.3-6.20110324svn3310
- Perl mass rebuild
* Mon May 09 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-5.20110324svn3310
- Bump for gnutls update.
* Thu Mar 24 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-4.20110324svn3310
- Update to latest 1.24.3 subversion. Turns out that what upstream was calling
1.24.3 is really just an occasionally updated devel snapshot.
- Rebase various patches.
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 1.24.3-3
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Tue Jan 25 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.3-1
- Update to latest upstream version.
- Rebase patches.
- Initial incomplete attempt to disable v4l1 support.
* Fri Jan 21 2011 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-6
- Unbundle cambozola; instead link to the separately pacakged copy.
- Remove BuildRoot:, %%clean and buildroot cleaning in %%install.
- Git rid of mixed space/tab usage by removing all tabs.
- Remove unnecessary Conflicts: line.
- Attempt to force short_open_tag on for the code directories.
- Move default location of sockets, swaps, logfiles and some temporary files to
make more sense and allow things to work better with a future selinux policy.
- Fix errors in README.Fedora.
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 1.24.2-5
- Mass rebuild with perl-5.12.0
* Fri Dec 4 2009 Stepan Kasal <skasal@redhat.com> - 1.24.2-4
- rebuild against perl 5.10.1
- use Perl vendorarch and archlib variables correctly
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.24.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-2
- Bump release since 1.24.2-1 was mistakenly tagged a few months ago.
* Wed Jul 22 2009 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.24.2-1
- Initial update to 1.24.2.
- Rebase patches.
- Update mootools download location.
- Update to mootools 1.2.3.
- Add additional dependencies for some optional features.
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-3
- Remove unused Sys::Mmap perl dependency RPM is finding
* Sat Apr 11 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-2
- Update gcc44 patch to disable -frepo, seems to be broken with gcc44
- Added noffmpeg patch to make building outside mock easier
* Sat Mar 21 2009 Martin Ebourne <martin@zepler.org> - 1.24.1-1
- Patch for gcc 4.4 compilation errors
- Upgrade to 1.24.1
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.23.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sat Jan 24 2009 Caolán McNamara <caolanm@redhat.com> - 1.23.3-3
- rebuild for dependencies
* Mon Dec 15 2008 Martin Ebourne <martin@zepler.org> - 1.23.3-2
- Fix permissions on zm.conf
* Fri Jul 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.23.3-1
- Initial attempt at packaging 1.23.
* Tue Jul 1 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-15
- Add perl module compat dependency, bz #453590
* Tue May 6 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-14
- Remove default runlevel, bz #441315
* Mon Apr 28 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.22.3-13
- Backport patch for CVE-2008-1381 from 1.23.3 to 1.22.3.
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.22.3-12
- Autorebuild for GCC 4.3
* Thu Jan 3 2008 Martin Ebourne <martin@zepler.org> - 1.22.3-11
- Fix compilation on gcc 4.3
* Thu Dec 6 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-10
- Rebuild for new openssl
* Thu Aug 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-8
- Fix licence tag
* Thu Jul 12 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-7
- Fixes from testing by Jitz including missing dependencies and database creation
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-6
- Disable crashtrace on ppc
* Sat Jun 30 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-5
- Fix uid for directories in /var/lib/zoneminder
* Tue Jun 26 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-4
- Added perl Archive::Tar dependency
- Disabled web interface due to lack of access control on the event images
* Sun Jun 10 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-3
- Changes recommended in review by Jason Tibbitts
* Mon Apr 2 2007 Martin Ebourne <martin@zepler.org> - 1.22.3-2
- Standardised on package name of zoneminder
* Thu Dec 28 2006 Martin Ebourne <martin@zepler.org> - 1.22.3-1
- First version. Uses some parts from zm-1.20.1 by Corey DeLasaux and Serg Oskin

View File

@ -163,7 +163,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -237,7 +237,6 @@ fi
# zmfix removed from zoneminder 1.26.6 # zmfix removed from zoneminder 1.26.6
#%attr(4755,root,root) %{_bindir}/zmfix #%attr(4755,root,root) %{_bindir}/zmfix
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -150,7 +150,6 @@ rm -rf %{_docdir}/%{name}-%{version}
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -159,7 +159,6 @@ fi
%{_bindir}/zmf %{_bindir}/zmf
%{_bindir}/zmfilter.pl %{_bindir}/zmfilter.pl
%{_bindir}/zmpkg.pl %{_bindir}/zmpkg.pl
%{_bindir}/zmstreamer
%{_bindir}/zmtrack.pl %{_bindir}/zmtrack.pl
%{_bindir}/zmtrigger.pl %{_bindir}/zmtrigger.pl
%{_bindir}/zmu %{_bindir}/zmu

View File

@ -28,9 +28,7 @@ Depends: ${misc:Depends},
zoneminder-database (>= ${source:Version}), zoneminder-database (>= ${source:Version}),
zoneminder-core (>= ${binary:Version}), zoneminder-core (>= ${binary:Version}),
zoneminder-ui-base (>= ${source:Version}), zoneminder-ui-base (>= ${source:Version}),
zoneminder-ui-classic (>= ${source:Version}), zoneminder-ui-classic (>= ${source:Version})
zoneminder-ui-mobile (>= ${source:Version}),
zoneminder-ui-xml (>= ${source:Version})
Description: Video camera security and surveillance solution (metapackage) Description: Video camera security and surveillance solution (metapackage)
ZoneMinder is intended for use in single or multi-camera video security ZoneMinder is intended for use in single or multi-camera video security
applications, including commercial or home CCTV, theft prevention and child applications, including commercial or home CCTV, theft prevention and child
@ -119,25 +117,6 @@ Description: Classic web user interface for ZoneMinder
. .
This package provides the classic web user interface. This package provides the classic web user interface.
Package: zoneminder-ui-mobile
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: Mobile web user interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides the web user interface for mobile devices.
Package: zoneminder-ui-xml
Section: web
Architecture: all
Depends: zoneminder-ui-base (>= ${source:Version}), ${misc:Depends}
Description: XML interface for ZoneMinder
ZoneMinder is a video camera security and surveillance solution.
.
This package provides a XML interface mainly intended for use with the eyeZm
iPhone Application, but can be used with any other custom programs as well.
Package: zoneminder-ui-api Package: zoneminder-ui-api
Section: web Section: web
Architecture: all Architecture: all

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/mobile

View File

@ -1 +0,0 @@
usr/share/zoneminder/skins/xml

View File

@ -26,16 +26,13 @@ Binaries
PHP PHP
--- ---
As well as this there are the web PHP files in the web directory. Currently these consist of 4 possible skins. As well as this there are the web PHP files in the web directory. Currently these consist of a single skin with Classic and Flat styles.
**Classic** **Classic**
Original ZoneMinder skin Original ZoneMinder skin
**Flat** **Flat**
An updated version of classic skin, retaining the same layout with a more modern style An updated version of Classic skin, retaining the same layout with a more modern style. Originally a skin this is now just a CSS style.
**XML**
Displays certain views as XML. Used by eyeZM as an interfacing skin (Note that eyeZM no longer seems to work with later versions of Zoneminder). New developers of 3rd party clients should use the API instead (:doc:`../api`)
**Mobile**
A skin that displays views in a more condensed and single page format, likely suitable for smaller mobile devices, should one choose to access the ZoneMinder console using such devices. Note that there are also third party mobile clients one could use (:doc:`mobile`)
Perl Perl
---- ----

View File

@ -19,6 +19,4 @@ If you have changed the value of an option you should then save it. A numb
options/options_upload options/options_upload
options/options_x10 options/options_x10
options/options_bw options/options_bw
options/options_phonebw
options/options_eyezm
options/options_users options/options_users

View File

@ -1,26 +0,0 @@
Options - eyeZM
---------------
.. NOTE::
eyeZM does not seem to be actively maintained by the developers and does not work with later versions of ZoneMinder.
.. image:: images/Options_eyezm.png
EYEZM_DEBUG - Enable or Disable extra debugging from the eyeZm Plugin. Extra debugging information will be displayed in it's own file (EYEZM_LOG_TO_FILE is set), or your Apache error log
EYEZM_LOG_TO_FILE - When EYEZM_DEBUG is on and EYEZM_LOG_TO_FILE is on, output generated from the eyeZm Plugin will go to it's own file. Otherwise it will go to the apache error log.
EYEZM_LOG_FILE - Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled. This file will contain it's own output from the eyeZm Plugin when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled.
EYEZM_EVENT_VCODEC - The eyeZm Plugin calls FFMPEG externally to encode the captured images. If your FFMPEG is not built with support for H264, change this to MPEG-4. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+).
EYEZM_FEED_VCODEC - Determines whether the live stream is generated using native MJPEG streaming with ZoneMinder, or H264 using FFMPEG and HTML-5 streaming. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+). This is just a default parameter, and can be overridden with eyeZm.
EYEZM_H264_DEFAULT_BR - Default bit-rate to use with FFMPEG for H264 streaming. When using the eyeZm Plugin to stream H264 data, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm.
EYEZM_H264_DEFAULT_EVBR - Default bit-rate to use with FFMPEG for H264 event viewing. When using the eyeZm Plugin to view events in H264, FFMPEG requires a bitrate to control the quality and bandwidth of the video. This should be specified in a format acceptable to FFMPEG. The default value is sufficient for most installations. This is just a default parameter, and can be overridden with eyeZm.
EYEZM_H264_TIMEOUT - Timeout (sec) to wait for H264 stream to start before terminating. The eyeZm Plugin will attempt to spawn an H264 stream when requested, and require that it complete within the timeout specified. If you have a slow system or find through the logs that the H264 stream is not starting because the timeout is expiring, even though FFMPEG is running, try increasing this value. If you have a fast system, decreasing this value can improve the responsiveness when there are issues starting H264 streams.
EYEZM_SEG_DURATION - Segment duration used for streaming using HTTP-5 Streaming protocol. The HTTP-5 Live Streaming Protocol segments the input video stream into small chunks of a duration specified by this parameter. Increasing the segment duration will help with choppy connections on the other end, but will increase the latency in starting a stream.

View File

@ -1,20 +0,0 @@
Options - Phone Bandwidth
-------------------------
.. image:: images/Options_BW_Phone.png
WEB_P_CAN_STREAM - Override the automatic detection of browser streaming capability. If you know that your browser can handle image streams of the type 'multipart/x-mixed-replace' but ZoneMinder does not detect this correctly you can set this option to ensure that the stream is delivered with or without the use of the Cambozola plugin. Selecting 'yes' will tell ZoneMinder that your browser can handle the streams natively, 'no' means that it can't and so the plugin will be used while 'auto' lets ZoneMinder decide.
WEB_P_STREAM_METHOD - ZoneMinder can be configured to use either mpeg encoded video or a series or still jpeg images when sending video streams. This option defines which is used. If you choose mpeg you should ensure that you have the appropriate plugins available on your browser whereas choosing jpeg will work natively on Mozilla and related browsers and with a Java applet on Internet Explorer"
WEB_P_DEFAULT_SCALE - Normally ZoneMinder will display 'live' or 'event' streams in their native size. However if you have monitors with large dimensions or a slow link you may prefer to reduce this size, alternatively for small monitors you can enlarge it. This options lets you specify what the default scaling factor will be. It is expressed as a percentage so 100 is normal size, 200 is double size etc.
WEB_P_DEFAULT_RATE - Normally ZoneMinder will display 'event' streams at their native rate, i.e. as close to real-time as possible. However if you have long events it is often convenient to replay them at a faster rate for review. This option lets you specify what the default replay rate will be. It is expressed as a percentage so 100 is normal rate, 200 is double speed etc.
WEB_P_VIDEO_BITRATE - When encoding real video via the ffmpeg library a bit rate can be specified which roughly corresponds to the available bandwidth used for the stream. This setting effectively corresponds to a 'quality' setting for the video. A low value will result in a blocky image whereas a high value will produce a clearer view. Note that this setting does not control the frame rate of the video however the quality of the video produced is affected both by this setting and the frame rate that the video is produced at. A higher frame rate at a particular bit rate result in individual frames being at a lower quality.
WEB_P_VIDEO_MAXFPS - When using streamed video the main control is the bitrate which determines how much data can be transmitted. However a lower bitrate at high frame rates results in a lower quality image. This option allows you to limit the maximum frame rate to ensure that video quality is maintained. An additional advantage is that encoding video at high frame rates is a processor intensive task when for the most part a very high frame rate offers little perceptible improvement over one that has a more manageable resource requirement. Note, this option is implemented as a cap beyond which binary reduction takes place. So if you have a device capturing at 15fps and set this option to 10fps then the video is not produced at 10fps, but rather at 7.5fps (15 divided by 2) as the final frame rate must be the original divided by a power of 2.
WEB_P_SCALE_THUMBS - If unset, this option sends the whole image to the browser which resizes it in the window. If set the image is scaled down on the server before sending a reduced size image to the browser to conserve bandwidth at the cost of cpu on the server. Note that ZM can only perform the resizing if the appropriate PHP graphics functionality is installed. This is usually available in the php-gd package.
WEB_P_AJAX_TIMEOUT - The newer versions of the live feed and event views use Ajax to request information from the server and populate the views dynamically. This option allows you to specify a timeout if required after which requests are abandoned. A timeout may be necessary if requests would overwise hang such as on a slow connection. This would tend to consume a lot of browser memory and make the interface unresponsive. Ordinarily no requests should timeout so this setting should be set to a value greater than the slowest expected response. This value is in milliseconds but if set to zero then no timeout will be used.

View File

@ -3759,161 +3759,6 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
type => $types{integer}, type => $types{integer},
category => "lowband", category => "lowband",
}, },
{
name => "ZM_WEB_P_CAN_STREAM",
default => "auto",
description => "Override the automatic detection of browser streaming capability",
help => qqq("
If you know that your browser can handle image streams of the
type 'multipart/x-mixed-replace' but ZoneMinder does not detect
this correctly you can set this option to ensure that the
stream is delivered with or without the use of the Cambozola
plugin. Selecting 'yes' will tell ZoneMinder that your browser
can handle the streams natively, 'no' means that it can't and
so the plugin will be used while 'auto' lets ZoneMinder decide.
"),
type => $types{tristate},
category => "phoneband",
},
{
name => "ZM_WEB_P_STREAM_METHOD",
default => "jpeg",
description => "Which method should be used to send video streams to your browser.",
help => qqq("
ZoneMinder can be configured to use either mpeg encoded video
or a series or still jpeg images when sending video streams.
This option defines which is used. If you choose mpeg you
should ensure that you have the appropriate plugins available
on your browser whereas choosing jpeg will work natively on
Mozilla and related browsers and with a Java applet on Internet
Explorer
"),
type => {
db_type =>"string",
hint =>"mpeg|jpeg",
pattern =>qr|^([mj])|i,
format =>q( $1 =~ /^m/ ? "mpeg" : "jpeg" )
},
category => "phoneband",
},
{
name => "ZM_WEB_P_DEFAULT_SCALE",
default => "100",
description => "What the default scaling factor applied to 'live' or 'event' views is (%)",
help => qqq("
Normally ZoneMinder will display 'live' or 'event' streams in
their native size. However if you have monitors with large
dimensions or a slow link you may prefer to reduce this size,
alternatively for small monitors you can enlarge it. This
options lets you specify what the default scaling factor will
be. It is expressed as a percentage so 100 is normal size, 200
is double size etc.
"),
type => {
db_type =>"integer",
hint =>"25|33|50|75|100|150|200|300|400",
pattern =>qr|^(\d+)$|, format=>q( $1 )
},
category => "phoneband",
},
{
name => "ZM_WEB_P_DEFAULT_RATE",
default => "100",
description => "What the default replay rate factor applied to 'event' views is (%)",
help => qqq("
Normally ZoneMinder will display 'event' streams at their
native rate, i.e. as close to real-time as possible. However if
you have long events it is often convenient to replay them at a
faster rate for review. This option lets you specify what the
default replay rate will be. It is expressed as a percentage so
100 is normal rate, 200 is double speed etc.
"),
type => {
db_type =>"integer",
hint =>"25|50|100|150|200|400|1000|2500|5000|10000",
pattern =>qr|^(\d+)$|,
format =>q( $1 )
},
category => "phoneband",
},
{
name => "ZM_WEB_P_VIDEO_BITRATE",
default => "8000",
description => "What the bitrate of the video encoded stream should be set to",
help => qqq("
When encoding real video via the ffmpeg library a bit rate can
be specified which roughly corresponds to the available
bandwidth used for the stream. This setting effectively
corresponds to a 'quality' setting for the video. A low value
will result in a blocky image whereas a high value will produce
a clearer view. Note that this setting does not control the
frame rate of the video however the quality of the video
produced is affected both by this setting and the frame rate
that the video is produced at. A higher frame rate at a
particular bit rate result in individual frames being at a
lower quality.
"),
type => $types{integer},
category => "phoneband",
},
{
name => "ZM_WEB_P_VIDEO_MAXFPS",
default => "5",
description => "What the maximum frame rate for streamed video should be",
help => qqq("
When using streamed video the main control is the bitrate which
determines how much data can be transmitted. However a lower
bitrate at high frame rates results in a lower quality image.
This option allows you to limit the maximum frame rate to
ensure that video quality is maintained. An additional
advantage is that encoding video at high frame rates is a
processor intensive task when for the most part a very high
frame rate offers little perceptible improvement over one that
has a more manageable resource requirement. Note, this option
is implemented as a cap beyond which binary reduction takes
place. So if you have a device capturing at 15fps and set this
option to 10fps then the video is not produced at 10fps, but
rather at 7.5fps (15 divided by 2) as the final frame rate must
be the original divided by a power of 2.
"),
type => $types{integer},
category => "phoneband",
},
{
name => "ZM_WEB_P_SCALE_THUMBS",
default => "yes",
description => "Scale thumbnails in events, bandwidth versus cpu in rescaling",
help => qqq("
If unset, this option sends the whole image to the browser
which resizes it in the window. If set the image is scaled down
on the server before sending a reduced size image to the
browser to conserve bandwidth at the cost of cpu on the server.
Note that ZM can only perform the resizing if the appropriate
PHP graphics functionality is installed. This is usually
available in the php-gd package.
"),
type => $types{boolean},
category => "phoneband",
},
{
name => "ZM_WEB_P_AJAX_TIMEOUT",
default => "10000",
description => "How long to wait for Ajax request responses (ms)",
help => qqq("
The newer versions of the live feed and event views use Ajax to
request information from the server and populate the views
dynamically. This option allows you to specify a timeout if
required after which requests are abandoned. A timeout may be
necessary if requests would overwise hang such as on a slow
connection. This would tend to consume a lot of browser memory
and make the interface unresponsive. Ordinarily no requests
should timeout so this setting should be set to a value greater
than the slowest expected response. This value is in
milliseconds but if set to zero then no timeout will be used.
"),
type => $types{integer},
category => "phoneband",
},
{ {
name => "ZM_DYN_LAST_VERSION", name => "ZM_DYN_LAST_VERSION",
default => "", default => "",
@ -3980,141 +3825,6 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
readonly => 1, readonly => 1,
category => "dynamic", category => "dynamic",
}, },
{
name => "ZM_EYEZM_DEBUG",
default => "no",
description => "Switch additional debugging on for eyeZm Plugin",
help => qqq("
Enable or Disable extra debugging from the eyeZm Plugin. Extra
debugging information will be displayed in it's own file
(EYEZM_LOG_TO_FILE is set), or your Apache error log
"),
type => $types{boolean},
category => "eyeZm",
},
{
name => "ZM_EYEZM_LOG_TO_FILE",
default => "yes",
description => "When eyeZm Debugging is enabled, enabling this logs output to it's own file",
help => qqq("
When EYEZM_DEBUG is on and EYEZM_LOG_TO_FILE is on, output
generated from the eyeZm Plugin will go to it's own file.
Otherwise it will go to the apache error log.
"),
type => $types{boolean},
category => "eyeZm",
},
{
name => "ZM_EYEZM_LOG_FILE",
default => "@ZM_LOGDIR@/zm_xml.log",
description => "Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled",
help => qqq("
This file will contain it's own output from the eyeZm Plugin
when EYEZM_LOG_TO_FILE and EYEZM_DEBUG are both enabled
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_EVENT_VCODEC",
default => "mpeg4",
description => "Default video-codec to use for encoding events",
help => qqq("
The eyeZm Plugin calls FFMPEG externally to encode the captured
images. If your FFMPEG is not built with support for H264,
change this to MPEG-4. If using H264, please check
http://www.eyezm.com for H264 requirements and that your eyeZm
version supports H264 (v1.2+).
"),
type => {
db_type =>"string",
hint =>"mpeg4|h264",
pattern =>qr|^([mh])|i,
format =>q( $1 =~ /^m/ ? "mpeg4" : "h264" )
},
category => "eyeZm",
},
{
name => "ZM_EYEZM_FEED_VCODEC",
default => "mjpeg",
description => "Default video-codec to use for streaming the live feed",
help => qqq("
Determines whether the live stream is generated using native
MJPEG streaming with ZoneMinder, or H264 using FFMPEG and
HTML-5 streaming. If using H264, please check
http://www.eyezm.com for H264 requirements and that your eyeZm
version supports H264 (v1.2+). This is just a default
parameter, and can be overridden with eyeZm.
"),
type => {
db_type =>"string",
hint =>"mjpeg|h264",
pattern =>qr|^([mh])|i,
format =>q( $1 =~ /^m/ ? "mjpeg" : "h264" )
},
category => "eyeZm",
},
{
name => "ZM_EYEZM_H264_DEFAULT_BR",
default => "96k",
description => "Default bit-rate to use with FFMPEG for H264 streaming",
help => qqq("
When using the eyeZm Plugin to stream H264 data, FFMPEG
requires a bitrate to control the quality and bandwidth of the
video. This should be specified in a format acceptable to
FFMPEG. The default value is sufficient for most installations.
This is just a default parameter, and can be overridden with
eyeZm.
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_H264_DEFAULT_EVBR",
default => "128k",
description => "Default bit-rate to use with FFMPEG for H264 event viewing",
help => qqq("
When using the eyeZm Plugin to view events in H264, FFMPEG
requires a bitrate to control the quality and bandwidth of the
video. This should be specified in a format acceptable to
FFMPEG. The default value is sufficient for most installations.
This is just a default parameter, and can be overridden with
eyeZm.
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_H264_TIMEOUT",
default => "20",
description => "Timeout (sec) to wait for H264 stream to start before terminating",
help => qqq("
The eyeZm Plugin will attempt to spawn an H264 stream when
requested, and require that it complete within the timeout
specified. If you have a slow system or find through the logs
that the H264 stream is not starting because the timeout is
expiring, even though FFMPEG is running, try increasing this
value. If you have a fast system, decreasing this value can
improve the responsiveness when there are issues starting H264
streams
"),
type => $types{string},
category => "eyeZm",
},
{
name => "ZM_EYEZM_SEG_DURATION",
default => "3",
description => "Segment duration used for streaming using HTTP-5 Streaming protocol",
help => qqq("
The HTTP-5 Live Streaming Protocol segments the input video
stream into small chunks of a duration specified by this
parameter. Increasing the segment duration will help with
choppy connections on the other end, but will increase the
latency in starting a stream.
"),
type => $types{string},
category => "eyeZm",
},
); );
our %options_hash = map { ( $_->{name}, $_ ) } @options; our %options_hash = map { ( $_->{name}, $_ ) } @options;

View File

@ -14,21 +14,19 @@ add_executable(zma zma.cpp)
add_executable(zmu zmu.cpp) add_executable(zmu zmu.cpp)
add_executable(zmf zmf.cpp) add_executable(zmf zmf.cpp)
add_executable(zms zms.cpp) add_executable(zms zms.cpp)
add_executable(zmstreamer zmstreamer.cpp)
target_link_libraries(zmc zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmc zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zma zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zma zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zmu zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmu zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zmf zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zmf zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zms zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) target_link_libraries(zms zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
target_link_libraries(zmstreamer zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS})
# Generate man files for the binaries destined for the bin folder # Generate man files for the binaries destined for the bin folder
FOREACH(CBINARY zma zmc zmf zmu zmstreamer) FOREACH(CBINARY zma zmc zmf zmu)
POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/${CBINARY}.cpp zoneminder-${CBINARY} 8) POD2MAN(${CMAKE_CURRENT_SOURCE_DIR}/${CBINARY}.cpp zoneminder-${CBINARY} 8)
ENDFOREACH(CBINARY zma zmc zmf zmu zmstreamer) ENDFOREACH(CBINARY zma zmc zmf zmu)
install(TARGETS zmc zma zmu zmf zmstreamer RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(TARGETS zmc zma zmu zmf RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(TARGETS zms RUNTIME DESTINATION "${ZM_CGIDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) install(TARGETS zms RUNTIME DESTINATION "${ZM_CGIDIR}" PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(CODE "execute_process(COMMAND ln -sf zms nph-zms WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})" ) install(CODE "execute_process(COMMAND ln -sf zms nph-zms WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})" )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nph-zms DESTINATION "${ZM_CGIDIR}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nph-zms DESTINATION "${ZM_CGIDIR}")

View File

@ -1,252 +0,0 @@
//
// ZoneMinder Streamer, $Date: 2010-10-14 23:21:00 +0200 (Thu, 14 Oct 2010) $
// Copyright (C) 2001-2010 Philip Coombes, Chris Kistner
//
// This program is based on revision 3143 of
// http://svn.zoneminder.com/svn/zm/trunk/src/zms.cpp
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/*
=head1 NAME
zmstreamer - eyeZM video streamer
=head1 SYNOPSIS
zmstreamer -e <mode>
zmstreamer -o <format>
zmstreamer -u <buffer size>
zmstreamer -f <maximum fps>
zmstreamer -s <scale>
zmstreamer -b <bitrate in bps>
zmstreamer -m <monitor id>
zmstreamer -d <debug mode>
zmstreamer -i
zmstreamer -?
zmstreamer -h
zmstreamer -v
=head1 DESCRIPTION
*DEPRECIATED* The xml skin and all files associated with the xml skin are now
depreciated. Please use the ZoneMinder API instead.
This binary works in conjunction with the XML skin to stream video to iPhones
running the eyeZm app.
=head1 OPTIONS
-e <mode> - Specify output mode: mpeg/jpg/zip/single/raw.
-o <format> - Specify output format.
-u <buffer size> - Specify buffer size in ms.
-f <maximum fps> - Specify maximum framerate.
-s <scale> - Specify scale.
-b <bitrate in bps> - Specify bitrate.
-m <monitor id> - Specify monitor id.
-d <debug mode> - 0 = off, 1 = no streaming, 2 = with streaming.
-i, -?, -h - Display usage information
-v - Print the installed version of ZoneMinder
=cut
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include "zm.h"
#include "zm_db.h"
#include "zm_user.h"
#include "zm_signal.h"
#include "zm_monitor.h"
#include "zm_stream.h"
// Possible command-line options
#define OPTIONS "e:o:u:f:s:b:m:d:i:?:h:v"
// Default ZMS values
#define ZMS_DEFAULT_DEBUG 0
#define ZMS_DEFAULT_ID 1
#define ZMS_DEFAULT_BITRATE 100000
#define ZMS_DEFAULT_SCALE 100
#define ZMS_DEFAULT_MODE "mpeg"
#define ZMS_DEFAULT_FORMAT "asf"
#define ZMS_DEFAULT_FPS 25.0
#define ZMS_DEFAULT_BUFFER 1000
int main(int argc, char** argv) {
self = argv[0];
// Set initial values to the default values
int debug = ZMS_DEFAULT_DEBUG;
int id = ZMS_DEFAULT_ID;
int bitrate = ZMS_DEFAULT_BITRATE;
int scale = ZMS_DEFAULT_SCALE;
char mode[32];
sprintf(mode, "%s", ZMS_DEFAULT_MODE);
char format[32];
sprintf(format, "%s", ZMS_DEFAULT_FORMAT);
double maxfps = ZMS_DEFAULT_FPS;
int buffer = ZMS_DEFAULT_BUFFER;
// Parse command-line options
int arg;
while ((arg = getopt(argc, argv, OPTIONS)) != -1) {
switch (arg) {
case 'e':
sprintf(mode, "%s", optarg);
break;
case 'o':
sprintf(format, "%s", optarg);
break;
case 'u':
buffer = atoi(optarg);
break;
case 'f':
maxfps = atof(optarg);
break;
case 's':
scale = atoi(optarg);
break;
case 'b':
bitrate = atoi(optarg);
break;
case 'm':
id = atoi(optarg);
break;
case 'd':
debug = atoi(optarg);
break;
case 'h':
case 'i':
case '?':
printf("-e <mode> : Specify output mode: mpeg/jpg/zip/single/raw. Default = %s\n", ZMS_DEFAULT_MODE);
printf("-o <format> : Specify output format. Default = %s\n", ZMS_DEFAULT_FORMAT);
printf("-u <buffer size> : Specify buffer size in ms. Default = %d\n", ZMS_DEFAULT_BUFFER);
printf("-f <maximum fps> : Specify maximum framerate. Default = %lf\n", ZMS_DEFAULT_FPS);
printf("-s <scale> : Specify scale. Default = %d\n", ZMS_DEFAULT_SCALE);
printf("-b <bitrate in bps> : Specify bitrate. Default = %d\n", ZMS_DEFAULT_BITRATE);
printf("-m <monitor id> : Specify monitor id. Default = %d\n", ZMS_DEFAULT_ID);
printf("-d <debug mode> : 0 = off, 1 = no streaming, 2 = with streaming. Default = 0\n");
printf("-i or -? or -h: This information\n");
printf("-v : This installed version of ZoneMinder\n");
return EXIT_SUCCESS;
case 'v':
std::cout << ZM_VERSION << "\n";
exit(0);
}
}
// Set stream type
StreamBase::StreamType streamtype;
if (!strcasecmp("raw", mode))
streamtype = MonitorStream::STREAM_RAW;
else if (!strcasecmp("mpeg", mode))
streamtype = MonitorStream::STREAM_MPEG;
else if (!strcasecmp("jpg", mode))
streamtype = MonitorStream::STREAM_JPEG;
else if (!strcasecmp("single", mode))
streamtype = MonitorStream::STREAM_SINGLE;
else if (!strcasecmp("zip", mode))
streamtype = MonitorStream::STREAM_ZIP;
else
streamtype = MonitorStream::STREAM_MPEG;
if (debug) {
// Show stream parameters
printf("Stream parameters:\n");
switch (streamtype) {
case MonitorStream::STREAM_MPEG:
printf("Output mode (-e) = %s\n", "mpeg");
printf("Output format (-o) = %s\n", format);
break;
default:
printf("Output mode (-e) = %s\n", mode);
}
printf("Buffer size (-u) = %d ms\n", buffer);
printf("Maximum FPS (-f) = %lf FPS\n", maxfps);
printf("Scale (-s) = %d%%\n", scale);
printf("Bitrate (-b) = %d bps\n", bitrate);
printf("Monitor Id (-m) = %d\n", id);
}
if (debug) {
// Set ZM debugger to print to stdout
printf("Setting up ZoneMinder debugger to print to stdout...");
setenv("ZM_DBG_PRINT", "1", 1);
printf("Done.\n");
}
// Loading ZM configurations
printf("Loading ZoneMinder configurations...");
zmLoadConfig();
printf("Done.\n");
logInit("zmstreamer");
ssedetect();
// Setting stream parameters
MonitorStream stream;
stream.setStreamScale(scale); // default = 100 (scale)
stream.setStreamReplayRate(100); // default = 100 (rate)
stream.setStreamMaxFPS(maxfps); // default = 10 (maxfps)
if (debug) stream.setStreamTTL(1);
else stream.setStreamTTL(0); // default = 0 (ttl)
stream.setStreamQueue(0); // default = 0 (connkey)
stream.setStreamBuffer(buffer); // default = 0 (buffer)
stream.setStreamStart(id); // default = 0 (monitor_id)
stream.setStreamType(streamtype);
if (streamtype == MonitorStream::STREAM_MPEG) {
#if HAVE_LIBAVCODEC
if (debug) printf("HAVE_LIBAVCODEC is set\n");
stream.setStreamFormat(format); // default = "" (format)
stream.setStreamBitrate(bitrate); // default = 100000 (bitrate)
#else
fprintf(stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n");
logTerm();
zmDbClose();
return EXIT_FAILURE;
#endif
}
if (debug != 1) {
if (debug) printf("Running stream...");
// Output headers
fprintf(stdout, "Server: ZoneMinder Video Server/%s\r\n", ZM_VERSION);
time_t now = time(0);
char date_string[64];
strftime(date_string, sizeof (date_string) - 1, "%a, %d %b %Y %H:%M:%S GMT", gmtime(&now));
fprintf(stdout, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n");
fprintf(stdout, "Last-Modified: %s\r\n", date_string);
fprintf(stdout, "Cache-Control: no-store, no-cache, must-revalidate\r\n");
fprintf(stdout, "Cache-Control: post-check=0, pre-check=0\r\n");
fprintf(stdout, "Pragma: no-cache\r\n");
// Run stream
stream.runStream();
}
if (debug) printf("Done.\n");
logTerm();
zmDbClose();
return (EXIT_SUCCESS);
}

View File

@ -921,7 +921,6 @@ if ( !empty($action) )
case "highband" : case "highband" :
case "medband" : case "medband" :
case "lowband" : case "lowband" :
case "phoneband" :
break; break;
} }
} }

View File

@ -42,8 +42,6 @@ $tabs['x10'] = translate('X10');
$tabs['highband'] = translate('HighBW'); $tabs['highband'] = translate('HighBW');
$tabs['medband'] = translate('MediumBW'); $tabs['medband'] = translate('MediumBW');
$tabs['lowband'] = translate('LowBW'); $tabs['lowband'] = translate('LowBW');
$tabs['phoneband'] = translate('PhoneBW');
$tabs['eyeZm'] = "eyeZm";
$tabs['users'] = translate('Users'); $tabs['users'] = translate('Users');
if ( isset($_REQUEST['tab']) ) if ( isset($_REQUEST['tab']) )

View File

@ -1,311 +0,0 @@
/*
* Primary look and feel styles
*/
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 100%;
color: #333333;
font-weight: normal;
text-align: center;
}
h1 {
font-family: inherit;
font-size: 120%;
color: #000066;
font-weight: bold;
}
h2 {
font-family: inherit;
font-size: 110%;
color: #000066;
font-weight: bold;
}
h3 {
font-family: inherit;
font-size: 100%;
color: #016A9D;
font-weight: bold;
}
p {
font-family: inherit;
font-size: 100%;
color: #333333;
font-weight: normal;
}
th {
font-weight: bold;
color: #016A9D;
}
a:link {
color: #7F7FB2;
text-decoration: none;
}
a:visited {
color: #7F7FB2;
text-decoration: none;
}
a:hover {
color: #666699;
text-decoration: underline;
}
label {
margin-right: 4px;
}
input,textarea,select {
border: 1px #7F7FB2 solid;
font-family: inherit;
font-size: 100%;
color: #333333;
}
input[type=text], input[type=password], textarea {
padding: 1px;
}
input.noborder {
border: 0;
}
input[disabled] {
color: #888888;
}
img.normal {
border: white solid 1px;
}
img.alarm {
border: red solid 1px;
}
hr {
height: 1px;
width: 100%;
border: 0;
color: #7f7fb2;
background-color: #7f7fb2;
}
/*
* Major league table for multiple inputs or presentation
*/
#content table.major {
margin: 4px auto;
width: 100%;
border-collapse: collapse;
}
#content table.major tr.highlight {
background-color: #eeeeee;
}
#content table.major thead tr th {
padding-top: 6px;
padding-bottom: 6px;
vertical-align: middle;
}
#content table.major tfoot td {
padding-top: 6px;
padding-bottom: 6px;
vertical-align: middle;
}
#content table.major th, #content table.major td {
border: 1px solid #7f7fb2;
padding: 3px;
text-align: left;
}
#content table.major th {
vertical-align: bottom;
}
#content table.major td {
vertical-align: middle;
}
#content table.major th[scope=row] {
padding: 4px 3px 3px;
vertical-align: top;
text-align: right;
}
#content table.major .colMark, #content table.major .colSelect {
text-align: center;
}
/*
* Lesser table for very simple forms
*/
#content table.minor {
width: 200px;
margin: 0 auto;
}
#content table.minor td {
padding: 4px;
}
#content table.minor .colLeft {
width: 50%;
text-align: right;
}
#content table.minor .colRight {
width: 50%;
text-align: left;
}
#content table.minor input[type=submit]
{
margin-top: 4px;
padding: 0 2px;
font-size: 120%;
}
/*
* Behavior classes
*/
.error {
/*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-size: 100%;
color: #DC143C;
font-weight: bold;
}
.warn {
/*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-size: 100%;
color: #FF8C00;
font-weight: bold;
}
.info {
/*font-family: Verdana, Arial, Helvetica, sans-serif;*/
font-size: 100%;
color: #688E23;
font-weight: bold;
}
.errorText {
color: #DC143C;
}
.warnText {
color: #FF8C00;
}
.infoText {
color: #688E23;
}
.disabledText {
font-style: italic;
}
/*
* Generic useful classes, especially with mootools
*/
.hidden {
display: none;
}
.invisible {
visibility: hidden;
}
.nowrap {
white-space: nowrap;
}
div.clear {
clear: both;
}
/*
* Primary layout styles
*/
#page {
width: 100%;
}
#header {
width: 98%;
line-height: 24px;
margin: 4px auto 0;
clear: both;
}
#header h2 {
left: 0;
}
#headerControl {
}
#headerButtons {
float: right;
}
#headerButtons a {
margin-left: 8px;
}
#content {
width: 98%;
margin: 4px auto;
line-height: 130%;
text-align: center;
clear: both;
}
#contentTable {
width: 100%;
}
#content p {
margin-top: 4px;
}
#content p.textblock {
text-align: justify;
padding: 4px;
}
#content > input[type=submit], #content > input[type=button] {
margin-top: 4px;
}
#content table input[type=submit], #content table input[type=button] {
margin-top: 0;
}
#contentButtons {
margin: 4px auto 0;
}
#contentButtons input, #contentButtons a {
margin: 0 4px;
}
#footer {
width: 98%;
margin: 4px auto 0;
clear: both;
}

View File

@ -1,63 +0,0 @@
<?php
//
// ZoneMinder xHTML configuration file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
define( 'DEVICE_WIDTH', 240 ); // Default device width for phones and handhelds
define( 'DEVICE_HEIGHT', 320 ); // Default device height for phones and handhelds
define( 'DEVICE_LINES', 10 ); // Default device lines for phones and handhelds
$rates = array(
"5000" => "50x",
"2000" => "20x",
"500" => "5x",
"200" => "2x",
"100" => translate('Real'),
"50" => "1/2x",
);
$scales = array(
"400" => "4x",
"300" => "3x",
"200" => "2x",
"150" => "1.5x",
"100" => translate('Actual'),
"75" => "3/4x",
"50" => "1/2x",
"33" => "1/3x",
"25" => "1/4x",
);
switch ( $_COOKIE['zmBandwidth'] )
{
case "phone" : // Very incomplete at present
{
define( "ZM_WEB_CAN_STREAM", ZM_WEB_P_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_P_STREAM_METHOD ); // Which method should be used to send video streams to your brow
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_P_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_P_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_P_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_P_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_P_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_P_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
}
?>

View File

@ -1,184 +0,0 @@
<?php
//
// ZoneMinder web control function library, $Date: 2008-07-25 10:48:16 +0100 (Fri, 25 Jul 2008) $, $Revision: 2612 $
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
function getControlCommands( $monitor )
{
$cmds = array();
$cmds['Wake'] = "wake";
$cmds['Sleep'] = "sleep";
$cmds['Reset'] = "reset";
$cmds['PresetSet'] = "presetSet";
$cmds['PresetGoto'] = "presetGoto";
$cmds['PresetHome'] = "presetHome";
if ( !empty($monitor['CanZoom']) )
{
if ( $monitor['CanZoomCon'] )
$cmds['ZoomRoot'] = "zoomCon";
elseif ( $monitor['CanZoomRel'] )
$cmds['ZoomRoot'] = "zoomRel";
elseif ( $monitor['CanZoomAbs'] )
$cmds['ZoomRoot'] = "zoomAbs";
$cmds['ZoomTele'] = $cmds['ZoomRoot']."Tele";
$cmds['ZoomWide'] = $cmds['ZoomRoot']."Wide";
$cmds['ZoomStop'] = "zoomStop";
$cmds['ZoomAuto'] = "zoomAuto";
$cmds['ZoomMan'] = "zoomMan";
}
if ( !empty($monitor['CanFocus']) )
{
if ( $monitor['CanFocusCon'] )
$cmds['FocusRoot'] = "focusCon";
elseif ( $monitor['CanFocusRel'] )
$cmds['FocusRoot'] = "focusRel";
elseif ( $monitor['CanFocusAbs'] )
$cmds['FocusRoot'] = "focusAbs";
$cmds['FocusFar'] = $cmds['FocusRoot']."Far";
$cmds['FocusNear'] = $cmds['FocusRoot']."Near";
$cmds['FocusStop'] = "focusStop";
$cmds['FocusAuto'] = "focusAuto";
$cmds['FocusMan'] = "focusMan";
}
if ( !empty($monitor['CanIris']) )
{
if ( $monitor['CanIrisCon'] )
$cmds['IrisRoot'] = "irisCon";
elseif ( $monitor['CanIrisRel'] )
$cmds['IrisRoot'] = "irisRel";
elseif ( $monitor['CanIrisAbs'] )
$cmds['IrisRoot'] = "irisAbs";
$cmds['IrisOpen'] = $cmds['IrisRoot']."Open";
$cmds['IrisClose'] = $cmds['IrisRoot']."Close";
$cmds['IrisStop'] = "irisStop";
$cmds['IrisAuto'] = "irisAuto";
$cmds['IrisMan'] = "irisMan";
}
if ( !empty($monitor['CanWhite']) )
{
if ( $monitor['CanWhiteCon'] )
$cmds['WhiteRoot'] = "whiteCon";
elseif ( $monitor['CanWhiteRel'] )
$cmds['WhiteRoot'] = "whiteRel";
elseif ( $monitor['CanWhiteAbs'] )
$cmds['WhiteRoot'] = "whiteAbs";
$cmds['WhiteIn'] = $cmds['WhiteRoot']."In";
$cmds['WhiteOut'] = $cmds['WhiteRoot']."Out";
$cmds['WhiteAuto'] = "whiteAuto";
$cmds['WhiteMan'] = "whiteMan";
}
if ( !empty($monitor['CanGain']) )
{
if ( $monitor['CanGainCon'] )
$cmds['GainRoot'] = "gainCon";
elseif ( $monitor['CanGainRel'] )
$cmds['GainRoot'] = "gainRel";
elseif ( $monitor['CanGainAbs'] )
$cmds['GainRoot'] = "gainAbs";
$cmds['GainUp'] = $cmds['GainRoot']."Up";
$cmds['GainDown'] = $cmds['GainRoot']."Down";
$cmds['GainAuto'] = "gainAuto";
$cmds['GainMan'] = "gainMan";
}
if ( !empty($monitor['CanMove']) )
{
if ( $monitor['CanMoveCon'] )
{
$cmds['MoveRoot'] = "moveCon";
$cmds['Center'] = "moveStop";
}
elseif ( $monitor['CanMoveRel'] )
{
$cmds['MoveRoot'] = "moveRel";
$cmds['Center'] = $cmds['PresetHome'];
}
elseif ( $monitor['CanMoveAbs'] )
{
$cmds['MoveRoot'] = "moveAbs";
$cmds['Center'] = $cmds['PresetHome'];
}
$cmds['MoveUp'] = $cmds['MoveRoot']."Up";
$cmds['MoveDown'] = $cmds['MoveRoot']."Down";
$cmds['MoveLeft'] = $cmds['MoveRoot']."Left";
$cmds['MoveRight'] = $cmds['MoveRoot']."Right";
$cmds['MoveUpLeft'] = $cmds['MoveRoot']."UpLeft";
$cmds['MoveUpRight'] = $cmds['MoveRoot']."UpRight";
$cmds['MoveDownLeft'] = $cmds['MoveRoot']."DownLeft";
$cmds['MoveDownRight'] = $cmds['MoveRoot']."DownRight";
}
return( $cmds );
}
function controlPresets( $monitor, $cmds )
{
define( "MAX_PRESETS", "10" );
$sql = "select * from ControlPresets where MonitorId = '".$monitor['Id']."'";
$labels = array();
foreach( dbFetchAll( $sql ) as $row )
{
$labels[$row['Preset']] = $row['Label'];
}
ob_start();
?>
<div class="presetControls">
<div>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="<?php echo $_REQUEST['view'] ?>"/>
<input type="hidden" name="action" value="control"/>
<input type="hidden" name="mid" value="<?php echo $monitor['Id'] ?>"/>
<input type="hidden" name="control" value="<?php echo $cmds['PresetGoto'] ?>"/>
</fieldset>
</div>
<div>
<?php
for ( $i = 1; $i <= min($monitor['NumPresets'],MAX_PRESETS); $i++ )
{
?>
<input type="submit" class="ptzNumBtn" title="<?php echo isset($labels[$i])?$labels[$i]:"" ?>" name="preset" value="<?php echo $i ?>"/>
<?php
}
?>
</div>
</form>
</div>
</div>
<?php
return( ob_get_clean() );
}
function ptzControls( $monitor )
{
$cmds = getControlCommands( $monitor );
if ( $monitor['HasPresets'] )
echo controlPresets( $monitor, $cmds );
return( ob_get_clean() );
}
?>

View File

@ -1,66 +0,0 @@
<?php
function getDeviceScale( $width, $height, $divisor=1 )
{
global $device;
$deviceWidth = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$deviceHeight = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
// Allow for margins etc
//$deviceWidth -= 4;
//$deviceHeight -= 4;
$widthScale = ($deviceWidth*SCALE_BASE)/$width;
$heightScale = ($deviceHeight*SCALE_BASE)/$height;
$scale = ($widthScale<$heightScale)?$widthScale:$heightScale;
if ( $divisor != 1.0 )
$scale = $scale/$divisor;
return( intval($scale) );
}
function xhtmlHeaders( $file, $title )
{
$skinCssFile = getSkinFile( 'css/skin.css' );
$skinCssPhpFile = getSkinFile( 'css/skin.css.php' );
$basename = basename( $file, '.php' );
$viewCssFile = getSkinFile( 'views/css/'.$basename.'.css' );
$viewCssPhpFile = getSkinFile( 'views/css/'.$basename.'.css.php' );
extract( $GLOBALS, EXTR_OVERWRITE );
noCacheHeaders();
header("Content-type: application/xhtml+xml" );
echo( '<?xml version="1.0" encoding="iso-8859-1"?>'."\n" );
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo ZM_WEB_TITLE_PREFIX ?> - <?php echo $title ?></title>
<link rel="icon" type="image/ico" href="graphics/favicon.ico"/>
<link rel="shortcut icon" href="graphics/favicon.ico"/>
<link rel="stylesheet" href="css/reset.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="<?php echo $skinCssFile ?>" type="text/css" media="screen"/>
<?php
if ( $viewCssFile )
{
?>
<link rel="stylesheet" href="<?php echo $viewCssFile ?>" type="text/css" media="screen"/>
<?php
}
if ( $viewCssPhpFile )
{
?>
<style type="text/css">
<?php
require_once( $viewCssPhpFile );
?>
</style>
<?php
}
?>
</head>
<?php
}
?>

View File

@ -1,29 +0,0 @@
<?php
ini_set( "arg_separator.output", "&amp;" );
ini_set( "url_rewriter.tags", "a=href,area=href,frame=src,input=src,fieldset=" );
$cookies = false;
if ( count($_COOKIE) || !empty($_REQUEST['cookies']) )
$cookies = true;
if ( $cookies )
{
ini_set( "session.use_cookies", "1" );
ini_set( "session.use_trans_sid", "0" );
ini_set( "url_rewriter.tags", "" );
}
else
{
//ini_set( "session.auto_start", "1" );
ini_set( "session.use_cookies", "0" );
ini_set( "session.use_trans_sid", "1" );
}
if ( !isset($_SESSION['cookies']) )
{
$_SESSION['cookies'] = $cookies;
if ( $cookies )
setcookie( "cookies", $cookies );
}
?>

View File

@ -1,97 +0,0 @@
<?php
//
// ZoneMinder HTML interface file, $Date: 2008-07-08 16:06:45 +0100 (Tue, 08 Jul 2008) $, $Revision: 2484 $
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$_COOKIE['zmBandwidth'] = "phone";
//ini_set( "magic_quotes_gpc", "Off" );
// Uncomment if there are language overrides
//if ( $skinLangFile = loadLanguage( ZM_SKIN_PATH ) )
//require_once( $skinLangFile );
if ( isset($_GET['devWidth']) )
{
$device['width'] = $_GET['devWidth'];
}
if ( isset($_GET['devHeight']) )
{
$device['height'] = $_GET['devHeight'];
}
if ( isset($device) )
$_SESSION['device'] = $device;
$wurflFile = "wurfl/wurfl_class.php";
if ( file_exists( $wurflFile ) )
{
require_once( $wurflFile );
$wurfl = new wurfl_class( $wurfl, $wurfl_agents );
// Set the user agent
$wurfl->GetDeviceCapabilitiesFromAgent($_SERVER['HTTP_USER_AGENT']);
//print_r( $wurfl->wurfl_agent );
if ( $wurfl->wurfl_agent )
{
if ( $wurfl->getDeviceCapability( 'html_wi_oma_xhtmlmp_1_0' ) )
{
$device['width'] = $wurfl->getDeviceCapability( 'resolution_width' );
$device['height'] = $wurfl->getDeviceCapability( 'resolution_height' );
}
}
}
else
{
// This is an example of using fixed device strings to just match your phone etc
$devices = array(
array( 'name'=>"Motorola V600", 'ua_match'=>"MOT-V600", 'skin'=>"mobile", 'cookies'=>false, 'width'=>176, 'height'=>220 ),
);
foreach ( $devices as $tempDevice )
{
if ( preg_match( '/'.$tempDevice['ua_match'].'/', $_SERVER['HTTP_USER_AGENT'] ) )
{
$skin = $tempDevice['skin'];
$cookies = $tempDevice['cookies'];
break;
}
}
}
foreach ( getSkinIncludes( 'includes/config.php' ) as $includeFile )
require_once $includeFile;
foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile )
require_once $includeFile;
if ( empty($view) )
$view = isset($user)?'console':'login';
if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) )
{
$view = "postlogin";
$action = "login";
$_REQUEST['username'] = $_SERVER['REMOTE_USER'];
}
// If there are additional actions
foreach ( getSkinIncludes( 'includes/actions.php' ) as $includeFile )
require_once $includeFile;
?>

View File

@ -1,178 +0,0 @@
<?php
//
// ZoneMinder web console file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
$eventCounts = array(
// Last Hour
array(
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ),
)
),
),
// Today
array(
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "today" ),
)
),
),
);
$running = daemonCheck();
$status = $running?translate('Running'):translate('Stopped');
if ( $group = dbFetchOne( "select * from Groups where Name = 'Mobile'" ) )
$groupIds = array_flip(explode( ',', $group['MonitorIds'] ));
$maxWidth = 0;
$maxHeight = 0;
$cycleCount = 0;
$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" );
for ( $i = 0; $i < count($monitors); $i++ )
{
if ( !visibleMonitor( $monitors[$i]['Id'] ) )
{
continue;
}
if ( $group && !empty($groupIds) && !array_key_exists( $monitors[$i]['Id'], $groupIds ) )
{
continue;
}
$monitors[$i]['Show'] = true;
$monitors[$i]['zmc'] = zmcStatus( $monitors[$i] );
$monitors[$i]['zma'] = zmaStatus( $monitors[$i] );
$counts = array();
for ( $j = 0; $j < count($eventCounts); $j++ )
{
$filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['terms']), array( "cnj" => "and", "attr" => "MonitorId", "op" => "=", "val" => $monitors[$i]['Id'] ) );
parseFilter( $filter, false, '&amp;' );
$counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j";
$monitors[$i]['eventCounts'][$j]['filter'] = $filter;
}
$sql = "select ".join($counts,", ")." from Events as E where MonitorId = '".$monitors[$i]['Id']."'";
$counts = dbFetchOne( $sql );
if ( $monitors[$i]['Function'] != 'None' )
{
$cycleCount++;
if ( $maxWidth < $monitors[$i]['Width'] ) $maxWidth = $monitors[$i]['Width'];
if ( $maxHeight < $monitors[$i]['Height'] ) $maxHeight = $monitors[$i]['Height'];
}
$monitors[$i] = array_merge( $monitors[$i], $counts );
}
xhtmlHeaders( __FILE__, translate('Console') );
?>
<body>
<div id="page">
<div id="header">
<div id="systemTime"><a href="?view=<?php echo $view ?>"><?php echo preg_match( '/%/', DATE_FMT_CONSOLE_SHORT )?strftime( DATE_FMT_CONSOLE_SHORT ):date( DATE_FMT_CONSOLE_SHORT ) ?></a></div>
<div id="systemStats"><?php echo getLoad() ?>/<?php echo getDiskPercent() ?>%</div>
<div id="systemState"><?php echo makeLink( "?view=state", $status, canEdit( 'System' ) ) ?></div>
</div>
<div id="content">
<table id="contentTable">
<?php
for ( $i = 0; $i < count($eventCounts); $i++ )
{
$eventCounts[$i]['total'] = 0;
}
$zoneCount = 0;
foreach( $monitors as $monitor )
{
if ( empty($monitor['Show']) )
continue;
for ( $i = 0; $i < count($eventCounts); $i++ )
{
$eventCounts[$i]['total'] += $monitor['EventCount'.$i];
}
//$zoneCount += $monitor['ZoneCount'];
?>
<tr>
<?php
if ( !$monitor['zmc'] )
$dclass = "errorText";
else
{
if ( !$monitor['zma'] )
$dclass = "warnText";
else
$dclass = "infoText";
}
if ( $monitor['Function'] == 'None' )
$fclass = "errorText";
elseif ( $monitor['Function'] == 'Monitor' )
$fclass = "warnText";
else
$fclass = "infoText";
if ( !$monitor['Enabled'] )
$fclass .= " disabledText";
?>
<td class="colName"><?php echo makeLink( "?view=watch&amp;mid=".$monitor['Id'], substr( $monitor['Name'], 0, 8 ), $running && ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
<td class="colFunction"><?php echo makeLink( "?view=function&amp;mid=".$monitor['Id'], "<span class=\"$fclass\">".substr( $monitor['Function'], 0, 4 )."</span>", canEdit( 'Monitors' ) ) ?></td>
<?php
for ( $i = 0; $i < count($eventCounts); $i++ )
{
?>
<td class="colEvents"><?php echo makeLink( "?view=events&amp;page=1".$monitor['eventCounts'][$i]['filter']['query'], $monitor['EventCount'.$i], canView( 'Events' ) ) ?></td>
<?php
}
?>
</tr>
<?php
}
?>
<tr>
<?php
if ( ZM_OPT_X10 ) {
?>
<td><?php echo makeLink( "?view=devices", translate('Devices'), canView('Devices' ) ) ?></td>
<?php
} else {
?>
<td>&nbsp;</td>
<?php
}
if ( $cycleCount > 1 ) {
?>
<td><?php echo makeLink( "?view=montage", translate('Montage'), $running && canView( 'Stream' ) ) ?></td>
<?php
} else {
?>
<td>&nbsp;</td>
<?php
}
for ( $i = 0; $i < count($eventCounts); $i++ )
{
parseFilter( $eventCounts[$i]['filter'], false, '&amp;' );
?>
<td class="colEvents"><?php echo makeLink( "?view=events&amp;page=1".$eventCounts[$i]['filter']['query'], $eventCounts[$i]['total'], canView( 'Events' ) ) ?></td>
<?php
}
?>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@ -1,16 +0,0 @@
#systemTime {
float: left;
}
#systemState {
margin: 0 auto;
text-align: center;
}
#systemStats {
float: right;
}
td.colEvents {
text-align: right;
}

View File

@ -1,73 +0,0 @@
<?php
//
// ZoneMinder web devices file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Devices' ) )
{
$_REQUEST['view'] = "error";
return;
}
$sql = "select * from Devices where Type = 'X10' order by Name";
$devices = array();
foreach ( dbFetchAll( $sql ) as $row )
{
$row['Status'] = getDeviceStatusX10( $row['KeyString'] );
$devices[] = $row;
}
xhtmlHeaders( __FILE__, translate('Devices') );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('Devices') ?></h2>
</div>
<div id="content">
<table id="contentTable" class="major">
<?php
foreach( $devices as $device )
{
if ( $device['Status'] == 'ON' )
{
$fclass = "infoText";
}
elseif ( $device['Status'] == 'OFF' )
{
$fclass = "warnText";
}
else
{
$fclass = "errorText";
}
?>
<tr>
<th scope="row" class="<?php echo $fclass ?>"><span class="<?php echo $fclass ?>"><?php echo substr( $device['Name'], 0, 16 ) ?></span></th>
<td><?php echo makeLink( "?view=".$_REQUEST['view']."&amp;action=device&amp;key=".$device['KeyString']."&amp;command=on", translate('On'), canEdit('Devices') ) ?></td>
<td><?php echo makeLink( "?view=".$_REQUEST['view']."&amp;action=device&amp;key=".$device['KeyString']."&amp;command=off", translate('Off'), canEdit('Devices') ) ?></td>
</tr>
<?php
}
?>
</table>
<p><a href="?view=console"><?php echo translate('Console') ?></a></p>
</div>
</div>
</body>
</html>

View File

@ -1,34 +0,0 @@
<?php
//
// ZoneMinder web error view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
xhtmlHeaders( __FILE__, translate('Error') );
?>
<body>
<div id="page">
<div id="header">
<h1>ZoneMinder <?php echo translate('Error') ?></h1>
</div>
<div id="content">
<p><strong><?php echo translate('YouNoPerms') ?></p>
<p><?php echo translate('ContactAdmin') ?></p>
</div>
</div>
</body>
</html>

View File

@ -1,147 +0,0 @@
<?php
//
// ZoneMinder web event view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$midSql = '';
if ( $user['MonitorIds'] )
{
$midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
}
$sql = 'select E.*,M.Name as MonitorName from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = ?'.$midSql;
$event = dbFetchOne( $sql, NULL, array($_REQUEST['eid']) );
if ( !empty($_REQUEST['fid']) )
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND FrameId = ?', NULL, array($_REQUEST['eid'],$_REQUEST['fid']) );
}
elseif ( isset($_REQUEST['fid']) )
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND Score = ?', NULL, array($_REQUEST['eid'],$event['MaxScore']) );
$_REQUEST['fid'] = $frame['FrameId'];
}
parseSort( true, '&amp;' );
parseFilter( $_REQUEST['filter'], true, '&amp;' );
$filterQuery = $_REQUEST['filter']['query'];
if ( $sortOrder=='asc' ) {
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn <= ?".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn desc";
} else {
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn >= ?".$_REQUEST['filter']['sql'].$midSql." order by $sortColumn asc";
}
$result = dbQuery( $sql, array( $event[$_REQUEST['sort_field']] ) );
while ( $row = dbFetchNext( $result ) )
{
if ( $row['Id'] == $_REQUEST['eid'] )
{
$prevEvent = dbFetchNext( $result );
break;
}
}
$sql = "select E.* from Events as E inner join Monitors as M on E.MonitorId = M.Id where $sortColumn ".($sortOrder=='asc'?'>=':'<=').' ?'.$_REQUEST['filter']['sql'].$midSql." order by $sortColumn $sortOrder";
$result = dbQuery( $sql, array($event[$_REQUEST['sort_field']]) );
while ( $row = dbFetchNext( $result ) )
{
if ( $row['Id'] == $_REQUEST['eid'] )
{
$nextEvent = dbFetchNext( $result );
break;
}
}
$framesPerPage = 15;
$framesPerLine = 3;
$maxShortcuts = 3;
$paged = $event['Frames'] > $framesPerPage;
if ( $paged && !empty($_REQUEST['page']) )
{
$loFrameId = (($_REQUEST['page']-1)*$framesPerPage)+1;
$hiFrameId = min( $_REQUEST['page']*$framesPerPage, $event['Frames'] );
}
else
{
$loFrameId = 1;
$hiFrameId = $event['Frames'];
}
$sql = 'SELECT * FROM Frames WHERE EventID = ?';
if ( $paged && !empty($_REQUEST['page']) )
$sql .= " and FrameId between $loFrameId and $hiFrameId";
$sql .= " order by FrameId";
$frames = dbFetchAll( $sql, NULL, array( $_REQUEST['eid'] ) );
$scale = getDeviceScale( $event['Width'], $event['Height'], $framesPerLine+0.3 );
$pages = (int)ceil($event['Frames']/$framesPerPage);
if ( !empty($_REQUEST['fid']) )
$_REQUEST['page'] = ($_REQUEST['fid']/$framesPerPage)+1;
$pagination = getPagination( $pages, $_REQUEST['page'], $maxShortcuts, '&amp;eid='.$_REQUEST['eid'].$filterQuery.$sortQuery, '&amp;' );
xhtmlHeaders( __FILE__, translate('Event').' - '.$event['Name'] );
?>
<body>
<div id="page">
<div id="header">
<?php
if ( canEdit( 'Events' ) )
{
?>
<div id="headerButtons">
<a href="?view=events&amp;action=delete&amp;mark_eid=<?php echo $_REQUEST['eid'] ?><?php echo $filterQuery ?><?php echo $sortQuery ?>&amp;limit=<?php echo $_REQUEST['limit'] ?>&amp;page=<?php echo $_REQUEST['page'] ?>"><?php echo translate('Delete') ?></a>
</div>
<?php
}
?>
<h2><?php echo makeLink( '?view=eventdetails&amp;eid='.$_REQUEST['eid'], $event['Name'].($event['Archived']?'*':''), canEdit( 'Events' ) ) ?></h2>
</div>
<div id="content">
<?php
if ( $pagination )
{
?>
<h3 class="pagination"><?php echo $pagination ?></h3>
<?php
}
?>
<div id="eventFrames">
<?php
foreach ( $frames as $frame )
{
$imageData = getImageSrc( $event, $frame, $scale );
?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $frame['FrameId'] ?>"><img src="<?php echo viewImagePath( $imageData['thumbPath'] ) ?>" class="<?php echo $imageData['imageClass'] ?>" alt="<?php echo $frame['Type'] ?>/<?php echo $frame['Type']=='Alarm'?$frame['Score']:0 ?>"/></a>
<?php
}
?>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,86 +0,0 @@
<?php
//
// ZoneMinder web event details view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$event = dbFetchOne( 'select E.*,M.Name as MonitorName from Events as E, Monitors as M where E.Id = ? and E.MonitorId = M.Id', NULL, array($_REQUEST['eid']) );
$frame = dbFetchOne( 'select * from Frames where EventID = ? and Score = ?', NULL, array($_REQUEST['eid'],$event['MaxScore']) );
$scale = getDeviceScale( $event['Width'], $event['Height'], 2.2 );
$image1 = getImageSrc( $event, 1, $scale );
if ( $frame['Type'] == 'Alarm' )
$image2 = getImageSrc( $event, $frame['FrameId'], $scale );
else
$image2 = getImageSrc( $event, intval($event['Frames']/2), $scale );
xhtmlHeaders( __FILE__, translate('Event').' - '.$_REQUEST['eid'] );
?>
<body>
<div id="page">
<div id="content">
<table id="contentTable" class="major">
<tr>
<th scope="row"><?php echo translate('Name') ?></th>
<td><?php echo htmlentities($event['Name']) ?><?php echo $event['Archived']?("(".translate('Archived').")"):"" ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('Time') ?></th>
<td><?php echo htmlentities(strftime("%b %d, %H:%M",strtotime($event['StartTime']))) ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('Duration') ?></th>
<td><?php echo htmlentities($event['Length']) ?>s</td>
</tr>
<tr>
<th scope="row"><?php echo translate('Cause') ?></th>
<td><?php echo htmlentities($event['Cause']) ?></td>
</tr>
<?php if ( !empty($event['Notes']) ) { ?>
<tr>
<th scope="row"><?php echo translate('Notes') ?></th>
<td><?php echo htmlentities($event['Notes']) ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><?php echo translate('Frames') ?></th>
<td><?php echo $event['Frames'] ?> (<?php echo $event['AlarmFrames'] ?>)</td>
</tr>
<tr>
<th scope="row"><?php echo translate('Score') ?></th>
<td><?php echo $event['TotScore'] ?>/<?php echo $event['AvgScore'] ?>/<?php echo $event['MaxScore'] ?></td>
</tr>
</table>
<div id="eventImages">
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=1"><img src="<?php echo viewImagePath( $image1['thumbPath'] ) ?>" alt="1"/></a>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $frame['FrameId'] ?>"><img src="<?php echo viewImagePath( $image2['thumbPath'] ) ?>" alt="<?php echo $frame['FrameId'] ?>"/></a>
</div>
<div id="contenButtons">
<a href="?view=event&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;page=1"><?php echo translate('Frames') ?></a>
<a href="?view=video&amp;eid=<?php echo $_REQUEST['eid'] ?>"><?php echo translate('Video') ?></a>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,157 +0,0 @@
<?php
//
// ZoneMinder web events view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$view = "error";
return;
}
$sql = "select * from Monitors";
foreach ( dbFetchAll( $sql ) as $row )
{
$monitors[$row['Id']] = $row;
}
if ( isset($_REQUEST['filterName']) )
{
$dbFilter = dbFetchOne( 'SELECT * FROM Filters WHERE Name = ?', NULL, array($_REQUEST['filterName']) );
$_REQUEST['filter'] = jsonDecode( $dbFilter['Query'] );
$_REQUEST['sort_field'] = isset($_REQUEST['filter']['sort_field'])?$_REQUEST['filter']['sort_field']:"DateTime";
$_REQUEST['sort_asc'] = isset($_REQUEST['filter']['sort_asc'])?$_REQUEST['filter']['sort_asc']:"1";
$_REQUEST['limit'] = isset($_REQUEST['filter']['limit'])?$_REQUEST['filter']['limit']:"";
unset( $_REQUEST['filter']['sort_field'] );
unset( $_REQUEST['filter']['sort_asc'] );
unset( $_REQUEST['filter']['limit'] );
}
if ( empty($_REQUEST['sort_field']) )
$_REQUEST['sort_field'] = "DateTime";
if ( empty($_REQUEST['sort_asc']) )
$_REQUEST['sort_asc'] = "1";
$countSql = "select count(E.Id) as EventCount from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
$eventsSql = "select E.Id,E.MonitorId,M.Name As MonitorName,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
if ( $user['MonitorIds'] )
{
$countSql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
$eventsSql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
}
else
{
$countSql .= " 1";
$eventsSql .= " 1";
}
parseSort( true, '&amp;' );
parseFilter( $_REQUEST['filter'], true, '&amp;' );
$filterQuery = $_REQUEST['filter']['query'];
if ( $_REQUEST['filter']['sql'] )
{
$countSql .= $_REQUEST['filter']['sql'];
$eventsSql .= $_REQUEST['filter']['sql'];
}
$eventsSql .= " order by $sortColumn $sortOrder";
$deviceLines = (isset($device)&&!empty($device['lines']))?$device['lines']:DEVICE_LINES;
// Allow for headers etc
$deviceLines -= 2;
if ( !empty($_REQUEST['page']) )
{
$limitStart = (($_REQUEST['page']-1)*$deviceLines);
if ( empty($_REQUEST['limit']) )
{
$limitAmount = $deviceLines;
}
else
{
$limitLeft = $_REQUEST['limit'] - $limitStart;
$limitAmount = ($limitLeft>$deviceLines)?$deviceLines:$limitLeft;
}
$eventsSql .= " limit $limitStart, $limitAmount";
}
elseif ( !empty( $_REQUEST['limit'] ) )
{
$eventsSql .= " limit 0, ".$_REQUEST['limit'];
}
$nEvents = dbFetchOne( $countSql, 'EventCount' );
if ( !empty($limit) && $nEvents > $_REQUEST['limit'] )
{
$nEvents = $_REQUEST['limit'];
}
$pages = (int)ceil($nEvents/$deviceLines);
$maxShortcuts = 3;
$pagination = getPagination( $pages, $_REQUEST['page'], $maxShortcuts, $filterQuery.$sortQuery.'&amp;limit='.$_REQUEST['limit'], '&amp;' );
xhtmlHeaders( __FILE__, translate('Events') );
?>
<body>
<div id="page">
<div id="header">
<div id="headerButtons"><?php echo makeLink( "?view=filter", empty($_REQUEST['filterName'])?translate('ChooseFilter'):$_REQUEST['filterName'], canView( 'Events' ) ) ?></div>
<h2><?php echo sprintf( $CLANG['EventCount'], $nEvents, zmVlang( $VLANG['Event'], $nEvents ) ) ?></h2>
</div>
<div id="content">
<?php
if ( $pagination )
{
?>
<h3 class="pagination"><?php echo $pagination ?></h3>
<?php
}
?>
<table id="contentTable" class="major">
<?php
$count = 0;
foreach ( dbFetchAll( $eventsSql ) as $event )
{
if ( ($count++%$deviceLines) == 0 )
{
?>
<tr>
<th class="colId"><a href="<?php echo sortHeader( 'Id', '&amp;' ) ?>"><?php echo substr( translate('Id'), 0, 3 ) ?><?php echo sortTag( 'Id' ) ?></a></th>
<th class="colTime"><a href="<?php echo sortHeader( 'StartTime', '&amp;' ) ?>"><?php echo substr( translate('Time'), 0, 3 ) ?><?php echo sortTag( 'StartTime' ) ?></a></th>
<th class="colDuration"><a href="<?php echo sortHeader( 'Length', '&amp;' ) ?>"><?php echo substr( translate('Duration'), 0, 3 ) ?><?php echo sortTag( 'Length' ) ?></a></th>
<th class="colFrames"><a href="<?php echo sortHeader( 'Frames', '&amp;' ) ?>"><?php echo substr( translate('Frames'), 0, 3 ) ?><?php echo sortTag( 'Frames' ) ?></a></th>
<th class="colScore"><a href="<?php echo sortHeader( 'TotScore', '&amp;' ) ?>"><?php echo substr( translate('Score'), 0, 3 ) ?><?php echo sortTag( 'TotScore' ) ?></a></th>
</tr>
<?php
}
?>
<tr>
<td class="colId"><a href="?view=eventdetails&amp;eid=<?php echo $event['Id'] ?>&amp;page=1"><?php echo $event['Id'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
<td class="colTime"><?php echo strftime( "%d/%H:%M", strtotime($event['StartTime']) ) ?></td>
<td class="colDuration"><?php echo sprintf( "%d", $event['Length'] ) ?></td>
<td class="colFrames"><a href="?view=event&amp;eid=<?php echo $event['Id'] ?>&amp;page=1"><?php echo $event['AlarmFrames'] ?></a></td>
<td class="colScore"><a href="?view=frame&amp;eid=<?php echo $event['Id'] ?>&amp;fid=0"><?php echo $event['MaxScore'] ?></a></td>
</tr>
<?php
}
?>
</table>
<p><a href="?view=console"><?php echo translate('Console') ?></a></p>
</div>
</div>
</body>
</html>

View File

@ -1,71 +0,0 @@
<?php
//
// ZoneMinder web filter view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$filterNames = array();
$sql = "select * from Filters order by Name";
foreach( dbFetchAll( $sql ) as $row )
{
$filterNames[$row['Name']] = $row['Name'];
}
xhtmlHeaders( __FILE__, translate('EventFilter') );
?>
<body>
<div id="page">
<div id="header">
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="events"/>
<input type="hidden" name="page" value="1"/>
</fieldset>
</div>
<?php
if ( count($filterNames) > 0 )
{
?>
<div>
<label for="filterName"><?php echo translate('UseFilter') ?></label><?php echo buildSelect( "filterName", $filterNames ); ?>
</div>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Submit') ?>"/>
</div>
<?php
}
else
{
?>
<p><?php echo translate('NoSavedFilters') ?></p>
<?php
}
?>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,73 +0,0 @@
<?php
//
// ZoneMinder web frame view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultScale FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?';
$event = dbFetchOne( $sql, NULL, array( $_REQUEST['eid'] ) );
if ( !empty($_REQUEST['fid']) )
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND FrameId = ?', NULL, array( $_REQUEST['eid'], $_REQUEST['fid'] ) );
}
else
{
$frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventID = ? AND Score = ?', NULL, array( $_REQUEST['eid'], $event['MaxScore'] ) );
}
$maxFid = $event['Frames'];
$firstFid = 1;
$prevFid = $frame['FrameId']-1;
$nextFid = $frame['FrameId']+1;
$lastFid = $maxFid;
$scale = getDeviceScale( $event['Width'], $event['Height'], 1.1 );
$imageData = getImageSrc( $event, $frame, $scale, (isset($_REQUEST['show'])&&$_REQUEST['show']=="capt") );
xhtmlHeaders( __FILE__, translate('Frame').' - '.$_REQUEST['eid'].'-'.$frame['FrameId'] );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('Frame') ?> <?php echo $_REQUEST['eid']."-".$frame['FrameId']." (".$frame['Score'].")" ?></h2>
</div>
<div id="content">
<?php if ( $imageData['hasAnalImage'] ) { ?><a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $frame['FrameId'] ?>&amp;show=<?php echo $imageData['isAnalImage']?"capt":"anal" ?>"><?php } ?><img src="<?php echo viewImagePath( $imageData['thumbPath'] ) ?>" class="<?php echo $imageData['imageClass'] ?>"/><?php if ( $imageData['hasAnalImage'] ) { ?></a><?php } ?>
<div id="contentButtons">
<?php if ( $frame['FrameId'] > 1 ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $firstFid ?>">&lt;&lt;</a>
<?php } if ( $frame['FrameId'] > 1 ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $prevFid ?>">&lt;</a>
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $nextFid ?>">&gt;</a>
<?php } if ( $frame['FrameId'] < $maxFid ) { ?>
<a href="?view=frame&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;fid=<?php echo $lastFid ?>">&gt;&gt;</a>
<?php } ?>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,66 +0,0 @@
<?php
//
// ZoneMinder web function view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canEdit( 'Monitors' ) )
{
$_REQUEST['view'] = "error";
return;
}
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
xhtmlHeaders( __FILE__, translate('Function').' - '.$monitor['Name'] );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo sprintf( $CLANG['MonitorFunction'], $monitor['Name'] ) ?></h2>
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="console"/>
<input type="hidden" name="action" value="function"/>
<input type="hidden" name="mid" value="<?php echo $_REQUEST['mid'] ?>"/>
</fieldset>
</div>
<div>
<select name="newFunction">
<?php
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction )
{
?>
<option value="<?php echo $optFunction ?>"<?php if ( $optFunction == $monitor['Function'] ) { ?> selected="selected"<?php } ?>><?php echo $optFunction ?></option>
<?php
}
?>
</select>
</div>
<div>
<label for="newEnabled"><?php echo translate('Enabled') ?></label><input type="checkbox" name="newEnabled" id="newEnabled" value="1"<?php if ( !empty($monitor['Enabled']) ) { ?> checked="checked"<?php } ?>/>
</div>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Save') ?>"/>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,54 +0,0 @@
<?php
//
// ZoneMinder web login view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
xhtmlHeaders( __FILE__, translate('Login') );
?>
<body>
<div id="page">
<div id="header">
<h1>ZoneMinder <?php echo translate('Login') ?></h1>
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="action" value="login"/>
<input type="hidden" name="view" value="console"/>
</fieldset>
</div>
<table id="contentTable" class="minor">
<tr>
<th scope="row" class="colLeft"><?php echo translate('Username') ?></th>
<td class="colRight"><input type="text" name="username" value="<?php echo isset($username)?$username:"" ?>" size="12"/></td>
</tr>
<tr>
<th scope="row" class="colLeft"><?php echo translate('Password') ?></th>
<td class="colRight"><input type="password" name="password" value="" size="12"/></td>
</tr>
</table>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Login') ?>"/>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,75 +0,0 @@
<?php
//
// ZoneMinder web montage view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Stream' ) )
{
$_REQUEST['view'] = "error";
return;
}
$imagesPerLine = 2;
$sql = "select * from Groups where Name = 'Mobile'";
$group = dbFetchOne( $sql );
$sql = "select * from Monitors where Function != 'None' order by Sequence";
$monitors = array();
$maxWidth = 0;
$maxHeight = 0;
foreach( dbFetchAll( $sql ) as $row )
{
if ( !visibleMonitor( $row['Id'] ) )
continue;
if ( $group && $group['MonitorIds'] && !in_array( $row['Id'], explode( ',', $group['MonitorIds'] ) ) )
continue;
if ( $maxWidth < $row['Width'] ) $maxWidth = $row['Width'];
if ( $maxHeight < $row['Height'] ) $maxHeight = $row['Height'];
$monitors[] = $row;
}
xhtmlHeaders( __FILE__, translate('Montage') );
?>
<body>
<div id="page">
<div id="header">
<div id="headerButtons">
<a href="?view=<?php echo $_REQUEST['view'] ?>"><?php echo translate('Refresh') ?></a>
</div>
</div>
<div id="content">
<div id="monitorImages">
<?php
foreach( $monitors as $monitor )
{
$scale = getDeviceScale( $monitor['Width'], $monitor['Height'], $imagesPerLine*1.1 );
$imagePath = getStreamSrc( array( "mode=single", "monitor=".$monitor['Id'], "scale=".$scale ), '&amp;' );
?>
<a href="?view=watch&amp;mid=<?php echo $monitor['Id'] ?>"><img src="<?php echo $imagePath ?>" alt="<?php echo $monitor['Name'] ?>"/></a>
<?php
}
?>
</div>
<div id="contentButtons"><a href="?view=console"><?php echo translate('Console') ?></a></div>
</div>
</div>
</body>
</html>

View File

@ -1,77 +0,0 @@
<?php
//
// ZoneMinder web run state view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canEdit( 'System' ) )
{
$view = "error";
return;
}
$running = daemonCheck();
$states = dbFetchAll( "select * from States" );
xhtmlHeaders( __FILE__, translate('State') );
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('RunState') ?></h2>
</div>
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="console"/>
<input type="hidden" name="action" value="state"/>
</fieldset>
</div>
<select name="runState">
<?php
if ( $running )
{
?>
<option value="stop" selected="selected"><?php echo translate('Stop') ?></option>
<option value="restart"><?php echo translate('Restart') ?></option>
<?php
}
else
{
?>
<option value="start" selected="selected"><?php echo translate('Start') ?></option>
<?php
}
?>
<?php
foreach ( $states as $state )
{
?>
<option value="<?php echo $state['Name'] ?>"><?php echo $state['Name'] ?></option>
<?php
}
?>
</select>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Apply') ?>"/>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@ -1,226 +0,0 @@
<?php
//
// ZoneMinder web video view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Events' ) )
{
$_REQUEST['view'] = "error";
return;
}
if ( $user['MonitorIds'] )
$midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
else
$midSql = '';
$sql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultRate FROM Events AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE E.Id = ?'.$midSql;
$event = dbFetchOne( $sql, NULL, array($_REQUEST['eid']) );
$deviceWidth = (isset($device)&&!empty($device['width']))?$device['width']:DEVICE_WIDTH;
$deviceHeight = (isset($device)&&!empty($device['height']))?$device['height']:DEVICE_HEIGHT;
if ( $deviceWidth >= 352 && $deviceHeight >= 288 )
$videoSize = "352x288";
elseif ( $deviceWidth >= 176 && $deviceHeight >= 144 )
$videoSize = "176x144";
else
$videoSize = "128x96";
$eventWidth = $event['Width'];
$eventHeight = $event['Height'];
if ( !isset( $rate ) )
$_REQUEST['rate'] = reScale( RATE_BASE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE );
$eventPath = ZM_DIR_EVENTS.'/'.getEventPath( $event );
$videoFormats = array();
$ffmpegFormats = preg_split( '/\s+/', ZM_FFMPEG_FORMATS );
foreach ( $ffmpegFormats as $ffmpegFormat )
{
preg_match( '/^([^*]+)(\**)$/', $ffmpegFormat, $matches );
$videoFormats[$matches[1]] = $matches[1];
if ( $matches[2] == '*' )
$defaultVideoFormat = $matches[1];
elseif ( $matches[2] == '**' )
$defaultPhoneFormat = $matches[1];
}
if ( !isset($_REQUEST['videoFormat']) )
{
if ( isset($defaultPhoneFormat) )
$_REQUEST['videoFormat'] = $defaultPhoneFormat;
elseif ( isset($defaultVideoFormat) )
$_REQUEST['videoFormat'] = $defaultVideoFormat;
else
$videoFormat = $ffmpegFormats[0];
}
if ( !empty($_REQUEST['generate']) )
{
$videoFile = createVideo( $event, $_REQUEST['videoFormat'], $_REQUEST['rate'], $videoSize, !empty($_REQUEST['overwrite']) );
}
$videoFiles = array();
if ( $dir = opendir( $eventPath ) )
{
while ( ($file = readdir( $dir )) !== false )
{
$file = $eventPath.'/'.$file;
if ( is_file( $file ) )
{
if ( preg_match( '/-S([\da-z]+)\.(?:'.join( '|', $videoFormats ).')$/', $file, $matches ) )
{
if ( $matches[1] == $videoSize )
{
$videoFiles[] = $file;
}
}
}
}
closedir( $dir );
}
if ( isset($_REQUEST['download']) )
{
header( "Content-type: ".getMimeType($videoFiles[$_REQUEST['download']]));
header( "Content-length: ".filesize($videoFiles[$_REQUEST['download']]));
header( "Content-disposition: attachment; filename=".preg_replace( "/^.*\//", "", $videoFiles[$_REQUEST['download']] )."; size=".filesize($videoFiles[$_REQUEST['download']]) );
readfile( $videoFiles[$_REQUEST['download']] );
exit;
}
xhtmlHeaders( __FILE__, translate('Video').' - '.$event['Name'] );
?>
<body>
<div id="page">
<div id="content">
<form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<div class="hidden">
<fieldset>
<input type="hidden" name="view" value="<?php echo $_REQUEST['view'] ?>"/>
<input type="hidden" name="eid" value="<?php echo $_REQUEST['eid'] ?>"/>
<input type="hidden" name="generate" value="1"/>
</fieldset>
</div>
<table id="contentTable" class="minor">
<tr>
<th scope="row"><?php echo translate('VideoFormat') ?></th>
<td><?php echo buildSelect( "videoFormat", $videoFormats ) ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('FrameRate') ?></th>
<td><?php echo buildSelect( "rate", $rates ) ?></td>
</tr>
<tr>
<th scope="row"><?php echo translate('OverwriteExisting') ?></th>
<td><input type="checkbox" name="overwrite" value="1"<?php if ( isset($overwrite) ) { ?> checked="checked"<?php } ?>/></td>
</tr>
</table>
<div id="contentButtons"><input type="submit" value="<?php echo translate('GenerateVideo') ?>"/></div>
</form>
<?php
if ( isset($videoFile) )
{
if ( $videoFile )
{
?>
<p class="infoText"><?php echo translate('VideoGenSucceeded') ?></p>
<?php
}
else
{
?>
<p class="errorText"><?php echo translate('VideoGenFailed') ?></p>
<?php
}
}
?>
<?php
if ( count($videoFiles) )
{
if ( isset($_REQUEST['delete']) )
{
unlink( $videoFiles[$_REQUEST['delete']] );
unset( $videoFiles[$_REQUEST['delete']] );
}
}
if ( count($videoFiles) )
{
?>
<h3><?php echo translate('VideoGenFiles') ?></h3>
<table class="major">
<tr>
<th><?php echo translate('Format') ?></th>
<th><?php echo translate('Size') ?></th>
<th><?php echo translate('Rate') ?></th>
<th><?php echo translate('Scale') ?></th>
<th><?php echo translate('Action') ?></th>
</tr>
<?php
if ( count($videoFiles) > 0 )
{
$index = 0;
foreach ( $videoFiles as $file )
{
preg_match( '/^(.+)-((?:r[_\d]+)|(?:F[_\d]+))-((?:s[_\d]+)|(?:S[0-9a-z]+))\.([^.]+)$/', $file, $matches );
if ( preg_match( '/^r(.+)$/', $matches[2], $temp_matches ) )
{
$rate = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) );
$rateText = isset($rates[$rate])?$rates[$rate]:($rate."x");
}
elseif ( preg_match( '/^F(.+)$/', $matches[2], $temp_matches ) )
{
$rateText = $temp_matches[1]."fps";
}
if ( preg_match( '/^s(.+)$/', $matches[3], $temp_matches ) )
{
$scale = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) );
$scaleText = isset($scales[$scale])?$scales[$scale]:($scale."x");
}
elseif ( preg_match( '/^S(.+)$/', $matches[3], $temp_matches ) )
{
$scaleText = $temp_matches[1];
}
?>
<tr>
<td><?php echo $matches[4] ?></td>
<td><?php echo filesize( $file ) ?></td>
<td><?php echo $rateText ?></td>
<td><?php echo $scaleText ?></td>
<td><a href="?view=<?php echo $_REQUEST['view'] ?>&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;download=<?php echo $index ?>"><?php echo translate('View') ?></a>&nbsp;/&nbsp;<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;eid=<?php echo $_REQUEST['eid'] ?>&amp;delete=<?php echo $index ?>"><?php echo translate('Delete') ?></a></td>
</tr>
<?php
$index++;
}
}
?>
</table>
<?php
}
else
{
?>
<p class="warnText"><?php echo translate('VideoGenNoFiles') ?></p>
<?php
}
?>
</div>
</div>
</body>
</html>

View File

@ -1,154 +0,0 @@
<?php
//
// ZoneMinder web watch view file, $Date$, $Revision$
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( !canView( 'Stream' ) )
{
$_REQUEST['view'] = "error";
return;
}
$sql = 'select C.*, M.* from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id = ?';
$monitor = dbFetchOne( $sql, NULL, array($_REQUEST['mid']) );
$showPtzControls = ( ZM_OPT_CONTROL && $monitor['Controllable'] && canView( 'Control' ) );
$zmuCommand = getZmuCommand( " -m ".$_REQUEST['mid']." -s -f" );
$zmuOutput = exec( escapeshellcmd( $zmuCommand ) );
list( $status, $fps ) = explode( ' ', $zmuOutput );
$statusString = translate('Unknown');
$fpsString = "--.--";
$class = "infoText";
if ( $status <= STATE_PREALARM )
{
$statusString = translate('Idle');
}
elseif ( $status == STATE_ALARM )
{
$statusString = translate('Alarm');
$class = "errorText";
}
elseif ( $status == STATE_ALERT )
{
$statusString = translate('Alert');
$class = "warnText";
}
elseif ( $status == STATE_TAPE )
{
$statusString = translate('Record');
}
$fpsString = sprintf( "%.2f", $fps );
$sql = "select * from Monitors where Function != 'None' order by Sequence";
$monitors = array();
$monIdx = 0;
$maxWidth = 0;
$maxHeight = 0;
foreach( dbFetchAll( $sql ) as $row )
{
if ( !visibleMonitor( $row['Id'] ) )
{
continue;
}
if ( isset($monitor['Id']) && $row['Id'] == $monitor['Id'] )
$monIdx = count($monitors);
if ( $maxWidth < $row['Width'] ) $maxWidth = $row['Width'];
if ( $maxHeight < $row['Height'] ) $maxHeight = $row['Height'];
$monitors[] = $row;
}
//$monitor = $monitors[$monIdx];
$nextMid = $monIdx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$monIdx+1]['Id'];
$prevMid = $monIdx==0?$monitors[(count($monitors)-1)]['Id']:$monitors[$monIdx-1]['Id'];
if ( isset( $_REQUEST['scale'] ) )
$scale = validInt($_REQUEST['scale']);
else
$scale = getDeviceScale( $monitor['Width'], $monitor['Height'] );
$imageSrc = getStreamSrc( array( "mode=single", "monitor=".$monitor['Id'], "scale=".$scale ), '&amp;' );
if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
{
$streamMode = "mpeg";
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale, "bitrate=".ZM_WEB_VIDEO_BITRATE, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "format=".ZM_MPEG_LIVE_FORMAT ) );
}
elseif ( canStream() )
{
$streamMode = "jpeg";
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS ) );
}
else
{
$streamMode = "single";
$streamSrc = getStreamSrc( array( "mode=".$streamMode, "monitor=".$monitor['Id'], "scale=".$scale ) );
}
xhtmlHeaders( __FILE__, $monitor['Name'].' - '.translate('Watch') );
?>
<body>
<div id="page">
<div id="content">
<p class="<?php echo $class ?>"><?php echo makeLink( "?view=events&amp;page=1&amp;view=events&amp;page=1&amp;filter%5Bterms%5D%5B0%5D%5Battr%5D%3DMonitorId&amp;filter%5Bterms%5D%5B0%5D%5Bop%5D%3D%3D&amp;filter%5Bterms%5D%5B0%5D%5Bval%5D%3D".$monitor['Id']."&amp;sort_field=Id&amp;sort_desc=1", $monitor['Name'], canView( 'Events' ) ) ?>:&nbsp;<?php echo $statusString ?>&nbsp;-&nbsp;<?php echo $fpsString ?>&nbsp;fps</p>
<p>
<?php
if ( $streamMode == "mpeg" )
{
outputVideoStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), ZM_MPEG_LIVE_FORMAT, $monitor['Name'] );
}
elseif ( $streamMode == "jpeg" )
{
if ( canStreamNative() )
outputImageStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] );
elseif ( canStreamApplet() )
outputHelperStream( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] );
}
else
{
?>
<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;mid=<?php echo $monitor['Id'] ?>"><?php echo outputImageStill( "liveStream", $streamSrc, reScale( $monitor['Width'], $scale ), reScale( $monitor['Height'], $scale ), $monitor['Name'] ); ?></a>
<?php
}
?>
</p>
<?php
if ( $showPtzControls )
{
foreach ( getSkinIncludes( 'includes/control_functions.php' ) as $includeFile )
require_once $includeFile;
?>
<div id="ptzControls">
<?php echo ptzControls( $monitor ) ?>
</div>
<?php
}
if ( $nextMid != $monitor['Id'] || $prevMid != $monitor['Id'] )
{
?>
<div id="contentButtons">
<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;mid=<?php echo $prevMid ?>"><?php echo translate('Prev') ?></a>
<a href="?view=console"><?php echo translate('Console') ?></a>
<a href="?view=<?php echo $_REQUEST['view'] ?>&amp;mid=<?php echo $nextMid ?>"><?php echo translate('Next') ?></a>
</div>
<?php
}
?>
</div>
</div>
</body>
</html>

View File

@ -1,155 +0,0 @@
<?php
/*
* config.php is created by Jai Dhar, FPS-Tech, for use with eyeZm
* iPhone application. This is not intended for use with any other applications,
* although source-code is provided under GPL.
*
* For questions, please email jdhar@eyezm.com (http://www.eyezm.com)
*
*/
/* Static defines, these shouldn't change */
define ( "ZM_EYEZM_PROTOCOL_VERSION", "2");
define ( "ZM_EYEZM_FEATURE_SET", "3");
/* Dynamic defines, check if they are already defined.
* To change a particular parameter default value, without using the
* Options Console, change the 2nd parameter of the define() block. */
/* Parm: ZM_EYEZM_EVENT_FPS: Sets the default FPS of the output videos for events */
if (!defined("ZM_EYEZM_EVENT_FPS")) define ( "ZM_EYEZM_EVENT_FPS", "10");
/* Parm: ZM_EYEZM_EVENT_VCODEC: Default video codec for generating event video. Can be mpeg4 or h264 */
if (!defined("ZM_EYEZM_EVENT_VCODEC")) define ( "ZM_EYEZM_EVENT_VCODEC", "mpeg4");
/* Parm: ZM_EYEZM_FEED_VCODEC: Default video codec of live feeds. Can be mjpeg or h264 */
if (!defined("ZM_EYEZM_FEED_VCODEC")) define ( "ZM_EYEZM_FEED_VCODEC", "mjpeg");
/* Parm: ZM_EYEZM_SEG_DURATION: H264 Live-streaming segment duration in seconds.
* Increase to improve feed smooth-ness, but will increase feed latency */
if (!defined("ZM_EYEZM_SEG_DURATION")) define ( "ZM_EYEZM_SEG_DURATION", "3");
/* Parm: ZM_EYEZM_DEBUG: Set to 1 to enable XML Debugging */
if (!defined("ZM_EYEZM_DEBUG")) define ( "ZM_EYEZM_DEBUG", "0" );
/* Parm: ZM_EYEZM_H264_MAX_DURATION: Maximum duration in seconds allowed for viewing H264 Streams.
* This is useful for systems that crash or stall when viewing H264 streams. After the timeout
* expires, the H264 stream will be killed if it has not by the user already */
if (!defined("ZM_EYEZM_H264_MAX_DURATION")) define ( "ZM_EYEZM_H264_MAX_DURATION", "120" );
/* Parm: ZM_EYEZM_DEFAULT_BR: Default bitrate of H264 live-feed (when selected).
* This parameter can be changed to anything FFMPEG supports. 64k is a good lower bound, and 392k
* a good upper */
if (!defined("ZM_EYEZM_H264_DEFAULT_BR")) define ( "ZM_EYEZM_H264_DEFAULT_BR", "96k" );
/* Parm: ZM_EYEZM_H264_TIMEOUT: How long to wait for H264 stream to be created. Increase
* this value for streams that take a while to create, or for slow systems that time-out frequently */
if (!defined("ZM_EYEZM_H264_TIMEOUT")) define ( "ZM_EYEZM_H264_TIMEOUT", "20" );
/* Parm: ZM_EYEZM_H264_DEFAULT_EVBR: Default bit-rate when creasing H264 Event videos */
if (!defined("ZM_EYEZM_H264_DEFAULT_EVBR")) define ( "ZM_EYEZM_H264_DEFAULT_EVBR", "128k" );
/* Logging defines */
/* Parm: ZM_EYEZM_LOG_TO_FILE: Set to 1 to log XML Debug output to a separate file, when
* ZM_EYEZM_DEBUG is set to 1. If set to 0, XML Logging will be directed to Apache error log */
if (!defined("ZM_EYEZM_LOG_TO_FILE")) define ( "ZM_EYEZM_LOG_TO_FILE", "1" );
/* Parm: ZM_EYEZM_LOG_FILE: Path to filename when LOG_TO_FILE is enabled */
if (!defined("ZM_EYEZM_LOG_FILE")) define ( "ZM_EYEZM_LOG_FILE", "/tmp/zm_xml.log" );
/* Parm: How many lines to display when viewing log from eyeZm */
if (!defined("ZM_EYEZM_LOG_LINES")) define ( "ZM_EYEZM_LOG_LINES", "50" );
$rates = array(
"10000" => "100x",
"5000" => "50x",
"2500" => "25x",
"1000" => "10x",
"400" => "4x",
"200" => "2x",
"100" => translate('Real'),
"50" => "1/2x",
"25" => "1/4x",
);
$scales = array(
"400" => "4x",
"300" => "3x",
"200" => "2x",
"150" => "1.5x",
"100" => translate('Actual'),
"75" => "3/4x",
"50" => "1/2x",
"33" => "1/3x",
"25" => "1/4x",
);
$bwArray = array(
"high" => translate('High'),
"medium" => translate('Medium'),
"low" => translate('Low')
);
/* Check if ZM_WEB_L_CAN_STREAM and ZM_WEB_L_STREAM_METHOD are defined */
if (!defined("ZM_WEB_L_CAN_STREAM")) {
define ("ZM_WEB_L_CAN_STREAM", 1);
define ("ZM_WEB_M_CAN_STREAM", 1);
define ("ZM_WEB_H_CAN_STREAM", 1);
}
if (!defined("ZM_WEB_L_STREAM_METHOD")) {
define ("ZM_WEB_L_STREAM_METHOD", "jpeg");
define ("ZM_WEB_M_STREAM_METHOD", "jpeg");
define ("ZM_WEB_H_STREAM_METHOD", "jpeg");
}
switch ( $_COOKIE['zmBandwidth'] )
{
case "high" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_H_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_CAN_STREAM", ZM_WEB_H_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_H_STREAM_METHOD ); // Which method should be used to send video streams to your browser
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_H_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_H_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_H_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_H_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_H_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_H_EVENTS_VIEW ); // What the default view of multiple events should be.
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_H_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_H_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
case "medium" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_M_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_CAN_STREAM", ZM_WEB_M_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_M_STREAM_METHOD ); // Which method should be used to send video streams to your browser
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_M_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_M_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_M_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_M_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_M_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_M_EVENTS_VIEW ); // What the default view of multiple events should be.
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_M_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_M_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
case "low" :
{
define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_L_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "ZM_WEB_CAN_STREAM", ZM_WEB_L_CAN_STREAM ); // Override the automatic detection of browser streaming capability
define( "ZM_WEB_STREAM_METHOD", ZM_WEB_L_STREAM_METHOD ); // Which method should be used to send video streams to your browser
define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_L_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%)
define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_L_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%)
define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_L_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_L_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "ZM_WEB_SCALE_THUMBS", ZM_WEB_L_SCALE_THUMBS ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
define( "ZM_WEB_EVENTS_VIEW", ZM_WEB_L_EVENTS_VIEW ); // What the default view of multiple events should be.
define( "ZM_WEB_SHOW_PROGRESS", ZM_WEB_L_SHOW_PROGRESS ); // Whether to show the progress of replay in event view.
define( "ZM_WEB_AJAX_TIMEOUT", ZM_WEB_L_AJAX_TIMEOUT ); // Timeout to use for Ajax requests, no timeout used if unset
break;
}
}
?>

View File

@ -1,447 +0,0 @@
<?php
/*
* functions.php is created by Jai Dhar, FPS-Tech, for use with eyeZm
* iPhone application. This is not intended for use with any other applications,
* although source-code is provided under GPL.
*
* For questions, please email support@eyezm.com (http://www.eyezm.com)
*
*/
/* These functions are taken from functions.php */
function validInteger( $input )
{
return( preg_replace( '/\D/', '', $input ) );
}
function validString( $input )
{
return( strip_tags( $input ) );
}
/* There appears to be some discrepancy btw. 1.24.1/2 and .3 for EventPaths, to escape them here */
function getEventPathSafe($event)
{
if (ZM_USE_DEEP_STORAGE) {
$ret = ZM_DIR_EVENTS."/".$event['MonitorId'].'/'.strftime( "%y/%m/%d/%H/%M/%S", strtotime($event['StartTime']) );
} else {
$ret = ZM_DIR_EVENTS."/".$event['MonitorId']."/".$event['Id'];
}
return $ret;
}
function updateClientVer()
{
$str = $_SERVER['HTTP_USER_AGENT'];
/* Check if it starts with eyeZm */
if (!strcmp(substr($str, 0, 5),"eyeZm")) {
/* Found eyeZm */
$ver = substr($str, 6);
$verarray = explode(".", $ver);
$_SESSION['vermaj']=$verarray[0];
$_SESSION['vermin']=$verarray[1];
$_SESSION['verbuild']=$verarray[2];
}
logXml("(".$_SERVER['REMOTE_ADDR'].") GET: ".$_SERVER['REQUEST_URI']." - eyeZm ".getClientVerMaj().".".getClientVerMin());
}
function getClientVerMaj()
{
if (isset($_SESSION['vermaj'])) return $_SESSION['vermaj'];
return "0";
}
function getClientVerMin()
{
if (isset($_SESSION['vermin'])) return $_SESSION['vermin'];
return "0";
}
function requireVer($maj, $min)
{
if (getClientVerMaj() > $maj) return 1;
if ((getClientVerMaj() == $maj) && (getClientVerMin() >= $min)) return 1;
return 0;
}
function logXmlErr($str)
{
logXml($str, 1);
}
function logXml($str, $err = 0)
{
if (!defined("ZM_EYEZM_DEBUG")) {
/* Check session variable */
if (isset($_SESSION['xml_debug'])) define("ZM_EYEZM_DEBUG", $_SESSION['xml_debug']);
else define ("ZM_EYEZM_DEBUG", "0");
}
if (!defined("ZM_EYEZM_LOG_TO_FILE")) {
/* Check session variable */
if (isset($_SESSION['xml_log_to_file'])) define("ZM_EYEZM_LOG_TO_FILE", $_SESSION['xml_log_to_file']);
else define ("ZM_EYEZM_LOG_TO_FILE", "1");
}
if (!defined("ZM_EYEZM_LOG_FILE")) {
/* Check session variable */
if (isset($_SESSION['xml_log_file'])) define("ZM_EYEZM_LOG_FILE", $_SESSION['xml_log_file']);
else define ("ZM_EYEZM_LOG_FILE", "/tmp/zm_xml.log");
}
/* Only log if debug is enabled */
if (ZM_EYEZM_DEBUG == 0) return;
/* Logging is enabled, set log string */
$logstr = "XML_LOG (".($err?"ERROR":"NOTICE")."): ".$str.(ZM_EYEZM_LOG_TO_FILE?"\n":"");
if (ZM_EYEZM_LOG_TO_FILE) {
error_log("[".date("r")."] ".$logstr, 3, ZM_EYEZM_LOG_FILE);
} else {
error_log($logstr);
}
}
/* Returns defval if varname is not set, otherwise return varname */
function getset($varname, $defval)
{
if (isset($_GET[$varname])) return $_GET[$varname];
return $defval;
}
function xml_header()
{
header ("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
}
function xml_tag_val($tag, $val)
{
echo "<".$tag.">".$val."</".$tag.">";
}
function xml_tag_sec($tag, $open)
{
if ($open) $tok = "<";
else $tok = "</";
echo $tok.$tag.">";
}
function xhtmlHeaders( $file, $title )
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
body {
border: 0px solid;
margin: 0px;
padding: 0px;
}
</style>
<script type="text/javascript">
</script>
</head>
<?php
}
/** Returns whether necessary components for H264 streaming
* are present */
function canStream264($sup = 0) {
if (!ffmpegSupportsCodec("libx264")) {
if (!$sup) logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support libx264");
return FALSE;
}
/* Make sure segmenter exists */
if (!exeExists(shell_exec("which segmenter"))) {
if (!$sup) logXmlErr("HTTP segmenter not installed or not accessible in path");
return FALSE;
}
/* Check for zmstreamer */
if (!exeExists(shell_exec("which zmstreamer"))) {
if (!$sup) logXmlErr("ZMSTREAMER not installed or not accessible in path");
return FALSE;
}
return TRUE;
}
/* Returns the path of ffmpeg by using define */
function getFfmpegPath()
{
if (defined("ZM_PATH_FFMPEG")) {
return ZM_PATH_FFMPEG;
} else {
/* Not defined, get it from using 'which' */
return shell_exec("which ffmpeg");
}
}
/* Returns whether ffmpeg supports a given codec. Takes into account
* whether FFMPEG exists or not */
function ffmpegSupportsCodec($codec)
{
if (!ffmpegExists()) return FALSE;
/* FFMPEG exists */
if (preg_match("/\b".$codec."\b/", shell_exec(getFfmpegPath()." -codecs 2> /dev/null")) > 0) {
/* More than one match */
return TRUE;
} else {
/* Check -formats tag also if we fail -codecs */
if (preg_match("/\b".$codec."\b/", shell_exec(getFfmpegPath()." -formats 2> /dev/null")) > 0) return TRUE;
return FALSE;
}
}
function exeExists($exepath)
{
$path = trim($exepath);
return (file_exists($path) && is_readable($path) && ($path != ""));
}
/* Returns whether ffmpeg exists or not */
function ffmpegExists()
{
return exeExists(getFfmpegPath());
}
/* Returns with PHP-GD exists */
function gdExists()
{
if (extension_loaded('gd') && function_exists('gd_info')) {
return TRUE;
}
return FALSE;
}
function getFfmpeg264FoutParms($br, $fout)
{
$ffparms = "-analyzeduration 0 -acodec copy";
$ffparms .= " -vcodec libx264 -b ".$br;
$ffparms .= " -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8";
$ffparms .= " -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25";
$ffparms .= " -sc_threshold 40 -i_qfactor 0.71 -bt 16k";
$ffparms .= " -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6";
$ffparms .= " -qmin 10 -qmax 51 -qdiff 4 -level 30";
$ffparms .= " -g 30 -analyzeduration 0 -async 2 ".$fout." 2> /dev/null";
return $ffparms;
}
/** Return FFMPEG parameters for H264 streaming */
function getFfmpeg264Str($width, $height, $br, $fin, $fout)
{
$ffparms = getFfmpeg264FoutParms($br, $fout);
$ffstr = getFfmpegPath()." -t ".ZM_EYEZM_H264_MAX_DURATION." -analyzeduration 0 -i ";
$ffstr .= $fin." -f mpegts ".$ffparms;
return $ffstr;
}
/** Returns true when monitor exists */
function isMonitor($monitor)
{
$query = "select Id from Monitors where Id = ?";
$res = dbFetchOne($query, NULL, array($monitor));
if ($res) return TRUE;
logXml("Monitor ID ".$monitor." does not exist");
return FALSE;
}
/** Returns the width and height of a monitor */
function getMonitorDims($monitor)
{
$query = "select Width,Height from Monitors where Id = ?";
$res = dbFetchOne($query, NULL, array( $monitor ) );
return $res;
}
/** Returns the temp directory for H264 encoding */
function getTempDir()
{
/* Assume that the directory structure is <base>/skins/xml/views */
return dirname(__FILE__)."/../../../temp";
}
/** Returns the name of the m3u8 playlist based on monitor */
function m3u8fname($monitor) {
return "stream_".$monitor.".m3u8";
}
/** Erases the M3u8 and TS file names for a given monitor */
function eraseH264Files($monitor) {
/** NOTE: This command executes an 'rm' command, so $monitor parameter
* should be properly validated before executing */
/* Remove wdir/.m3u8 and wdir/sample_<mon>*.ts */
shell_exec("rm -f ".getTempDir()."/".m3u8fname($monitor)." ".getTempDir()."/sample_".$monitor."*.ts");
}
function kill264proc($monitor) {
/** NOTE: This command executes an 'kill' command, so $monitor parameter
* should be properly validated before executing */
$pid = trim(shell_exec("pgrep -f -x \"zmstreamer -m ".$monitor."\""));
if ($pid == "") {
logXml("No PID found for ZMStreamer to kill");
} else {
shell_exec("kill -9 ".$pid);
logXml("Killed process ".$pid." for Monitor ".$monitor);
}
}
/** Return the command-line shell function to setup H264 stream */
function stream264fn ($mid, $width, $height, $br) {
$cdir = "./temp";
$zmstrm = "zmstreamer -m ".$mid." 2> /dev/null";
$ffstr = getFfmpeg264Str($width, $height, $br, "-", "-");
$seg = "segmenter - ".ZM_EYEZM_SEG_DURATION." ".$cdir."/sample_".$mid." ".$cdir."/".m3u8fname($mid)." ../ 2> /dev/null";
$url = $zmstrm . " | ".$ffstr." | " . $seg;
return "nohup ".$url." & echo $!";
}
/** Generate the web-page presented to the viewer when using H264 */
function h264vidHtml($width, $height, $monitor, $br, $thumbsrc) {
function printTermLink() {
$str = "H264 Streaming Launching...<br>Tap to re-load if stream fails";
$str2 = "document.getElementById(\"loaddiv\").innerHTML = \"".$str."\";";
echo $str2;
}
$ajaxUrl = "?view=actions&action=spawn264&&monitor=".$monitor."&br=".$br;
/* Call these two directly to bypass server blocking issues */
$ajax2Url = "./skins/xml/views/actions.php?action=chk264&monitor=".$monitor;
$ajax2Url .= "&timeout=".ZM_EYEZM_H264_TIMEOUT;
$ajax3Url = "./skins/xml/views/actions.php?action=kill264&monitor=".$monitor;
?>
<html>
<head>
<script type="text/javascript">
/* Called when paused or done is pressed */
function vidAbort() {
document.getElementById('viddiv').style.display = 'none';
var pElement = document.getElementsByTagName('video')[0];
var ajaxKill = new AjaxConnection("<?php echo $ajax3Url;?>");
ajaxKill.connect("cbKilled");
pElement.stop();
pElement.src="";
}
function reloadStreamImage() {
var obj = document.getElementById('liveStream');
var src = obj.src;
var date = new Date();
obj.src = src + '&vrand=' + date.getTime();
return false;
}
/* Callback when spawn264 process is ended */
function cbVidLoad()
{
reloadStreamImage();
<?php
printTermLink();
?>
}
function vidLoaded() {
window.setTimeout("startVid()", 500);
}
function bindListeners()
{
var pElement = document.getElementsByTagName('video')[0];
/* Bind abort */
pElement.addEventListener('abort', vidAbort, false);
pElement.addEventListener('done', vidAbort, false);
pElement.addEventListener('ended', vidAbort, false);
pElement.addEventListener('pause', vidAbort, false);
pElement.addEventListener('loadstart', vidLoaded, false);
}
/* Callback when kill264 process is ended */
function cbKilled()
{
<?php printTermLink(); ?>
}
/* Called after an interval from cbFileExists() */
function loadVid()
{
var pElement = document.getElementById("vidcontainer");
<?php
echo "pElement.src=\"./temp/".m3u8fname($monitor)."\"\n";
?>
pElement.load();
}
function startVid()
{
document.getElementById('viddiv').style.display = 'block';
var pElement = document.getElementById("vidcontainer");
pElement.play();
}
/* Callback when stream is active and ready to be played */
function cbFileExists()
{
window.setTimeout("loadVid()", 500);
}
/* On-load triggers two requests immediately: spawn264 and chk264 */
window.onload = function() {
bindListeners();
var ajax1 = new AjaxConnection("<?php echo "$ajaxUrl";?>");
var ajax2 = new AjaxConnection("<?php echo "$ajax2Url";?>");
ajax1.connect("cbVidLoad");
/* Don't initiate file-exists since eyeZm will */
/*ajax2.connect("cbFileExists");*/
}
function AjaxConnection(url) {
this.connect = connect;
this.url = url;
}
function connect(return_func) {
this.x = new XMLHttpRequest();
this.x.open("GET", this.url, true);
var self = this;
this.x.onreadystatechange = function() {
if (self.x.readyState != 4)
return;
eval(return_func + '()');
delete self.x;
}
this.x.send(null);
}
</script>
<style type="text/css">
body {
border: 0px solid;
margin: 0px;
padding: 0px;
background-color: black;
width: <?php echo $width ?>px;
height: <?php echo $height ?>px;
}
.textcl {
text-align: center;
font-family: Arial;
font-size: larger;
width: 100%;
<?php echo "padding-top: ".(($height/2)-100)."px;"; ?>
<?php echo "padding-bottom: ".(($height/2)-100)."px;"; ?>
z-index: 2;
position: absolute;
top: 0px;
left: 0px;
height: 100%;
}
.textcl2 {
width: auto;
height: auto;
background-color: black;
padding: 5px 5px;
margin-left: 10px;
margin-right: 10px;
opacity: 0.7;
}
.textcl3 {
width: auto;
height: auto;
padding: 2px 2px;
margin: auto;
color: white;
}
.imgdiv {
position: absolute;
padding: 0px;
background-color: black;
top: 0px;
left: 0px;
margin: 0px;
width: <?php echo $width ?>px;
height: <?php echo $height ?>px;
z-index: 1;
opacity: 0.7;
}
</style>
</head>
<body>
<div id="viddiv" style="display: none;">
<?php
echo "<video id=\"vidcontainer\" width='".$width."' height='".$height."' />\n";
?>
</div>
<div id="loaddiv2" class="textcl"><div id="loaddiv3" class="textcl2">
<div id="loaddiv" class="textcl3">
Initializing H264 Stream (<?php echo($br); ?>)...<br>
<span style="font-size: small;"><i>This may take a few seconds</i></span>
</div>
</div></div>
<div class="imgdiv" id="imagediv">
<?php outputImageStream("liveStream", $thumbsrc, $width, $height, "stream"); ?>
</div>
</body>
</html>
<?php
}
?>

View File

@ -1,2 +0,0 @@
<?php
?>

View File

@ -1,47 +0,0 @@
<?php
//
// ZoneMinder HTML interface file, $Date: 2008-09-26 02:47:20 -0700 (Fri, 26 Sep 2008) $, $Revision: 2632 $
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
if ( empty($_COOKIE['zmBandwidth']) )
$_COOKIE['zmBandwidth'] = "low";
foreach ( getSkinIncludes( 'includes/config.php' ) as $includeFile )
require_once $includeFile;
foreach ( getSkinIncludes( 'includes/functions.php' ) as $includeFile )
require_once $includeFile;
if ( empty($view) )
$view = 'console';
if ( !isset($user) && ZM_OPT_USE_AUTH && ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER']) )
{
$view = "postlogin";
$action = "login";
$_REQUEST['username'] = $_SERVER['REMOTE_USER'];
}
/* Get version info from client */
updateClientVer();
/* Store some logging information in session variables
* so other processes can access them */
if (defined("ZM_EYEZM_LOG_TO_FILE")) $_SESSION['xml_log_to_file'] = ZM_EYEZM_LOG_TO_FILE;
if (defined("ZM_EYEZM_LOG_FILE")) $_SESSION['xml_log_file'] = ZM_EYEZM_LOG_FILE;
if (defined("ZM_EYEZM_DEBUG")) $_SESSION['xml_debug'] = ZM_EYEZM_DEBUG;
?>

View File

@ -1,392 +0,0 @@
<?php
/*
* actions.php is created by Jai Dhar, FPS-Tech, for use with eyeZm
* iPhone application. This is not intended for use with any other applications,
* although source-code is provided under GPL.
*
* For questions, please email jdhar@eyezm.com (http://www.eyezm.com)
*
*/
/* Parse any specific actions here */
if (isset($_GET['action'])) {
$action = $_GET['action'];
if (!strcmp($action, "devent")) {
/* ACTION: Delete an Event. Parms: <eid> */
if (!canEdit('Events')) {
logXmlErr("User ".$user['Username']. " doesn't have edit Events perms");
exit;
}
if (!isset($_REQUEST['eid'])) {
logXmlErr("EID not set for action delete-event");
exit;
}
$eid = validInteger($_REQUEST['eid']);
$url = "./index.php?view=request&request=event&id=".$eid."&action=delete";
header("Location: ".$url);
exit;
} else if (!strcmp($action, "spawn264")) {
/* ACTION: Spawn 264 streaming process.
* Parms: <monitor>[br|width|height] */
if (!canView('Stream')) {
logXmlErr("User ".$user['Username']. " doesn't have view Stream perms");
exit;
}
if (!isset($_GET['monitor'])) {
logXmlErr("Not all parameters specified for spawn264");
exit;
}
$monitor = validInteger($_REQUEST['monitor']);
if (!isMonitor($monitor)) exit;
$dims = getMonitorDims($monitor);
$width = validInteger(getset('width', $dims['Width']));
$height = validInteger(getset('height', $dims['Height']));
$br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR));
/* Check that we can stream first */
if (!canStream264()) {
/* canStream264 will print out error */
exit;
}
$streamUrl = stream264fn($monitor, $width, $height, $br);
logXml("Using H264 Pipe Function: ".$streamUrl);
$pid = shell_exec($streamUrl);
logXml("Streaming Process for monitor ".$monitor." ended, cleaning up files");
eraseH264Files($monitor);
exit;
} else if (!strcmp($action, "kill264")) {
/* ACTION: Kill existing H264 stream process and cleanup files.
* Parms: <monitor>.
* NOTE: This will be called directly by path, so include files
* may not be available */
session_start();
require_once(dirname(__FILE__)."/../includes/functions.php");
if (!isset($_GET['monitor'])) {
logXmlErr("Not all parameters specified for kill264");
exit;
}
$monitor = validInteger($_GET['monitor']);
kill264proc($monitor);
logXml("Killed Segmenter process for monitor ".$monitor);
exit;
} else if (!strcmp($action, "chk264")) {
/* ACTION: Simply stalls while checking for 264 file.
* Parms: <monitor><timeout>
* NOTE: This will be called directly by path, so include files
* may not be available */
session_start();
require_once(dirname(__FILE__)."/../includes/functions.php");
if (!isset($_GET['monitor']) || !isset($_GET['timeout'])) {
logXmlErr("Monitor not specified for chk264");
exit;
}
$monitor = validInteger($_GET['monitor']);
$path = getTempDir()."/".m3u8fname($monitor);
/* Wait for the second sample to become available */
$tsfile = getTempDir()."/sample_".$monitor."-2.ts";
/* Setup timeout */
$startTime = time();
$timeout = validInteger($_GET['timeout']);
while (!file_exists($path) || !file_exists($tsfile)) {
if (time() > $startTime + $timeout) {
logXmlErr("Timed out waiting for stream to start, exiting...");
kill264proc($monitor);
exit;
}
usleep(10000);
}
logXml("File exists, stream created after ".(time()-$startTime)." sec");
exit;
} else if (!strcmp($action, "feed")) {
/* ACTION: View a feed. Parms: <monitor> [height|width|fps|scale|vcodec|br] */
if (!canView('Stream')) {
logXmlErr("User ".$user['Username']. " doesn't have view Stream perms");
exit;
}
/* Check that required variables are set */
if (!isset($_REQUEST['monitor'])) {
logXmlErr("Not all parameters set for action view-feed");
exit;
}
$monitor = validInteger($_REQUEST['monitor']);
if (!isMonitor($monitor)) exit;
$dims = getMonitorDims($monitor);
$width = validInteger(getset('width', $dims['Width']));
$height = validInteger(getset('height', $dims['Height']));
$fps = validInteger(getset('fps', ZM_WEB_VIDEO_MAXFPS));
$scale = validInteger(getset('scale', 100));
$vcodec = validString(getset('vcodec', ZM_EYEZM_FEED_VCODEC));
/* Select which codec we want */
if (!strcmp($vcodec, "h264")) {
/* Validate that we can in fact stream H264 */
if (!canStream264()) {
/* canStream264 will print out error if
* there is one */
echo "Server cannot stream H264. Check eyeZm log for details";
exit;
}
if (!requireVer("1", "2")) {
echo "H264 Streaming requires eyeZm v1.2 or above";
logXmlErr("H264 Streaming requires eyeZm v1.2 or above");
exit;
}
$br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR));
/* H264 processing */
noCacheHeaders();
/* Kill any existing processes and files */
kill264proc($monitor);
eraseH264Files($monitor);
logXml("Streaming H264 on Monitor ".$monitor.", ".$width."x".$height." @".$br);
/* Get thumbnail source */
$thumbsrc =
getStreamSrc( array(
"mode=single",
"monitor=".$monitor,
"scale=".$scale,
"maxfps=".$fps,
"buffer=1000"
) );
logXml("Using thumbnail image from ".$thumbsrc);
/* Generate H264 Web-page */
echo "<meta name=\"viewport\" content=\"width=".$width."\" />\n";
h264vidHtml($width, $height, $monitor, $br, $thumbsrc);
} else if (!strcmp($vcodec, "mjpeg")) {
/* MJPEG streaming */
/* If $fps=0, get a single-shot */
if (!$fps) {
/* single-shot */
$streamSrc =
getStreamSrc( array(
"mode=single",
"monitor=".$monitor,
"scale=".$scale,
"maxfps=0",
"buffer=1000"
) );
} else {
$streamSrc =
getStreamSrc( array(
"mode=jpeg",
"monitor=".$monitor,
"scale=".$scale,
"maxfps=".$fps,
"buffer=1000"
) );
}
noCacheHeaders();
xhtmlHeaders( __FILE__, "Stream" );
logXml("Streaming MJPEG on Monitor ".$monitor.", ".$width."x".$height." @".$fps."fps");
echo "<meta name=\"viewport\" content=\"width=".$width."\" />\n";
echo "<body>\n";
echo "<div style=\"border: 0px solid; padding: 0px; background-color: black; position: absolute; top: 0px; left; 0px; margin: 0px; width: ".$width."px; height: ".$height."px;\">\n";
logXml("Using stream source: ".$streamSrc);
outputImageStream("liveStream", $streamSrc, $width, $height, "stream");
echo "</div></body></html>";
} else {
logXmlErr("Unsupported codec ".$vcodec." selected for streaming");
echo("Unsupported codec ".$vcodec." selected for streaming");
}
exit;
} else if (!strcmp($action, "vevent")) {
/* ACTION: View an event. Parms: <eid> [fps|vcodec|br] */
if (!canView('Events')) {
logXmlErr("User ".$user['Username']. " doesn't have view Events perms");
exit;
}
if (!isset($_GET['eid'])) {
logXmlErr("Not all parameters set for Action View-event");
exit;
}
/* Grab event from the database */
$eid = validInteger($_GET['eid']);
$eventsSql = "select E.Id, E.MonitorId, E.Name, E.StartTime, E.Length, E.Frames from Events as E where E.Id = ?";
$event = dbFetchOne($eventsSql, NULL, array( $eid ) );
/* Check if exists */
if (!$event) {
logxmlErr("Requested event ID ".$eid." does not exist");
exit;
}
/* Calculate FPS */
$fps = validInteger(getset('fps',ceil($event['Frames'] / $event['Length'])));
$vcodec = validString(getset('vcodec', ZM_EYEZM_EVENT_VCODEC));
$baseURL = ZM_PATH_WEB."/".getEventPathSafe($event);
/* Here we validate the codec.
* Check that FFMPEG exists and supports codecs */
if (!strcmp($vcodec, "mpeg4")) {
if (!ffmpegSupportsCodec("mpeg4")) {
logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support mpeg4");
exit;
}
/* Can generate, we are good to go */
$fname = "capture.mov";
$ffparms = "-vcodec mpeg4 -r ".ZM_EYEZM_EVENT_FPS." ".$baseURL."/".$fname." 2> /dev/null";
} else if (!strcmp($vcodec, "h264")) {
if (!ffmpegSupportsCodec("libx264")) {
logXmlErr("FFMPEG not installed, accessible in path/ZM_PATH_FFMPEG, or doesn't support H264");
exit;
}
if (!requireVer("1","2")) {
logXmlErr("H264 Event viewing requires eyeZm v1.2 or greater");
exit;
}
/* Good to go */
$fname = "capture.mp4";
$ffparms = getFfmpeg264FoutParms(
validString(getset('br',ZM_EYEZM_H264_DEFAULT_EVBR)),
$baseURL."/".$fname);
} else {
logXmlErr("Unknown codec ".$vcodec." selected for event viewing");
exit;
}
logXml("Selected ".$vcodec." for viewing event ".$event['Id']);
$fnameOut = $baseURL."/".$fname;
$shellCmd = getFfmpegPath()." -y -r ".$fps." -i ".$baseURL."/%0".ZM_EVENT_IMAGE_DIGITS."d-capture.jpg";
$shellCmd .= " ".$ffparms;
logXml("Encoding event with command: ".$shellCmd);
$shellOutput = shell_exec($shellCmd);
/* Check that file exists */
if (!file_exists(trim($fnameOut))) {
logXmlErr("Generate Event ".$event['Id']." file ".$fnameOut." does not exist");
exit;
}
$url = "./".getEventPathSafe($event)."/".$fname;
logXml("Loading Event URL ".$url);
header("Location: ".$url);
exit;
} else if (!strcmp($action, "vframe")) {
/* ACTION: View a frame given by an event and frame-id. Parms: <eid> <frame> [alarm | analyze | qty | scale]
* If 'alarm' is set, the returned frame will be the <frame>-th alarm frame. If 'analyze' is set,
* the returned frame will be the %03d-analyse frame instead of %03d-capture, if ZM_CREATE_ANALYSIS_IMAGES
* is set. Otherwise it just returns the captured frame.
* If qty is set, it will apply a quality factor from 0-100, and if width is set, it will scale the jpeg accordingly
*/
if (!isset($_GET['eid']) || !isset($_GET['frame'])) {
logXmlErr("Not all parameters set for action view-frame");
exit;
}
$eid = validInteger($_GET['eid']);
$frame = validInteger($_GET['frame']);
$eventsSql = "select E.Id, E.MonitorId, E.Name, E.StartTime, E.Length, E.Frames from Events as E where E.Id = ?";
$event = dbFetchOne($eventsSql, NULL, array( $eid ) );
$qty = validInteger(getset('qty', 100));
if ($qty > 100) $qty = 100;
$scale = validInteger(getset('scale', 100));
if (!$event) {
logxmlErr("Requested event ID ".$eid." does not exist");
exit;
}
/* Figure out the frame number. If 'alarm' is not set, this is just equal to the <frame> parameter.
* If 'alarm' is set, need to query DB and grab the <frame>-th item */
if (isset($_GET['alarm'])) {
$frameSql = "select * from Frames as F where F.EventId=? and (F.Type = 'Alarm') order by F.FrameId";
$i=0;
foreach (dbFetchAll($frameSql, NULL, array($eid) ) as $dbframe) {
if ($i == $frame) {
$frame = $dbframe['FrameId'];
break;
}
$i++;
}
}
if (isset($_GET['analyze']) && ZM_CREATE_ANALYSIS_IMAGES) {
$suffix = "analyse";
} else {
$suffix = "capture";
}
/* A frame index of 0 is invalid, so if we see this, just use frame 1 */
if (!$frame) $frame = 1;
/* Suffix based on 'analyze' */
$fname = sprintf("%0".ZM_EVENT_IMAGE_DIGITS."d-%s.jpg", $frame, $suffix);
$url = "./".getEventPathSafe($event)."/".$fname;
if (!file_exists($url)) {
logXmlErr("Invalid frame image requested: ".$url);
$url = "./skins/xml/views/notfound.png";
}
/* Check if the image needs any processing - check for GD if requested */
if (($scale != 100) || ($qty < 100)) {
if (!gdExists()) {
logXmlErr("Lib GD is not loaded, but required for image scaling functions");
$url = "./skins/xml/views/notfound.png";
} else if (!$img = imagecreatefromjpeg($url)) {
logXmlErr("Could not load JPEG from ".$url);
$url = "./skins/xml/views/notfound.png";
} else {
/* GD exists and we read the file ok */
header('Content-type: image/jpeg');
/* Check if resizing is needed */
if ($scale != 100) {
list($width_orig, $height_orig) = getimagesize($url);
$width_new = $width_orig * ($scale/100);
$height_new = $height_orig * ($scale/100);
$img_new = imagecreatetruecolor($width_new, $height_new);
imagecopyresampled($img_new, $img, 0, 0, 0, 0, $width_new, $height_new, $width_orig, $height_orig);
imagejpeg($img_new, NULL, $qty);
} else {
imagejpeg($img, NULL, $qty);
}
exit;
}
}
header("Location: ".$url);
exit;
} else if (!strcmp($action, "state")) {
/* ACTION: Change the state of the system. Parms: <state> */
if (!canEdit('System')) {
logXmlErr("User ".$user['Username']. " doesn't have edit System perms");
exit;
}
if (!isset($_GET['state'])) {
logXmlErr("Server state not specified for action");
exit;
}
$url = "./index.php?view=none&action=state&runState=".validString($_GET['state']);
header("Location: ".$url);
exit;
} else if (!strcmp($action, "func")) {
/* ACTION: Change state of the monitor. Parms: <mid><func><en> */
if (!canEdit('Monitors')) {
logXmlErr("User ".$user['Username']. " doesn't have monitors Edit perms");
exit;
}
if (!isset($_GET['mid']) || !isset($_GET['func']) || !isset($_GET['en'])) {
logXmlErr("Not all parameters specified for action Monitor state");
exit;
}
$mid = validInteger($_GET['mid']);
if (!isMonitor($mid)) exit;
$url = "./index.php?view=none&action=function&mid=".$mid."&newFunction=".validString($_GET['func'])."&newEnabled=".validString($_GET['en']);
header("Location: ".$url);
exit;
} else if (!strcmp($action, "vlog")) {
/* ACTION: View log file. Must have debug and log to file enabled, and sufficient perms
* Parms: [lines] */
if (!canEdit('System')) {
logXmlErr("Insufficient permissions to view log file");
echo "Insufficient permissions to view log file";
exit;
}
if (!ZM_EYEZM_DEBUG || !ZM_EYEZM_LOG_TO_FILE) {
echo "eyeZm Debug (EYEZM_DEBUG) or log-to-file (EYEZM_LOG_TO_FILE) not enabled. Please enable first";
exit;
}
if (!file_exists(ZM_EYEZM_LOG_FILE)) {
echo "Log file ".ZM_EYEZM_LOG_FILE." doesn't exist";
exit;
}
$lines = validInteger(getset('lines',ZM_EYEZM_LOG_LINES));
logXml("Returning last ".$lines." lines of eyeZm Log from ".ZM_EYEZM_LOG_FILE);
echo shell_exec("tail -n ".$lines." ".ZM_EYEZM_LOG_FILE);
echo "\n\n--- Showing last ".$lines." lines ---\n";
echo "--- End of Log ---\n\n";
}
}
?>

View File

@ -1,259 +0,0 @@
<?php
//
// ZoneMinder web console file, $Date: 2009-02-19 10:05:31 +0000 (Thu, 19 Feb 2009) $, $Revision: 2780 $
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
/*
* console.php is updated by Jai Dhar, FPS-Tech, for use with eyeZm
* iPhone application. This is not intended for use with any other applications,
* although source-code is provided under GPL.
*
* For questions, please email support@eyezm.com (http://www.eyezm.com)
*
*/
$eventCounts = array(
array(
"title" => translate('Events'),
"filter" => array(
"terms" => array(
)
),
),
array(
"title" => translate('Hour'),
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour" ),
)
),
),
array(
"title" => translate('Day'),
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 day" ),
)
),
),
array(
"title" => translate('Week'),
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-7 day" ),
)
),
),
array(
"title" => translate('Month'),
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "0" ),
array( "cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 month" ),
)
),
),
array(
"title" => translate('Archived'),
"filter" => array(
"terms" => array(
array( "attr" => "Archived", "op" => "=", "val" => "1" ),
)
),
),
);
$running = daemonCheck();
$status = $running?translate('Running'):translate('Stopped');
if ( $group = dbFetchOne( 'SELECT * FROM Groups WHERE Id = ?', NULL, array(empty($_COOKIE['zmGroup'])?0:$_COOKIE['zmGroup']) ) )
$groupIds = array_flip(split( ',', $group['MonitorIds'] ));
$maxWidth = 0;
$maxHeight = 0;
$cycleCount = 0;
$minSequence = 0;
$maxSequence = 1;
$seqIdList = array();
$monitors = dbFetchAll( "select * from Monitors order by Sequence asc" );
$displayMonitors = array();
for ( $i = 0; $i < count($monitors); $i++ )
{
if ( !visibleMonitor( $monitors[$i]['Id'] ) )
{
continue;
}
if ( $group && !empty($groupIds) && !array_key_exists( $monitors[$i]['Id'], $groupIds ) )
{
continue;
}
$monitors[$i]['Show'] = true;
if ( empty($minSequence) || ($monitors[$i]['Sequence'] < $minSequence) )
{
$minSequence = $monitors[$i]['Sequence'];
}
if ( $monitors[$i]['Sequence'] > $maxSequence )
{
$maxSequence = $monitors[$i]['Sequence'];
}
if (isset($_GET['nostatus'])) {
$monitors[$i]['zmc'] = 1;
$monitors[$i]['zma'] = 1;
} else {
$monitors[$i]['zmc'] = zmcStatus( $monitors[$i] );
$monitors[$i]['zma'] = zmaStatus( $monitors[$i] );
}
$monitors[$i]['ZoneCount'] = dbFetchOne( 'select count(Id) as ZoneCount from Zones where MonitorId = ?', 'ZoneCount', array($monitors[$i]['Id']) );
$counts = array();
for ( $j = 0; $j < count($eventCounts); $j++ )
{
$filter = addFilterTerm( $eventCounts[$j]['filter'], count($eventCounts[$j]['filter']['terms']), array( "cnj" => "and", "attr" => "MonitorId", "op" => "=", "val" => $monitors[$i]['Id'] ) );
parseFilter( $filter );
$counts[] = "count(if(1".$filter['sql'].",1,NULL)) as EventCount$j";
$monitors[$i]['eventCounts'][$j]['filter'] = $filter;
}
$sql = 'SELECT '.join($counts,", ").' from Events as E where MonitorId = ?';
$counts = dbFetchOne( $sql, NULL, array( $monitors[$i]['Id'] ) );
if ( $monitors[$i]['Function'] != 'None' )
{
$cycleCount++;
$scaleWidth = reScale( $monitors[$i]['Width'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
$scaleHeight = reScale( $monitors[$i]['Height'], $monitors[$i]['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
if ( $maxWidth < $scaleWidth ) $maxWidth = $scaleWidth;
if ( $maxHeight < $scaleHeight ) $maxHeight = $scaleHeight;
}
$monitors[$i] = array_merge( $monitors[$i], $counts );
$seqIdList[] = $monitors[$i]['Id'];
$displayMonitors[] = $monitors[$i];
}
$states = dbFetchAll("select * from States");
/* XML Dump Starts here */
xml_header();
/* Print out the general section */
xml_tag_sec("ZM_XML", 1);
xml_tag_sec("GENERAL", 1);
xml_tag_val("RUNNING", $running);
xml_tag_val("PROTOVER", ZM_EYEZM_PROTOCOL_VERSION);
xml_tag_val("FEATURESET", ZM_EYEZM_FEATURE_SET);
xml_tag_val("VERSION", ZM_VERSION);
xml_tag_val("CANSTR264", canStream264(1));
xml_tag_val("GD", gdExists());
xml_tag_val("FVCODEC", ZM_EYEZM_FEED_VCODEC);
xml_tag_val("FVTMT", ZM_EYEZM_H264_TIMEOUT);
xml_tag_val("USER", $user['Username']);
xml_tag_val("UID", $user['Id']);
/* Permissions block */
xml_tag_sec("PERMS", 1);
xml_tag_val("STREAM", $user['Stream']);
xml_tag_val("EVENTS", $user['Events']);
xml_tag_val("CONTROL", $user['Control']);
xml_tag_val("MONITORS", $user['Monitors']);
xml_tag_val("DEVICES", $user['Devices']);
xml_tag_val("SYSTEM", $user['System']);
xml_tag_sec("PERMS", 0);
/* End permissions block */
if (canEdit('System')) {
if ($running) {
xml_tag_val("STATE", "stop");
xml_tag_val("STATE", "restart");
} else {
xml_tag_val("STATE", "start");
}
foreach ($states as $state) {
xml_tag_val("STATE", $state['Name']);
}
}
/* End general section */
xml_tag_sec("GENERAL", 0);
/* Print out the monitors section */
xml_tag_sec("MONITOR_LIST", 1);
foreach( $displayMonitors as $monitor )
{
if (!canView('Monitors')) continue;
xml_tag_sec("MONITOR", 1);
xml_tag_val("ID", $monitor['Id']);
xml_tag_val("NAME", $monitor['Name']);
xml_tag_val("FUNCTION", $monitor['Function']);
xml_tag_val("NUMEVENTS", $monitor['EventCount0']);
xml_tag_val("ENABLED", $monitor['Enabled']);
xml_tag_val("ZMC", $monitor['zmc']);
xml_tag_val("ZMA", $monitor['zma']);
xml_tag_val("STATE", ($monitor['zmc']!=1)?"ERROR":(
($monitor['zma']==1)?"OK":"WARN"));
xml_tag_val("WIDTH", $monitor['Width']);
xml_tag_val("HEIGHT", $monitor['Height']);
/* Form the data-base query for this monitor */
$pageOffset = 0;
$offset = 0;
if (isset($_GET['numEvents'])) {
$numEvents = validInteger($_GET['numEvents']);
$eventsSql = "select E.Id,E.MonitorId,M.Name As MonitorName,E.Cause,E.Name,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) and ( E.MonitorId = ? ) order by E.StartTime desc";
$eventsSql .= " limit ".$numEvents;
/* If there is an pageOff<x> tag for this monitor, then retrieve the offset. Otherwise, don't specify offset */
if (isset($_GET['pageOff'.$monitor['Id']])) {
/* If pageOffset is greater than we actually have,
* we need to adjust it */
$pageOffset = validInteger($_GET['pageOff'.$monitor['Id']]);
if ($pageOffset >= ceil($monitor['EventCount0']/$numEvents)) {
$pageOffset = 0;
}
$offset = $pageOffset * $numEvents;
}
$eventsSql .= " offset ".$offset;
} else {
unset($eventsSql);
}
xml_tag_val("PAGEOFF", $pageOffset);
xml_tag_sec("EVENTS",1);
if (canView('Events') && isset($eventsSql)) {
foreach ( dbFetchAll( $eventsSql, NULL, array($monitor['Id']) ) as $event )
{
xml_tag_sec("EVENT",1);
xml_tag_val("ID",$event['Id']);
xml_tag_val("NAME",$event['Name']);
xml_tag_val("TIME", strftime( STRF_FMT_DATETIME_SHORTER, strtotime($event['StartTime'])));
xml_tag_val("DURATION", $event['Length']);
xml_tag_val("FRAMES", $event['Frames']);
xml_tag_val("FPS", ($event['Length'] > 0)?ceil($event['Frames']/$event['Length']):0);
xml_tag_val("TOTSCORE", $event['TotScore']);
xml_tag_val("AVGSCORE", $event['AvgScore']);
xml_tag_val("MAXSCORE", $event['MaxScore']);
/* Grab the max frame-id from Frames table. If AlarmFrames = 0, don't try
* to grab any frames, and just signal the max frame index as index 0 */
$fridx = 1;
$alarmFrames = 1;
if ($event['AlarmFrames']) {
$framesSql = "SELECT FrameId FROM Frames WHERE (Type = 'Alarm') and (EventId = ?) ORDER BY Score DESC LIMIT 1";
$fr = dbFetchOne($framesSql, NULL, array( $event['Id'] ) );
$fridx = $fr['FrameId'];
$alarmFrames = $event['AlarmFrames'];
}
xml_tag_val("ALARMFRAMES", $alarmFrames);
xml_tag_val("MAXFRAMEID", $fridx);
xml_tag_sec("EVENT",0);
}
}
xml_tag_sec("EVENTS",0);
xml_tag_sec("MONITOR", 0);
}
xml_tag_sec("MONITOR_LIST", 0);
xml_tag_sec("ZM_XML", 0);
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB