Got rid of MJPEG code choice for viewing events, only MPEG-4 and H264 now. Added default bitrate for event viewing to config XML
Signed-off-by: Jai Dhar <jdhar@eyezm.com> git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3199 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
d3fa2b2df3
commit
c7b3d04eed
|
@ -855,9 +855,10 @@ insert into Config set Id = 186, Name = 'ZM_DYN_NEXT_REMINDER', Value = '', Type
|
|||
insert into Config set Id = 187, Name = 'ZM_DYN_DONATE_REMINDER_TIME', Value = '0', Type = 'integer', DefaultValue = '0', Hint = 'integer', Pattern = '(?-xism:^(\d+)$)', Format = ' $1 ', Prompt = 'When the earliest time to remind about donations will be', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 188, Name = 'ZM_DYN_SHOW_DONATE_REMINDER', Value = '1', Type = 'boolean', DefaultValue = 'yes', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Remind about donations or not', Help = '', Category = 'dynamic', Readonly = '1', Requires = '';
|
||||
insert into Config set Id = 189, Name = 'ZM_XML_DEBUG', Value = '0', Type = 'boolean', DefaultValue = 'no', Hint = 'yes|no', Pattern = '(?i-xsm:^([yn]))', Format = ' ($1 =~ /^y/) ? \"yes\" : \"no\" ', Prompt = 'Switch additional debugging on for XML Plugin', Help = 'Enable or Disable extra debugging from the XML Plugin. Extra debugging information will be displayed in your Apache error log, or whichever location PHP errors are logged to', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 190, Name = 'ZM_XML_EVENT_VCODEC', Value = 'mpeg4', Type = 'string', DefaultValue = 'mpeg4', Hint = 'mpeg4|h264|mjpeg', Pattern = '(?i-xsm:^([mh][pj2]))', Format = ' ($1 =~ /^mp/) ? \"mpeg4\" : ($1 =~ /^h/ ? \"h264\" : \"mjpeg\" ) ', Prompt = '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 MPEG-4 or H264, change this to MJPEG. If using H264, please check http://www.eyezm.com for H264 requirements and that your eyeZm version supports H264 (v1.2+).', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 190, Name = 'ZM_XML_EVENT_VCODEC', Value = 'mpeg4', Type = 'string', DefaultValue = 'mpeg4', Hint = 'mpeg4|h264', Pattern = '(?i-xsm:^([mh]))', Format = ' $1 =~ /^m/ ? \"mpeg4\" : \"h264\" ', Prompt = '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+).', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 191, Name = 'ZM_XML_FEED_VCODEC', Value = 'mjpeg', Type = 'string', DefaultValue = 'mjpeg', Hint = 'mjpeg|h264', Pattern = '(?i-xsm:^([mh]))', Format = ' $1 =~ /^m/ ? \"mjpeg\" : \"h264\" ', Prompt = '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.', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 192, Name = 'ZM_XML_H264_DEFAULT_BR', Value = '96k', Type = 'string', DefaultValue = '96k', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = '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.', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 193, Name = 'ZM_XML_H264_TIMEOUT', Value = '20', Type = 'string', DefaultValue = '20', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = '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', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 194, Name = 'ZM_XML_SEG_DURATION', Value = '3', Type = 'string', DefaultValue = '3', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = '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.', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 193, Name = 'ZM_XML_H264_DEFAULT_EVBR', Value = '128k', Type = 'string', DefaultValue = '128k', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = '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.', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 194, Name = 'ZM_XML_H264_TIMEOUT', Value = '20', Type = 'string', DefaultValue = '20', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = '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', Category = 'XML', Readonly = '0', Requires = '';
|
||||
insert into Config set Id = 195, Name = 'ZM_XML_SEG_DURATION', Value = '3', Type = 'string', DefaultValue = '3', Hint = 'string', Pattern = '(?-xism:^(.+)$)', Format = ' $1 ', Prompt = '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.', Category = 'XML', Readonly = '0', Requires = '';
|
||||
|
||||
|
|
|
@ -1722,8 +1722,8 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
|
|||
name => "ZM_XML_EVENT_VCODEC",
|
||||
default => "mpeg4",
|
||||
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 MPEG-4 or H264, change this to MJPEG. 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|mjpeg", pattern=>qr|^([mh][pj2])|i, format=>q( ($1 =~ /^mp/) ? "mpeg4" : ($1 =~ /^h/ ? "h264" : "mjpeg" ) ) },
|
||||
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+).",
|
||||
type => { db_type=>"string", hint=>"mpeg4|h264", pattern=>qr|^([mh])|i, format=>q( $1 =~ /^m/ ? "mpeg4" : "h264" ) },
|
||||
category => "XML",
|
||||
},
|
||||
{
|
||||
|
@ -1742,6 +1742,14 @@ body = "ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% s
|
|||
type => $types{string},
|
||||
category => "XML",
|
||||
},
|
||||
{
|
||||
name => "ZM_XML_H264_DEFAULT_EVBR",
|
||||
default => "128k",
|
||||
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.",
|
||||
type => $types{string},
|
||||
category => "XML",
|
||||
},
|
||||
{
|
||||
name => "ZM_XML_H264_TIMEOUT",
|
||||
default => "20",
|
||||
|
|
|
@ -194,11 +194,12 @@
|
|||
#define ZM_XML_EVENT_VCODEC 190
|
||||
#define ZM_XML_FEED_VCODEC 191
|
||||
#define ZM_XML_H264_DEFAULT_BR 192
|
||||
#define ZM_XML_H264_TIMEOUT 193
|
||||
#define ZM_XML_SEG_DURATION 194
|
||||
#define ZM_XML_H264_DEFAULT_EVBR 193
|
||||
#define ZM_XML_H264_TIMEOUT 194
|
||||
#define ZM_XML_SEG_DURATION 195
|
||||
|
||||
|
||||
#define ZM_MAX_CFG_ID 194
|
||||
#define ZM_MAX_CFG_ID 195
|
||||
|
||||
#define ZM_CFG_DECLARE_LIST \
|
||||
const char *lang_default;\
|
||||
|
@ -394,6 +395,7 @@
|
|||
const char *xml_event_vcodec;\
|
||||
const char *xml_feed_vcodec;\
|
||||
const char *xml_h264_default_br;\
|
||||
const char *xml_h264_default_evbr;\
|
||||
const char *xml_h264_timeout;\
|
||||
const char *xml_seg_duration;\
|
||||
|
||||
|
@ -592,6 +594,7 @@
|
|||
xml_event_vcodec = (const char *)config.Item( ZM_XML_EVENT_VCODEC );\
|
||||
xml_feed_vcodec = (const char *)config.Item( ZM_XML_FEED_VCODEC );\
|
||||
xml_h264_default_br = (const char *)config.Item( ZM_XML_H264_DEFAULT_BR );\
|
||||
xml_h264_default_evbr = (const char *)config.Item( ZM_XML_H264_DEFAULT_EVBR );\
|
||||
xml_h264_timeout = (const char *)config.Item( ZM_XML_H264_TIMEOUT );\
|
||||
xml_seg_duration = (const char *)config.Item( ZM_XML_SEG_DURATION );\
|
||||
|
||||
|
|
|
@ -174,7 +174,6 @@ if (isset($_GET['action'])) {
|
|||
$vcodec = getset('vcodec', ZM_XML_EVENT_VCODEC);
|
||||
$baseURL = ZM_PATH_WEB."/".getEventPathSafe($event);
|
||||
/* Here we validate the codec.
|
||||
* MJPEG doesn't require any validation.
|
||||
* MPEG-4 requires canGenerateMpeg4 and v1.1
|
||||
* H264 requires canGenerateH264 and v1.2 */
|
||||
if (!strcmp($vcodec, "mpeg4")) {
|
||||
|
@ -203,10 +202,6 @@ if (isset($_GET['action'])) {
|
|||
getset('br',ZM_XML_H264_DEFAULT_EVBR),
|
||||
$baseURL."/".$fname);
|
||||
|
||||
} else if (!strcmp($vcodec, "mjpeg")) {
|
||||
logXml("Selected MJPEG for viewing event ".$event['Id']);
|
||||
$fname = "capture.mov";
|
||||
$ffparms = "-vcodec mjpeg -r ".ZM_XML_EVENT_FPS." ".$baseURL."/".$fname.(ZM_XML_DEBUG?"":" 2> /dev/null");
|
||||
} else {
|
||||
logXmlErr("Unknown codec ".$vcodec." selected for event viewing");
|
||||
exit;
|
||||
|
|
Loading…
Reference in New Issue