MythZoneMinder

From MythTV Official Wiki
Revision as of 10:17, 6 August 2017 by Stevegoodey (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MythZoneMinder

MythZoneMinder is a plugin to interface to some of the features of ZoneMinder. You can use it to view a status window similar to the console window in ZM where you can check the ZM servers status as well as enable/disable a camera, turn on notifications and alter the camera recording function (i.e. record only on motion detection etc). There are screens to view live camera shots showing 1, 2, 4, 6 or 8 cameras and replay recorded events which can be filtered by camera and date. There is also a notification pop-up that can be turned on for each camera that pops up a mini view of a camera whenever motion has been detected. Other features may be added at a later time if there is sufficient interest.

  • ZoneMinder is a Linux video camera security and surveillance solution

Dependencies

You must already have a working ZoneMinder installation accessible somewhere on your network. The plugin has been tested with versions from 1.22.2 up to 1.30.0


Install MythZoneMinder

The plugin doesn't require any additional dependencies to compile. As with all the plugins you should have compiled and installed MythTV before trying to compile it.

The source code is part of the mythplugins repository and all that is needed to install it is to grab the latest mythplugins source from git and run configure with

 --enable-zoneminder 

added as a parameter when running the configure script.

Then compile and install the plugins in the normal way.

Install MythZMServer

mythzmserver is a small daemon that should be run on same machine that ZoneMinder is running on. It is a server that responds to request for information like ZMs server status, live frame data, event frames etc from mythfrontends running the MythZoneMinder plugin.

Compiling MythZMServer

The server will be compiled as part of the normal mythplugins compilation and if the server machine is running similar versions of the required libraries then you can simply copy the mythzmserver executable over to the server machine.

If not then you should copy the mythzmserver directory over to the server machine and compile the source there. It doesn't require Myth or QT to be installed. You can use the Makefile.standalone to do the compilation like this:-

make -f Makefile.standalone

then simply copy the resulting mythzmserver to a suitable location.

Running MythZMServer

You should usually start mythzmserver as a service at boot time. It must be started after the ZoneMinder server has been started. One way to do this is to modify the ZM startup script to also start/stop mythzmserver. The server should be run as either root or as the same user that ZM uses. By default the server will listen on port 6548 and will read the ZM config from /etc/zm.conf if you need to change any of these you can add a parameter to change them. See the README in the mythzmserver source directory for a list of available parameters.

Running The plugin

The first thing you should do is go to MythZoneMinder's settings page and make sure the settings there are correct for your system. Currently the only settings are for the IP address and port that the plugin should use to connect to the mythzmserver.

The various screens are described below

The Console Screen

The Console Screen

The console screen shows you if the main ZM daemon is running, the current date/time, what the CPU load is and what percentage of the drive used to store events has been used. Below that is a list of monitors/cameras, their current status and a count of how many events are stored for each monitor.

Keys:-

  • UP/DOWN - moves the selected item in the list up down.
  • ESCAPE - exit back to the menu.

The Live View Screen

Live View - 1 camera
Live View - 2 cameras
Live View - 4 camera

The live screen shows live views from any available monitor. Currently there are views to show 1, 2, 4, 6 or 8 cameras/monitors simultaneously. Above each monitor view is the camera name and the current status e.g. idle, alert or alarm.

Keys:-

  • INFO - switches from 1,2 or 4 camera views.
  • 1 - cycles though each available monitor to be shown on the first view
  • 2,3,4 - ditto for the second, third, and forth views if the current screen layout has one
  • ESCAPE - return to the menu.

The Events Screen

Events Screen - List View

The event screen shows a list of all stored events. You can filter the list to show events from just one monitor or all monitors and also by date. Events can be played of deleted as required.

Events Screen - Grid View

The grid view shows the events list in an image grid with each image being an analysis image showing any movement detected outlined in red. You can switch the grid view to show 1, 2 or 6 images in the grid by pressing the 1,2 or 6 number keys.


Keys:-

  • UP/DOWN - In the camera and date 'selector' widget change the selected item.
  • LEFT/RIGHT - Move focus to the next/previous widget.
  • SELECT - Plays the event if the list or grid has focus or activates all other widgets.
  • MENU - Show a popup menu with options to refresh the events list, switch views and delete all events that match the current filter.
  • DELETE - Delete the currently selected event.
  • INFO - Toggles the event list order. It will remember your chose and use it the next time the event list screen is shown.
  • ESCAPE - When the grid has focus move the focus to the next widget elsewhere returns to the menu
  • 1,2,6 - Switch the grid view to show 1, 2 or 6 images in the grid.
  • 0 - Toggle the view between the list view or grid view.

The Event Player Screen

Event Player Screen

The event screen plays recorded events.

  • UP/DOWN - Move focus to the next/previous widget.
  • LEFT/RIGHT - When paused moves the the previous/next frame in the event.
  • PAGEUP/PAGEDOWN - Move to the previous/next event.
  • PAUSE - Toggles play pause on/off
  • DELETE - Delete the current event and move to the next one in the list
  • SWITCHASPECT - toggle full screen mode on/off
  • ESCAPE - return to the events list screen.

Troubleshooting

How to overcome some common issues:

1. mythzmserver fails to start with a "This version of ZM is to old you need 1.24.0 or later" error message.
- Newer versions of ZoneMinder no longer put the ZM_VERSION in the zm.conf configuration file which mythzmserver uses to configure itself.

Simply add the line ZM_VERSION=1.30.0 to the config file which you can find at /etc/zm.conf or sometimes /etc/zm/zm.conf.

2. MythFrontend crashes after you try to enter the live view screen.--Tgutwin 21
39, 4 March 2007 (UTC)
- If you have just changed any of your ZM monitor sources (/dev/video0 to /dev/video3 for example) you will need to restart the mythzmserver. Find the mythzmserver process, kill it, and restart it.
- Try turning off OpenGL playback in the settings panel as this can cause the X server to crash.


Time.png Outdated: The following may be outdated and not relevant for current MythTV/ZoneMinder installations

3. Mythtv can't find the zm installation. Error messages show up in the myth logs(or console) when you try to access the MythZoneMinder menu items.--Tgutwin 21
39, 4 March 2007 (UTC)
This might happen if the MythTV install was not in /usr/local and when ZM was installed in /usr/local. You need to add the ZM_PATH_BIN variable into the /etc/zm.conf
  Here is an example /etc/zm.conf file: 
      #ZM_DB_HOST=10.0.0.212
      ZM_VERSION=1.22.3
      ZM_DB_NAME=zm
      ZM_DB_USER=whateverYourZMDBUsernameIs
      ZM_DB_PASS=******
      ZM_PATH_WEB=/var/media/security/zoneMinderWWW
      ZM_PATH_BIN=/usr/local/bin
      #ZM_WEB_USER

Time.png Outdated: The following may be outdated and not relevant for current MythTV/ZoneMinder installations

4. ZoneMinder Plugin UI Menus and objects not installing with make install. (when building from svn source)--Tgutwin 21
39, 4 March 2007 (UTC)
If many of the additional MythTV plugins, including MytZoneMinder, are giving an error dialog in MythTV when entering the plugin menus such as: "Could not locate 'status_text' in theme 'X' " . It is probably because the Plugin UI Menus and objects not installing with make install. I had trouble with the plugins call to 'sudo make install' not working correctly. You might need to call the individual install targets explicitly as follows:
   [root[at]dvr mythplugins]$ cd mythzoneminder/mythzoneminder
   [root[at]dvr mythzoneminder]$ make install_target install_menufiles install_uifiles install_installimages
   [root[at]dvr mythzoneminder]$ cd ../../mythnews/mythnews
   [root[at]dvr mythnews]$ make install_target install_uifiles install_installimages
   [root[at]dvr mythnews]$ cd ../../mythgallery/mythgallery
   [root[at]dvr mythgallery]$ make install_target install_installimages install_uifiles
   [root[at]dvr mythgallery]$ cd ../../mythmusic/mythmusic
   [root[at]dvr mythmusic]$ make install_target install_installfiles install_uifiles
   [root[at]dvr mythmusic]$ cd ../../mythweather/mythweather
   [root[at]dvr mythweather]$ make install_target install_installfiles install_installimages install_uifiles
   [root[at]dvr mythweather]$ cd ../..

TODO

Remove the need for mythzmserver and use the new ZoneMinder API to access the ZM server directly.