From 54befcd015ad339ee4017bedd4226d85ed2b075a Mon Sep 17 00:00:00 2001 From: stan Date: Sun, 14 Mar 2004 23:27:36 +0000 Subject: [PATCH] Adjusted some options and added video format options. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@956 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_event.cpp | 2 +- src/zm_monitor.cpp | 2 +- web/zm_actions.php | 3 +- web/zm_html.php | 2 +- web/zm_html_view_event.php | 10 ++--- web/zm_html_view_montagefeed.php | 10 ++--- web/zm_html_view_options.php | 3 +- web/zm_html_view_watchfeed.php | 10 ++--- web/zm_lang_de_de.php | 1 + web/zm_lang_en_gb.php | 1 + web/zm_lang_fr_fr.php | 1 + web/zm_lang_ja_jp.php | 1 + web/zm_lang_pl_pl.php | 1 + web/zm_lang_ru_ru.php | 1 + zmconfig.pl.in | 70 ++++++++++++++++++++------------ 15 files changed, 72 insertions(+), 46 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 534614d53..17e4d170a 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -488,7 +488,7 @@ void Event::StreamMpeg( int event_id, const char *format, int bitrate, int maxfp static char sql[BUFSIZ]; static char eventpath[PATH_MAX]; - bool timed_frames = (bool)config.Item( ZM_WEB_VIDEO_TIMED_FRAMES ); + bool timed_frames = (bool)config.Item( ZM_VIDEO_TIMED_FRAMES ); sprintf( sql, "select M.Id, M.Name, E.Length, E.Frames from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = %d", event_id ); if ( mysql_query( &dbconn, sql ) ) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index fee405cc2..7785a8eda 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1177,7 +1177,7 @@ void Monitor::StreamMpeg( const char *format, int bitrate, int maxfps, int scale } fprintf( stdout, "Content-type: %s\r\n\r\n", mime_type ); - bool timed_frames = (bool)config.Item( ZM_WEB_VIDEO_TIMED_FRAMES ); + bool timed_frames = (bool)config.Item( ZM_VIDEO_TIMED_FRAMES ); int fps = int(GetFPS()); if ( !fps ) diff --git a/web/zm_actions.php b/web/zm_actions.php index 885160837..db58d1657 100644 --- a/web/zm_actions.php +++ b/web/zm_actions.php @@ -471,7 +471,7 @@ if ( isset($action) ) { case "system" : case "paths" : - case "video" : + case "config" : case "network" : case "x10" : case "mail" : @@ -479,6 +479,7 @@ if ( isset($action) ) $restart = true; break; case "web" : + case "video" : case "tools" : case "highband" : case "medband" : diff --git a/web/zm_html.php b/web/zm_html.php index b61c3ecac..a6e125d42 100644 --- a/web/zm_html.php +++ b/web/zm_html.php @@ -67,7 +67,7 @@ $bw_array = array( "low"=>$zmSlangLow ); -if ( ZM_WEB_VIDEO_STREAM_METHOD == 'mpeg' ) +if ( ZM_VIDEO_STREAM_METHOD == 'mpeg' ) { $rates = array( "10000" => "100x", diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php index 248ef8433..7143bd954 100644 --- a/web/zm_html_view_event.php +++ b/web/zm_html_view_event.php @@ -263,9 +263,9 @@ if ( $mode == "stream" ) ?> -" + @@ -289,7 +289,7 @@ type="application/x-oleobject"> ?> " +SRC="" name="MediaPlayer1" width= height= @@ -302,7 +302,7 @@ AutoStart=true> { ?> " +src="" width= height= AutoStart=true> diff --git a/web/zm_html_view_montagefeed.php b/web/zm_html_view_montagefeed.php index f732438fb..da1a34db2 100644 --- a/web/zm_html_view_montagefeed.php +++ b/web/zm_html_view_montagefeed.php @@ -102,9 +102,9 @@ window.setTimeout( "window.location.reload(true)", ); -" + @@ -128,7 +128,7 @@ type="application/x-oleobject"> ?> " +SRC="" name="MediaPlayer1" width= height= @@ -141,7 +141,7 @@ AutoStart=true> { ?> " +src="" width= height= AutoStart=true> diff --git a/web/zm_html_view_options.php b/web/zm_html_view_options.php index ab1611c86..eead1ffc6 100644 --- a/web/zm_html_view_options.php +++ b/web/zm_html_view_options.php @@ -27,9 +27,10 @@ if ( !canView( 'System' ) ) $tabs = array(); $tabs['system'] = $zmSlangSystem; $tabs['paths'] = $zmSlangPaths; -$tabs['video'] = $zmSlangVideo; +$tabs['config'] = $zmSlangConfig; $tabs['network'] = $zmSlangNetwork; $tabs['web'] = $zmSlangWeb; +$tabs['video'] = $zmSlangVideo; $tabs['mail'] = $zmSlangEmail; $tabs['ftp'] = $zmSlangFTP; $tabs['x10'] = $zmSlangX10; diff --git a/web/zm_html_view_watchfeed.php b/web/zm_html_view_watchfeed.php index fd8b25018..6ec46d472 100644 --- a/web/zm_html_view_watchfeed.php +++ b/web/zm_html_view_watchfeed.php @@ -99,9 +99,9 @@ window.setTimeout( "window.location.reload(true)", ); -" + @@ -125,7 +125,7 @@ type="application/x-oleobject"> ?> " +SRC="" name="MediaPlayer1" width= height= @@ -138,7 +138,7 @@ AutoStart=true> { ?> " +src="" width= height= AutoStart=true> diff --git a/web/zm_lang_de_de.php b/web/zm_lang_de_de.php index 03672a421..7b22cff19 100644 --- a/web/zm_lang_de_de.php +++ b/web/zm_lang_de_de.php @@ -124,6 +124,7 @@ $zmSlangCheckMethod = 'Alarm Check Methode'; $zmSlangChooseFilter = 'Filterauswahl'; $zmSlangClose = 'Schlieen'; $zmSlangColour = 'Farbe'; +$zmSlangConfig = 'Config'; $zmSlangConfiguredFor = 'Eingerichtet fr'; $zmSlangConfirmPassword = 'Passwortbesttigung'; $zmSlangConjAnd = 'und'; diff --git a/web/zm_lang_en_gb.php b/web/zm_lang_en_gb.php index e0e3a2589..27cd5fd78 100644 --- a/web/zm_lang_en_gb.php +++ b/web/zm_lang_en_gb.php @@ -124,6 +124,7 @@ $zmSlangCheckMethod = 'Alarm Check Method'; $zmSlangChooseFilter = 'Choose Filter'; $zmSlangClose = 'Close'; $zmSlangColour = 'Colour'; +$zmSlangConfig = 'Config'; $zmSlangConfiguredFor = 'Configured for'; $zmSlangConfirmPassword = 'Confirm Password'; $zmSlangConjAnd = 'and'; diff --git a/web/zm_lang_fr_fr.php b/web/zm_lang_fr_fr.php index f76383959..6d3262f75 100644 --- a/web/zm_lang_fr_fr.php +++ b/web/zm_lang_fr_fr.php @@ -124,6 +124,7 @@ $zmSlangCheckMethod = 'M $zmSlangChooseFilter = 'Choisir filtre'; $zmSlangClose = 'Fermer'; $zmSlangColour = 'Couleur'; +$zmSlangConfig = 'Config'; $zmSlangConfiguredFor = 'Configur pour'; $zmSlangConfirmPassword = 'Confirmer mt de pass.'; $zmSlangConjAnd = 'et'; diff --git a/web/zm_lang_ja_jp.php b/web/zm_lang_ja_jp.php index 2937a5771..b42363af3 100644 --- a/web/zm_lang_ja_jp.php +++ b/web/zm_lang_ja_jp.php @@ -124,6 +124,7 @@ $zmSlangCheckMethod = ' $zmSlangChooseFilter = '̨̑I'; $zmSlangClose = '‚'; $zmSlangColour = 'F'; +$zmSlangConfig = 'Config'; $zmSlangConfiguredFor = 'ݒ:'; $zmSlangConfirmPassword = '߽ܰނ̊mF'; $zmSlangConjAnd = 'y'; diff --git a/web/zm_lang_pl_pl.php b/web/zm_lang_pl_pl.php index 1978af785..3ce20a907 100644 --- a/web/zm_lang_pl_pl.php +++ b/web/zm_lang_pl_pl.php @@ -125,6 +125,7 @@ $zmSlangCheckMethod = 'Metoda sprawdzenia alarmu'; $zmSlangChooseFilter = 'Wybierz filtr'; $zmSlangClose = 'Zamknij'; $zmSlangColour = 'Nasycenie'; +$zmSlangConfig = 'Config'; $zmSlangConfiguredFor = 'Ustawiona'; $zmSlangConfirmPassword = 'Potwierd haso'; $zmSlangConjAnd = 'i'; diff --git a/web/zm_lang_ru_ru.php b/web/zm_lang_ru_ru.php index 75a38566b..c49c60bd8 100644 --- a/web/zm_lang_ru_ru.php +++ b/web/zm_lang_ru_ru.php @@ -125,6 +125,7 @@ $zmSlangCheckMethod = ' $zmSlangChooseFilter = ' '; $zmSlangClose = ''; $zmSlangColour = ''; +$zmSlangConfig = 'Config'; $zmSlangConfiguredFor = ' '; $zmSlangConfirmPassword = ' '; $zmSlangConjAnd = ''; diff --git a/zmconfig.pl.in b/zmconfig.pl.in index a8c301022..9171d1bd8 100755 --- a/zmconfig.pl.in +++ b/zmconfig.pl.in @@ -244,6 +244,14 @@ my @options = type => $types{rel_path}, category => 'paths', }, + { + name => "ZM_CAN_STREAM", + default => "auto", + description => "Override the automatic detection of browser streaming capability", + help => "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 => 'tools', + }, { name => "ZM_OPT_CAMBOZOLA", default => "no", @@ -261,21 +269,13 @@ my @options = type => $types{rel_path}, category => 'tools', }, - { - name => "ZM_CAN_STREAM", - default => "auto", - description => "Override the automatic detection of browser streaming capability", - help => "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 => 'tools', - }, { name => "ZM_TIMESTAMP_ON_CAPTURE", default => "yes", description => "Timestamp images as soon as they are captured", help => "ZoneMinder can add a timestamp to images in two ways. The default method, when this option is set, is that each image is timestamped immediately when captured and so the image held in memory is marked right away. The second method does not timestamp the images until they are either saved as part of an event or accessed over the web. The timestamp used in both methods will contain the same time as this is preserved along with the image. The first method ensures that an image is timestamped regardless of any other circumstances but will result in all images being timestamped even those never saved or viewed. The second method necessitates that saved images are copied before being saved otherwise two timestamps perhaps at different scales may be applied. This has the (perhaps) desirable side effect that the timestamp is always applied at the same resolution so an image that has scaling applied will still have a legible and correctly scaled timestamp.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_LOCAL_BGR_INVERT", @@ -283,7 +283,7 @@ my @options = description => "Invert BGR colours to RGB", help => "Some cameras or video cards capture images in BGR (Blue-Green-Red) order even when the palette says RGB. If you see strange colours casts on your images then it may be worth trying this option to see if that corrects the issue. Note this option will apply only to local cameras and not those over a network.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_Y_IMAGE_DELTAS", @@ -291,7 +291,7 @@ my @options = description => "Whether we calculate images differences using Y channel", help => "When ZoneMinder tries to establish the differences between two colour images it generates a greyscale 'delta' image between the two sets of images. In order to do this it determines the differences found between the different RGB colour components and calculates a greyscale value representing this. If this option is set then a calculation will be made to convert each pixel of the image into a brightness value (Y from YUV) and then find the difference between the two. If this option is not set then the resulting difference is determined as the average of the differences of each colour which is a simple calculation. Using the Y value is likely to be more accurate and is up to 15% faster. Only switch this option off if Y based deltas do not work as well for you as RGB ones.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_FAST_IMAGE_BLENDS", @@ -299,7 +299,7 @@ my @options = description => "Whether we use a fast algorithm to blend the reference image", help => "In most modes of operation ZoneMinder needs to blend the captured image with the stored reference image to update it for the next image. The reference blend percentage specified for the monitor controls how much the new image affects the reference image. There are two methods that are available for this. If this option is set then a basic calculation is applied which though fast and fairly accurate can (due to rounding) mean that the actual range of pixel values in the reference image may be reduced from that in the captured image, e.g. a pixel may only be able to achieve a maximum of say 250 while the captured image is consistently at 255. If you also have a small minimum pixel difference threshold this can cause multiple bogus alarms. The alternative is to switch this option off which stores an additional set of temporary values which eliminate any significant rounding errors. This is more accurate though up to 6 times slower and should not really be necessary unless you find problems with the default method.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_COLOUR_JPEG_FILES", @@ -307,7 +307,7 @@ my @options = description => "Colourise greyscale JPEG files", help => "Cameras that capture in greyscale can write their captured images to jpeg files with a corresponding greyscale colour space. This saves a small amount of disk space over colour ones. However some tools such as ffmpeg and mpeg_encode either fail to work with this colour space or have to convert it beforehand. Setting this option to yes uses up a little more space but makes creation of MPEG files much faster.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_JPEG_FILE_QUALITY", @@ -315,7 +315,7 @@ my @options = description => "Set the JPEG quality setting for the saved event files (1-100)", help => "When ZoneMinder detects an event it will save the images associated with that event to files. These files are in the JPEG format and can be viewed or streamed later. This option specifies what image quality should be used to save these files. A higher number means better quality but less compression so will take up more disk space and take longer to view over a slow connection. By contrast a low number means smaller, quicker to view, files but at the price of lower quality images.", type => $types{integer}, - category => 'video', + category => 'config', }, { name => "ZM_JPEG_IMAGE_QUALITY", @@ -323,7 +323,7 @@ my @options = description => "Set the JPEG quality setting for the streamed 'live' images (1-100)", help => "When viewing a 'live' stream for a monitor ZoneMinder will grab an image from the buffer and encode it into JPEG format before sending it. This option specifies what image quality should be used to encode these images. A higher number means better quality but less compression so will take longer to view over a slow connection. By contrast a low number means quicker to view files but at the price of lower quality images. This option does not apply when viewing still images as these are just read from disk and so will be encoded at the quality specified by the previous option.", type => $types{integer}, - category => 'video', + category => 'config', }, { name => "ZM_BLEND_ALARMED_IMAGES", @@ -331,7 +331,7 @@ my @options = description => "Whether alarmed images are blended to update the reference image", help => "To detect alarms ZoneMinder compares an image with a reference image which is formed from a composite of the previous images. This option determines whether images that cause events are included in this process. Doing so may increase the precision of the alarmed region but can cause problems if wholescale lighting changes cause alarms as this would not get fed back into the image and an alarm may persist indefinately. A better way to achive the same effect in most cases is to lower substantially the reference blend persentage in specific monitors..", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_NO_MAX_FPS_ON_ALARM", @@ -339,7 +339,7 @@ my @options = description => "Should any Maximum FPS be ignored if an alarm occurs", help => "When configuring monitors you can optionally specify a maximum setting for the capture rate rate in frames per second. This can used to limit your video or network bandwidth or reduce CPU load. This setting tells ZoneMinder to ignore these constraints if an alarm is detected an attempt to capture as fast as possible.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_OPT_ADAPTIVE_SKIP", @@ -347,7 +347,7 @@ my @options = description => "Should frame analysis try and be efficient in skipping frames", help => "In previous versions of ZoneMinder the analysis daemon would attempt to keep up with the capture daemon by processing the last captured frame on each pass. This would sometimes have the undesirable side-effect of missing a chunk of the initial activity that caused the alarm because the pre-alarm frames would all have to be written to disk and the database before processing the next frame, leading to some delay between the first and second event frames. Setting this option enables a newer adaptive algorithm where the analysis daemon attempts to process as many captured frames as possible, only skipping frames when in danger of the capture daemon overwriting yet to be processed frames. This skip is variable depending on the size of the ring buffer and the amount of space left in it. Enabling this option will give you much better coverage of the beginning of alarms whilst biasing out any skipped frames towards the middle or end of the event. However you should be aware that this will have the effect of making the analysis daemon run somewhat behind the capture daemon during events and for particularly fast rates of capture it is possible for the adaptive algorithm to be overwhelmed and not have time to react to a rapid build up of pending frames and thus for a buffer overrun condition to occur.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_OPT_REMOTE_CAMERAS", @@ -453,21 +453,39 @@ my @options = category => 'paths', }, { - name => "ZM_WEB_VIDEO_STREAM_METHOD", + name => "ZM_VIDEO_STREAM_METHOD", default => "jpeg", description => "Which method should be used to send video streams to your browser, choose 'mpeg' or 'jpeg'", help => "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 => 'web', + category => 'video', }, { - name => "ZM_WEB_VIDEO_TIMED_FRAMES", + name => "ZM_VIDEO_TIMED_FRAMES", default => "yes", description => "Whether video frames are sent tagged with a timestamp for more realistic streaming", help => "When using streamed MPEG based video, either for live monitor streams or events, ZoneMinder can send the streams in two ways. If this option is selected then the timestamp for each frame, taken from it's capture time, is included in the stream. This means that where the frame rate varies, for instance around an alarm, the stream will still maintain it's 'real' timing. If this option is not selected then an approximate frame rate is calculated and that is used to schedule frames instead. This option should be selected unless you encounter problems with your preferred streaming method.", - requires => [ { name=>"ZM_WEB_VIDEO_STREAM_METHOD", value=>"mpeg" } ], + requires => [ { name=>"ZM_VIDEO_STREAM_METHOD", value=>"mpeg" } ], type => $types{boolean}, - category => 'web', + category => 'video', + }, + { + name => "ZM_VIDEO_LIVE_FORMAT", + default => "asf", + description => "What format 'live' video streams are played in", + help => "When using MPEG mode ZoneMinder can output live video. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player but I'm currently not sure what, if anything, works on a Linux platform. If you find out please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + requires => [ { name=>"ZM_VIDEO_STREAM_METHOD", value=>"mpeg" } ], + type => $types{string}, + category => 'video', + }, + { + name => "ZM_VIDEO_REPLAY_FORMAT", + default => "asf", + description => "What format 'replay' video streams are played in", + help => "When using MPEG mode ZoneMinder can replay events in encoded video format. However what formats are handled by the browser varies greatly between machines. This option allows you to specify a video format using a file extension format, so you would just enter the extension of the file type you would like and the rest is determined from that. The default of 'asf' works well under Windows with Windows Media Player and 'mpg', or 'avi' etc should work under Linux. If you knwo any more then please let me know! If this option is left blank then live streams will revert to being in motion jpeg format", + requires => [ { name=>"ZM_VIDEO_STREAM_METHOD", value=>"mpeg" } ], + type => $types{string}, + category => 'video', }, { name => "ZM_WEB_DEFAULT_SCALE", @@ -583,7 +601,7 @@ my @options = description => "Whether to allow errors in setting video config to be fatal", help => "With some video devices errors can be reported in setting the various video attributes when in fact the operation was successful. Switching this option off will still allow these errors to be reported but will not cause them to kill the video capture daemon. Note however that doing this will cause all errors to be ignored including those which are genuine and which may cause the video capture to not function correctly. Use this option with caution.", type => $types{boolean}, - category => 'video', + category => 'config', }, { name => "ZM_SHM_KEY", @@ -833,7 +851,7 @@ my @options = description => "Score to give forced alarms", help => "The 'zmu' utility can be used to force an alarm on a monitor rather than rely on the motion detection algorithms. This option determines what score to give these alarms to distinguish them from regular ones. It must be 255 or less.", type => $types{integer}, - category => 'video', + category => 'config', }, { name => "ZM_BULK_FRAME_INTERVAL", @@ -841,7 +859,7 @@ my @options = description => "How often a bulk frame should be written to the database", help => "Traditionally ZoneMinder writes an entry into the Frames database table for each frame that is captured and saved. This works well in motion detection scenarios but when in a DVR situation ('Record' or 'Mocord' mode) this results in a huge number of frame writes and a lot of database and disk bandwidth for very little additional information. Setting this to a non-zero value will enabled ZoneMinder to group these non-alarm frames into one 'bulk' frame entry which saves a lot of bandwidth and space. The only disadvantage of this is that timing information for individual frames is lost but in constant frame rate situations this is usually not significant. This setting is ignored in Modect mode and individual frames are still written if an alarm occurs in Mocord mode also.", type => $types{integer}, - category => 'video', + category => 'config', }, { name => "ZM_RECORD_EVENT_STATS",