XML (eyeZm) plugin: Now renamed plugin to eyeZm, along with all database variables. Note that this must still reside in the skins/xml path until iPhone apps can be moved over at a later point in time
Signed-off-by: Jai Dhar <jdhar@eyezm.com> git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3306 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
15de28e665
commit
e3f8bdb6cd
|
@ -1694,76 +1694,76 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
|
||||||
category => "dynamic",
|
category => "dynamic",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_DEBUG",
|
name => "ZM_EYEZM_DEBUG",
|
||||||
default => "no",
|
default => "no",
|
||||||
description => "Switch additional debugging on for XML Plugin",
|
description => "Switch additional debugging on for eyeZm Plugin",
|
||||||
help => "Enable or Disable extra debugging from the XML Plugin. Extra debugging information will be displayed in it's own file (XML_LOG_TO_FILE is set), or your Apache error log",
|
help => "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},
|
type => $types{boolean},
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_LOG_TO_FILE",
|
name => "ZM_EYEZM_LOG_TO_FILE",
|
||||||
default => "yes",
|
default => "yes",
|
||||||
description => "When XML Debugging is enabled, enabling this logs output to it's own file",
|
description => "When eyeZm Debugging is enabled, enabling this logs output to it's own file",
|
||||||
help => "When XML_DEBUG is on and XML_LOG_TO_FILE is on, output generated from the XML Plugin will go to it's own file. Otherwise it will go to the apache error log.",
|
help => "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},
|
type => $types{boolean},
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_LOG_FILE",
|
name => "ZM_EYEZM_LOG_FILE",
|
||||||
default => "@ZM_LOGDIR@/zm_xml.log",
|
default => "@ZM_LOGDIR@/zm_xml.log",
|
||||||
description => "Default filename to use when logging XML Output and XML_LOG_TO_FILE is enabled",
|
description => "Default filename to use when logging eyeZm Output and EYEZM_LOG_TO_FILE is enabled",
|
||||||
help => "This file will contain it's own output from the XML Plugin when XML_LOG_TO_FILE and XML_DEBUG are both enabled",
|
help => "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},
|
type => $types{string},
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_EVENT_VCODEC",
|
name => "ZM_EYEZM_EVENT_VCODEC",
|
||||||
default => "mpeg4",
|
default => "mpeg4",
|
||||||
description => "Default video-codec to use for encoding events",
|
description => "Default video-codec to use for encoding events",
|
||||||
help => "The XML 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+).",
|
help => "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" ) },
|
type => { db_type=>"string", hint=>"mpeg4|h264", pattern=>qr|^([mh])|i, format=>q( $1 =~ /^m/ ? "mpeg4" : "h264" ) },
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_FEED_VCODEC",
|
name => "ZM_EYEZM_FEED_VCODEC",
|
||||||
default => "mjpeg",
|
default => "mjpeg",
|
||||||
description => "Default video-codec to use for streaming the live feed",
|
description => "Default video-codec to use for streaming the live feed",
|
||||||
help => "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.",
|
help => "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" ) },
|
type => { db_type=>"string", hint=>"mjpeg|h264", pattern=>qr|^([mh])|i, format=>q( $1 =~ /^m/ ? "mjpeg" : "h264" ) },
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_H264_DEFAULT_BR",
|
name => "ZM_EYEZM_H264_DEFAULT_BR",
|
||||||
default => "96k",
|
default => "96k",
|
||||||
description => "Default bit-rate to use with FFMPEG for H264 streaming",
|
description => "Default bit-rate to use with FFMPEG for H264 streaming",
|
||||||
help => "When using the XML 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.",
|
help => "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},
|
type => $types{string},
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_H264_DEFAULT_EVBR",
|
name => "ZM_EYEZM_H264_DEFAULT_EVBR",
|
||||||
default => "128k",
|
default => "128k",
|
||||||
description => "Default bit-rate to use with FFMPEG for H264 event viewing",
|
description => "Default bit-rate to use with FFMPEG for H264 event viewing",
|
||||||
help => "When using the XML 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.",
|
help => "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},
|
type => $types{string},
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_H264_TIMEOUT",
|
name => "ZM_EYEZM_H264_TIMEOUT",
|
||||||
default => "20",
|
default => "20",
|
||||||
description => "Timeout (sec) to wait for H264 stream to start before terminating",
|
description => "Timeout (sec) to wait for H264 stream to start before terminating",
|
||||||
help => "The XML 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",
|
help => "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},
|
type => $types{string},
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "ZM_XML_SEG_DURATION",
|
name => "ZM_EYEZM_SEG_DURATION",
|
||||||
default => "3",
|
default => "3",
|
||||||
description => "Segment duration used for streaming using HTTP-5 Streaming protocol",
|
description => "Segment duration used for streaming using HTTP-5 Streaming protocol",
|
||||||
help => "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.",
|
help => "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},
|
type => $types{string},
|
||||||
category => "XML",
|
category => "eyeZm",
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -189,15 +189,15 @@
|
||||||
#define ZM_DYN_NEXT_REMINDER 185
|
#define ZM_DYN_NEXT_REMINDER 185
|
||||||
#define ZM_DYN_DONATE_REMINDER_TIME 186
|
#define ZM_DYN_DONATE_REMINDER_TIME 186
|
||||||
#define ZM_DYN_SHOW_DONATE_REMINDER 187
|
#define ZM_DYN_SHOW_DONATE_REMINDER 187
|
||||||
#define ZM_XML_DEBUG 188
|
#define ZM_EYEZM_DEBUG 188
|
||||||
#define ZM_XML_LOG_TO_FILE 189
|
#define ZM_EYEZM_LOG_TO_FILE 189
|
||||||
#define ZM_XML_LOG_FILE 190
|
#define ZM_EYEZM_LOG_FILE 190
|
||||||
#define ZM_XML_EVENT_VCODEC 191
|
#define ZM_EYEZM_EVENT_VCODEC 191
|
||||||
#define ZM_XML_FEED_VCODEC 192
|
#define ZM_EYEZM_FEED_VCODEC 192
|
||||||
#define ZM_XML_H264_DEFAULT_BR 193
|
#define ZM_EYEZM_H264_DEFAULT_BR 193
|
||||||
#define ZM_XML_H264_DEFAULT_EVBR 194
|
#define ZM_EYEZM_H264_DEFAULT_EVBR 194
|
||||||
#define ZM_XML_H264_TIMEOUT 195
|
#define ZM_EYEZM_H264_TIMEOUT 195
|
||||||
#define ZM_XML_SEG_DURATION 196
|
#define ZM_EYEZM_SEG_DURATION 196
|
||||||
|
|
||||||
|
|
||||||
#define ZM_MAX_CFG_ID 196
|
#define ZM_MAX_CFG_ID 196
|
||||||
|
@ -391,15 +391,15 @@
|
||||||
const char *dyn_next_reminder;\
|
const char *dyn_next_reminder;\
|
||||||
int dyn_donate_reminder_time;\
|
int dyn_donate_reminder_time;\
|
||||||
bool dyn_show_donate_reminder;\
|
bool dyn_show_donate_reminder;\
|
||||||
bool xml_debug;\
|
bool eyezm_debug;\
|
||||||
bool xml_log_to_file;\
|
bool eyezm_log_to_file;\
|
||||||
const char *xml_log_file;\
|
const char *eyezm_log_file;\
|
||||||
const char *xml_event_vcodec;\
|
const char *eyezm_event_vcodec;\
|
||||||
const char *xml_feed_vcodec;\
|
const char *eyezm_feed_vcodec;\
|
||||||
const char *xml_h264_default_br;\
|
const char *eyezm_h264_default_br;\
|
||||||
const char *xml_h264_default_evbr;\
|
const char *eyezm_h264_default_evbr;\
|
||||||
const char *xml_h264_timeout;\
|
const char *eyezm_h264_timeout;\
|
||||||
const char *xml_seg_duration;\
|
const char *eyezm_seg_duration;\
|
||||||
|
|
||||||
|
|
||||||
#define ZM_CFG_ASSIGN_LIST \
|
#define ZM_CFG_ASSIGN_LIST \
|
||||||
|
@ -591,14 +591,14 @@
|
||||||
dyn_next_reminder = (const char *)config.Item( ZM_DYN_NEXT_REMINDER );\
|
dyn_next_reminder = (const char *)config.Item( ZM_DYN_NEXT_REMINDER );\
|
||||||
dyn_donate_reminder_time = (int)config.Item( ZM_DYN_DONATE_REMINDER_TIME );\
|
dyn_donate_reminder_time = (int)config.Item( ZM_DYN_DONATE_REMINDER_TIME );\
|
||||||
dyn_show_donate_reminder = (bool)config.Item( ZM_DYN_SHOW_DONATE_REMINDER );\
|
dyn_show_donate_reminder = (bool)config.Item( ZM_DYN_SHOW_DONATE_REMINDER );\
|
||||||
xml_debug = (bool)config.Item( ZM_XML_DEBUG );\
|
eyezm_debug = (bool)config.Item( ZM_EYEZM_DEBUG );\
|
||||||
xml_log_to_file = (bool)config.Item( ZM_XML_LOG_TO_FILE );\
|
eyezm_log_to_file = (bool)config.Item( ZM_EYEZM_LOG_TO_FILE );\
|
||||||
xml_log_file = (const char *)config.Item( ZM_XML_LOG_FILE );\
|
eyezm_log_file = (const char *)config.Item( ZM_EYEZM_LOG_FILE );\
|
||||||
xml_event_vcodec = (const char *)config.Item( ZM_XML_EVENT_VCODEC );\
|
eyezm_event_vcodec = (const char *)config.Item( ZM_EYEZM_EVENT_VCODEC );\
|
||||||
xml_feed_vcodec = (const char *)config.Item( ZM_XML_FEED_VCODEC );\
|
eyezm_feed_vcodec = (const char *)config.Item( ZM_EYEZM_FEED_VCODEC );\
|
||||||
xml_h264_default_br = (const char *)config.Item( ZM_XML_H264_DEFAULT_BR );\
|
eyezm_h264_default_br = (const char *)config.Item( ZM_EYEZM_H264_DEFAULT_BR );\
|
||||||
xml_h264_default_evbr = (const char *)config.Item( ZM_XML_H264_DEFAULT_EVBR );\
|
eyezm_h264_default_evbr = (const char *)config.Item( ZM_EYEZM_H264_DEFAULT_EVBR );\
|
||||||
xml_h264_timeout = (const char *)config.Item( ZM_XML_H264_TIMEOUT );\
|
eyezm_h264_timeout = (const char *)config.Item( ZM_EYEZM_H264_TIMEOUT );\
|
||||||
xml_seg_duration = (const char *)config.Item( ZM_XML_SEG_DURATION );\
|
eyezm_seg_duration = (const char *)config.Item( ZM_EYEZM_SEG_DURATION );\
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ $tabs['highband'] = $SLANG['HighBW'];
|
||||||
$tabs['medband'] = $SLANG['MediumBW'];
|
$tabs['medband'] = $SLANG['MediumBW'];
|
||||||
$tabs['lowband'] = $SLANG['LowBW'];
|
$tabs['lowband'] = $SLANG['LowBW'];
|
||||||
$tabs['phoneband'] = $SLANG['PhoneBW'];
|
$tabs['phoneband'] = $SLANG['PhoneBW'];
|
||||||
$tabs['XML'] = "XML";
|
$tabs['eyeZm'] = "eyeZm";
|
||||||
if ( ZM_OPT_USE_AUTH )
|
if ( ZM_OPT_USE_AUTH )
|
||||||
$tabs['users'] = $SLANG['Users'];
|
$tabs['users'] = $SLANG['Users'];
|
||||||
|
|
||||||
|
|
|
@ -9,45 +9,45 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Static defines, these shouldn't change */
|
/* Static defines, these shouldn't change */
|
||||||
define ( "ZM_XML_PROTOCOL_VERSION", "2");
|
define ( "ZM_EYEZM_PROTOCOL_VERSION", "2");
|
||||||
define ( "ZM_XML_FEATURE_SET", "2");
|
define ( "ZM_EYEZM_FEATURE_SET", "2");
|
||||||
|
|
||||||
/* Dynamic defines, check if they are already defined.
|
/* Dynamic defines, check if they are already defined.
|
||||||
* To change a particular parameter default value, without using the
|
* To change a particular parameter default value, without using the
|
||||||
* Options Console, change the 2nd parameter of the define() block. */
|
* Options Console, change the 2nd parameter of the define() block. */
|
||||||
|
|
||||||
/* Parm: ZM_XML_EVENT_FPS: Sets the default FPS of the output videos for events */
|
/* Parm: ZM_EYEZM_EVENT_FPS: Sets the default FPS of the output videos for events */
|
||||||
if (!defined("ZM_XML_EVENT_FPS")) define ( "ZM_XML_EVENT_FPS", "10");
|
if (!defined("ZM_EYEZM_EVENT_FPS")) define ( "ZM_EYEZM_EVENT_FPS", "10");
|
||||||
/* Parm: ZM_XML_EVENT_VCODEC: Default video codec for generating event video. Can be mpeg4 or h264 */
|
/* Parm: ZM_EYEZM_EVENT_VCODEC: Default video codec for generating event video. Can be mpeg4 or h264 */
|
||||||
if (!defined("ZM_XML_EVENT_VCODEC")) define ( "ZM_XML_EVENT_VCODEC", "mpeg4");
|
if (!defined("ZM_EYEZM_EVENT_VCODEC")) define ( "ZM_EYEZM_EVENT_VCODEC", "mpeg4");
|
||||||
/* Parm: ZM_XML_FEED_VCODEC: Default video codec of live feeds. Can be mjpeg or h264 */
|
/* Parm: ZM_EYEZM_FEED_VCODEC: Default video codec of live feeds. Can be mjpeg or h264 */
|
||||||
if (!defined("ZM_XML_FEED_VCODEC")) define ( "ZM_XML_FEED_VCODEC", "mjpeg");
|
if (!defined("ZM_EYEZM_FEED_VCODEC")) define ( "ZM_EYEZM_FEED_VCODEC", "mjpeg");
|
||||||
/* Parm: ZM_XML_SEG_DURATION: H264 Live-streaming segment duration in seconds.
|
/* Parm: ZM_EYEZM_SEG_DURATION: H264 Live-streaming segment duration in seconds.
|
||||||
* Increase to improve feed smooth-ness, but will increase feed latency */
|
* Increase to improve feed smooth-ness, but will increase feed latency */
|
||||||
if (!defined("ZM_XML_SEG_DURATION")) define ( "ZM_XML_SEG_DURATION", "3");
|
if (!defined("ZM_EYEZM_SEG_DURATION")) define ( "ZM_EYEZM_SEG_DURATION", "3");
|
||||||
/* Parm: ZM_XML_DEBUG: Set to 1 to enable XML Debugging */
|
/* Parm: ZM_EYEZM_DEBUG: Set to 1 to enable XML Debugging */
|
||||||
if (!defined("ZM_XML_DEBUG")) define ( "ZM_XML_DEBUG", "0" );
|
if (!defined("ZM_EYEZM_DEBUG")) define ( "ZM_EYEZM_DEBUG", "0" );
|
||||||
/* Parm: ZM_XML_H264_MAX_DURATION: Maximum duration in seconds allowed for viewing H264 Streams.
|
/* 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
|
* 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 */
|
* expires, the H264 stream will be killed if it has not by the user already */
|
||||||
if (!defined("ZM_XML_H264_MAX_DURATION")) define ( "ZM_XML_H264_MAX_DURATION", "120" );
|
if (!defined("ZM_EYEZM_H264_MAX_DURATION")) define ( "ZM_EYEZM_H264_MAX_DURATION", "120" );
|
||||||
/* Parm: ZM_XML_DEFAULT_BR: Default bitrate of H264 live-feed (when selected).
|
/* 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
|
* This parameter can be changed to anything FFMPEG supports. 64k is a good lower bound, and 392k
|
||||||
* a good upper */
|
* a good upper */
|
||||||
if (!defined("ZM_XML_H264_DEFAULT_BR")) define ( "ZM_XML_H264_DEFAULT_BR", "96k" );
|
if (!defined("ZM_EYEZM_H264_DEFAULT_BR")) define ( "ZM_EYEZM_H264_DEFAULT_BR", "96k" );
|
||||||
/* Parm: ZM_XML_H264_TIMEOUT: How long to wait for H264 stream to be created. Increase
|
/* 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 */
|
* this value for streams that take a while to create, or for slow systems that time-out frequently */
|
||||||
if (!defined("ZM_XML_H264_TIMEOUT")) define ( "ZM_XML_H264_TIMEOUT", "20" );
|
if (!defined("ZM_EYEZM_H264_TIMEOUT")) define ( "ZM_EYEZM_H264_TIMEOUT", "20" );
|
||||||
/* Parm: ZM_XML_H264_DEFAULT_EVBR: Default bit-rate when creasing H264 Event videos */
|
/* Parm: ZM_EYEZM_H264_DEFAULT_EVBR: Default bit-rate when creasing H264 Event videos */
|
||||||
if (!defined("ZM_XML_H264_DEFAULT_EVBR")) define ( "ZM_XML_H264_DEFAULT_EVBR", "128k" );
|
if (!defined("ZM_EYEZM_H264_DEFAULT_EVBR")) define ( "ZM_EYEZM_H264_DEFAULT_EVBR", "128k" );
|
||||||
/* Logging defines */
|
/* Logging defines */
|
||||||
/* Parm: ZM_XML_LOG_TO_FILE: Set to 1 to log XML Debug output to a separate file, when
|
/* Parm: ZM_EYEZM_LOG_TO_FILE: Set to 1 to log XML Debug output to a separate file, when
|
||||||
* ZM_XML_DEBUG is set to 1. If set to 0, XML Logging will be directed to Apache error log */
|
* ZM_EYEZM_DEBUG is set to 1. If set to 0, XML Logging will be directed to Apache error log */
|
||||||
if (!defined("ZM_XML_LOG_TO_FILE")) define ( "ZM_XML_LOG_TO_FILE", "1" );
|
if (!defined("ZM_EYEZM_LOG_TO_FILE")) define ( "ZM_EYEZM_LOG_TO_FILE", "1" );
|
||||||
/* Parm: ZM_XML_LOG_FILE: Path to filename when LOG_TO_FILE is enabled */
|
/* Parm: ZM_EYEZM_LOG_FILE: Path to filename when LOG_TO_FILE is enabled */
|
||||||
if (!defined("ZM_XML_LOG_FILE")) define ( "ZM_XML_LOG_FILE", "/tmp/zm_xml.log" );
|
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 */
|
/* Parm: How many lines to display when viewing log from eyeZm */
|
||||||
if (!defined("ZM_XML_LOG_LINES")) define ( "ZM_XML_LOG_LINES", "50" );
|
if (!defined("ZM_EYEZM_LOG_LINES")) define ( "ZM_EYEZM_LOG_LINES", "50" );
|
||||||
|
|
||||||
$rates = array(
|
$rates = array(
|
||||||
"10000" => "100x",
|
"10000" => "100x",
|
||||||
|
|
|
@ -71,27 +71,27 @@ function logXmlErr($str)
|
||||||
}
|
}
|
||||||
function logXml($str, $err = 0)
|
function logXml($str, $err = 0)
|
||||||
{
|
{
|
||||||
if (!defined("ZM_XML_DEBUG")) {
|
if (!defined("ZM_EYEZM_DEBUG")) {
|
||||||
/* Check session variable */
|
/* Check session variable */
|
||||||
if (isset($_SESSION['xml_debug'])) define("ZM_XML_DEBUG", $_SESSION['xml_debug']);
|
if (isset($_SESSION['xml_debug'])) define("ZM_EYEZM_DEBUG", $_SESSION['xml_debug']);
|
||||||
else define ("ZM_XML_DEBUG", "0");
|
else define ("ZM_EYEZM_DEBUG", "0");
|
||||||
}
|
}
|
||||||
if (!defined("ZM_XML_LOG_TO_FILE")) {
|
if (!defined("ZM_EYEZM_LOG_TO_FILE")) {
|
||||||
/* Check session variable */
|
/* Check session variable */
|
||||||
if (isset($_SESSION['xml_log_to_file'])) define("ZM_XML_LOG_TO_FILE", $_SESSION['xml_log_to_file']);
|
if (isset($_SESSION['xml_log_to_file'])) define("ZM_EYEZM_LOG_TO_FILE", $_SESSION['xml_log_to_file']);
|
||||||
else define ("ZM_XML_LOG_TO_FILE", "1");
|
else define ("ZM_EYEZM_LOG_TO_FILE", "1");
|
||||||
}
|
}
|
||||||
if (!defined("ZM_XML_LOG_FILE")) {
|
if (!defined("ZM_EYEZM_LOG_FILE")) {
|
||||||
/* Check session variable */
|
/* Check session variable */
|
||||||
if (isset($_SESSION['xml_log_file'])) define("ZM_XML_LOG_FILE", $_SESSION['xml_log_file']);
|
if (isset($_SESSION['xml_log_file'])) define("ZM_EYEZM_LOG_FILE", $_SESSION['xml_log_file']);
|
||||||
else define ("ZM_XML_LOG_FILE", "/tmp/zm_xml.log");
|
else define ("ZM_EYEZM_LOG_FILE", "/tmp/zm_xml.log");
|
||||||
}
|
}
|
||||||
/* Only log if debug is enabled */
|
/* Only log if debug is enabled */
|
||||||
if (ZM_XML_DEBUG == 0) return;
|
if (ZM_EYEZM_DEBUG == 0) return;
|
||||||
/* Logging is enabled, set log string */
|
/* Logging is enabled, set log string */
|
||||||
$logstr = "XML_LOG (".($err?"ERROR":"NOTICE")."): ".$str.(ZM_XML_LOG_TO_FILE?"\n":"");
|
$logstr = "XML_LOG (".($err?"ERROR":"NOTICE")."): ".$str.(ZM_EYEZM_LOG_TO_FILE?"\n":"");
|
||||||
if (ZM_XML_LOG_TO_FILE) {
|
if (ZM_EYEZM_LOG_TO_FILE) {
|
||||||
error_log("[".date("r")."] ".$logstr, 3, ZM_XML_LOG_FILE);
|
error_log("[".date("r")."] ".$logstr, 3, ZM_EYEZM_LOG_FILE);
|
||||||
} else {
|
} else {
|
||||||
error_log($logstr);
|
error_log($logstr);
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ function getFfmpeg264FoutParms($br, $fout)
|
||||||
function getFfmpeg264Str($width, $height, $br, $fin, $fout)
|
function getFfmpeg264Str($width, $height, $br, $fin, $fout)
|
||||||
{
|
{
|
||||||
$ffparms = getFfmpeg264FoutParms($br, $fout);
|
$ffparms = getFfmpeg264FoutParms($br, $fout);
|
||||||
$ffstr = getFfmpegPath()." -t ".ZM_XML_H264_MAX_DURATION." -analyzeduration 0 -i ";
|
$ffstr = getFfmpegPath()." -t ".ZM_EYEZM_H264_MAX_DURATION." -analyzeduration 0 -i ";
|
||||||
$ffstr .= $fin." -f mpegts ".$ffparms;
|
$ffstr .= $fin." -f mpegts ".$ffparms;
|
||||||
return $ffstr;
|
return $ffstr;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ function stream264fn ($mid, $width, $height, $br) {
|
||||||
$cdir = "./temp";
|
$cdir = "./temp";
|
||||||
$zmstrm = "zmstreamer -m ".$mid." 2> /dev/null";
|
$zmstrm = "zmstreamer -m ".$mid." 2> /dev/null";
|
||||||
$ffstr = getFfmpeg264Str($width, $height, $br, "-", "-");
|
$ffstr = getFfmpeg264Str($width, $height, $br, "-", "-");
|
||||||
$seg = "segmenter - ".ZM_XML_SEG_DURATION." ".$cdir."/sample_".$mid." ".$cdir."/".m3u8fname($mid)." ../ 2> /dev/null";
|
$seg = "segmenter - ".ZM_EYEZM_SEG_DURATION." ".$cdir."/sample_".$mid." ".$cdir."/".m3u8fname($mid)." ../ 2> /dev/null";
|
||||||
$url = $zmstrm . " | ".$ffstr." | " . $seg;
|
$url = $zmstrm . " | ".$ffstr." | " . $seg;
|
||||||
return "nohup ".$url." & echo $!";
|
return "nohup ".$url." & echo $!";
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ function h264vidHtml($width, $height, $monitor, $br, $thumbsrc) {
|
||||||
$ajaxUrl = "?view=actions&action=spawn264&&monitor=".$monitor."&br=".$br;
|
$ajaxUrl = "?view=actions&action=spawn264&&monitor=".$monitor."&br=".$br;
|
||||||
/* Call these two directly to bypass server blocking issues */
|
/* Call these two directly to bypass server blocking issues */
|
||||||
$ajax2Url = "./skins/xml/views/actions.php?action=chk264&monitor=".$monitor;
|
$ajax2Url = "./skins/xml/views/actions.php?action=chk264&monitor=".$monitor;
|
||||||
$ajax2Url .= "&timeout=".ZM_XML_H264_TIMEOUT;
|
$ajax2Url .= "&timeout=".ZM_EYEZM_H264_TIMEOUT;
|
||||||
$ajax3Url = "./skins/xml/views/actions.php?action=kill264&monitor=".$monitor;
|
$ajax3Url = "./skins/xml/views/actions.php?action=kill264&monitor=".$monitor;
|
||||||
?>
|
?>
|
||||||
<html>
|
<html>
|
||||||
|
|
|
@ -39,8 +39,8 @@ if ( !isset($user) && ZM_OPT_USE_AUTH )
|
||||||
updateClientVer();
|
updateClientVer();
|
||||||
/* Store some logging information in session variables
|
/* Store some logging information in session variables
|
||||||
* so other processes can access them */
|
* so other processes can access them */
|
||||||
if (defined("ZM_XML_LOG_TO_FILE")) $_SESSION['xml_log_to_file'] = ZM_XML_LOG_TO_FILE;
|
if (defined("ZM_EYEZM_LOG_TO_FILE")) $_SESSION['xml_log_to_file'] = ZM_EYEZM_LOG_TO_FILE;
|
||||||
if (defined("ZM_XML_LOG_FILE")) $_SESSION['xml_log_file'] = ZM_XML_LOG_FILE;
|
if (defined("ZM_EYEZM_LOG_FILE")) $_SESSION['xml_log_file'] = ZM_EYEZM_LOG_FILE;
|
||||||
if (defined("ZM_XML_DEBUG")) $_SESSION['xml_debug'] = ZM_XML_DEBUG;
|
if (defined("ZM_EYEZM_DEBUG")) $_SESSION['xml_debug'] = ZM_EYEZM_DEBUG;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -41,7 +41,7 @@ if (isset($_GET['action'])) {
|
||||||
$dims = getMonitorDims($monitor);
|
$dims = getMonitorDims($monitor);
|
||||||
$width = validInteger(getset('width', $dims['Width']));
|
$width = validInteger(getset('width', $dims['Width']));
|
||||||
$height = validInteger(getset('height', $dims['Height']));
|
$height = validInteger(getset('height', $dims['Height']));
|
||||||
$br = validString(getset('br', ZM_XML_H264_DEFAULT_BR));
|
$br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR));
|
||||||
/* Check that we can stream first */
|
/* Check that we can stream first */
|
||||||
if (!canStream264()) {
|
if (!canStream264()) {
|
||||||
/* canStream264 will print out error */
|
/* canStream264 will print out error */
|
||||||
|
@ -117,14 +117,14 @@ if (isset($_GET['action'])) {
|
||||||
$height = validInteger(getset('height', $dims['Height']));
|
$height = validInteger(getset('height', $dims['Height']));
|
||||||
$fps = validInteger(getset('fps', ZM_WEB_VIDEO_MAXFPS));
|
$fps = validInteger(getset('fps', ZM_WEB_VIDEO_MAXFPS));
|
||||||
$scale = validInteger(getset('scale', 100));
|
$scale = validInteger(getset('scale', 100));
|
||||||
$vcodec = validString(getset('vcodec', ZM_XML_FEED_VCODEC));
|
$vcodec = validString(getset('vcodec', ZM_EYEZM_FEED_VCODEC));
|
||||||
/* Select which codec we want */
|
/* Select which codec we want */
|
||||||
if (!strcmp($vcodec, "h264")) {
|
if (!strcmp($vcodec, "h264")) {
|
||||||
/* Validate that we can in fact stream H264 */
|
/* Validate that we can in fact stream H264 */
|
||||||
if (!canStream264()) {
|
if (!canStream264()) {
|
||||||
/* canStream264 will print out error if
|
/* canStream264 will print out error if
|
||||||
* there is one */
|
* there is one */
|
||||||
echo "Server cannot stream H264. Check XML log for details";
|
echo "Server cannot stream H264. Check eyeZm log for details";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if (!requireVer("1", "2")) {
|
if (!requireVer("1", "2")) {
|
||||||
|
@ -132,7 +132,7 @@ if (isset($_GET['action'])) {
|
||||||
logXmlErr("H264 Streaming requires eyeZm v1.2 or above");
|
logXmlErr("H264 Streaming requires eyeZm v1.2 or above");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$br = validString(getset('br', ZM_XML_H264_DEFAULT_BR));
|
$br = validString(getset('br', ZM_EYEZM_H264_DEFAULT_BR));
|
||||||
/* H264 processing */
|
/* H264 processing */
|
||||||
noCacheHeaders();
|
noCacheHeaders();
|
||||||
/* Kill any existing processes and files */
|
/* Kill any existing processes and files */
|
||||||
|
@ -196,7 +196,7 @@ if (isset($_GET['action'])) {
|
||||||
}
|
}
|
||||||
/* Calculate FPS */
|
/* Calculate FPS */
|
||||||
$fps = validInteger(getset('fps',ceil($event['Frames'] / $event['Length'])));
|
$fps = validInteger(getset('fps',ceil($event['Frames'] / $event['Length'])));
|
||||||
$vcodec = validString(getset('vcodec', ZM_XML_EVENT_VCODEC));
|
$vcodec = validString(getset('vcodec', ZM_EYEZM_EVENT_VCODEC));
|
||||||
$baseURL = ZM_PATH_WEB."/".getEventPathSafe($event);
|
$baseURL = ZM_PATH_WEB."/".getEventPathSafe($event);
|
||||||
/* Here we validate the codec.
|
/* Here we validate the codec.
|
||||||
* Check that FFMPEG exists and supports codecs */
|
* Check that FFMPEG exists and supports codecs */
|
||||||
|
@ -207,7 +207,7 @@ if (isset($_GET['action'])) {
|
||||||
}
|
}
|
||||||
/* Can generate, we are good to go */
|
/* Can generate, we are good to go */
|
||||||
$fname = "capture.mov";
|
$fname = "capture.mov";
|
||||||
$ffparms = "-vcodec mpeg4 -r ".ZM_XML_EVENT_FPS." ".$baseURL."/".$fname." 2> /dev/null";
|
$ffparms = "-vcodec mpeg4 -r ".ZM_EYEZM_EVENT_FPS." ".$baseURL."/".$fname." 2> /dev/null";
|
||||||
|
|
||||||
} else if (!strcmp($vcodec, "h264")) {
|
} else if (!strcmp($vcodec, "h264")) {
|
||||||
if (!ffmpegSupportsCodec("libx264")) {
|
if (!ffmpegSupportsCodec("libx264")) {
|
||||||
|
@ -221,7 +221,7 @@ if (isset($_GET['action'])) {
|
||||||
/* Good to go */
|
/* Good to go */
|
||||||
$fname = "capture.mp4";
|
$fname = "capture.mp4";
|
||||||
$ffparms = getFfmpeg264FoutParms(
|
$ffparms = getFfmpeg264FoutParms(
|
||||||
validString(getset('br',ZM_XML_H264_DEFAULT_EVBR)),
|
validString(getset('br',ZM_EYEZM_H264_DEFAULT_EVBR)),
|
||||||
$baseURL."/".$fname);
|
$baseURL."/".$fname);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -329,17 +329,17 @@ if (isset($_GET['action'])) {
|
||||||
echo "Insufficient permissions to view log file";
|
echo "Insufficient permissions to view log file";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if (!ZM_XML_DEBUG || !ZM_XML_LOG_TO_FILE) {
|
if (!ZM_EYEZM_DEBUG || !ZM_EYEZM_LOG_TO_FILE) {
|
||||||
echo "XML Debug (XML_DEBUG) or log-to-file (XML_LOG_TO_FILE) not enabled. Please enable first";
|
echo "eyeZm Debug (EYEZM_DEBUG) or log-to-file (EYEZM_LOG_TO_FILE) not enabled. Please enable first";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if (!file_exists(ZM_XML_LOG_FILE)) {
|
if (!file_exists(ZM_EYEZM_LOG_FILE)) {
|
||||||
echo "Log file ".ZM_XML_LOG_FILE." doesn't exist";
|
echo "Log file ".ZM_EYEZM_LOG_FILE." doesn't exist";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$lines = validInteger(getset('lines',ZM_XML_LOG_LINES));
|
$lines = validInteger(getset('lines',ZM_EYEZM_LOG_LINES));
|
||||||
logXml("Returning last ".$lines." lines of XML Log from ".ZM_XML_LOG_FILE);
|
logXml("Returning last ".$lines." lines of eyeZm Log from ".ZM_EYEZM_LOG_FILE);
|
||||||
echo shell_exec("tail -n ".$lines." ".ZM_XML_LOG_FILE);
|
echo shell_exec("tail -n ".$lines." ".ZM_EYEZM_LOG_FILE);
|
||||||
echo "\n\n--- Showing last ".$lines." lines ---\n";
|
echo "\n\n--- Showing last ".$lines." lines ---\n";
|
||||||
echo "--- End of Log ---\n\n";
|
echo "--- End of Log ---\n\n";
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,12 +150,12 @@ xml_header();
|
||||||
xml_tag_sec("ZM_XML", 1);
|
xml_tag_sec("ZM_XML", 1);
|
||||||
xml_tag_sec("GENERAL", 1);
|
xml_tag_sec("GENERAL", 1);
|
||||||
xml_tag_val("RUNNING", $running);
|
xml_tag_val("RUNNING", $running);
|
||||||
xml_tag_val("PROTOVER", ZM_XML_PROTOCOL_VERSION);
|
xml_tag_val("PROTOVER", ZM_EYEZM_PROTOCOL_VERSION);
|
||||||
xml_tag_val("FEATURESET", ZM_XML_FEATURE_SET);
|
xml_tag_val("FEATURESET", ZM_EYEZM_FEATURE_SET);
|
||||||
xml_tag_val("VERSION", ZM_VERSION);
|
xml_tag_val("VERSION", ZM_VERSION);
|
||||||
xml_tag_val("CANSTR264", canStream264(1));
|
xml_tag_val("CANSTR264", canStream264(1));
|
||||||
xml_tag_val("FVCODEC", ZM_XML_FEED_VCODEC);
|
xml_tag_val("FVCODEC", ZM_EYEZM_FEED_VCODEC);
|
||||||
xml_tag_val("FVTMT", ZM_XML_H264_TIMEOUT);
|
xml_tag_val("FVTMT", ZM_EYEZM_H264_TIMEOUT);
|
||||||
xml_tag_val("USER", $user['Username']);
|
xml_tag_val("USER", $user['Username']);
|
||||||
xml_tag_val("UID", $user['Id']);
|
xml_tag_val("UID", $user['Id']);
|
||||||
/* Permissions block */
|
/* Permissions block */
|
||||||
|
|
Loading…
Reference in New Issue