diff --git a/src/zm_zone.cpp b/src/zm_zone.cpp index 5d5ae41cd..013b8823f 100644 --- a/src/zm_zone.cpp +++ b/src/zm_zone.cpp @@ -943,6 +943,7 @@ bool Zone::ParseZoneString( const char *zone_string, int &zone_id, int &colour, int Zone::Load( Monitor *monitor, Zone **&zones ) { +<<<<<<< HEAD static char sql[ZM_SQL_MED_BUFSIZ]; snprintf( sql, sizeof(sql), "select Id,Name,Type+0,Units,Coords,AlarmRGB,CheckMethod+0,MinPixelThreshold,MaxPixelThreshold,MinAlarmPixels,MaxAlarmPixels,FilterX,FilterY,MinFilterPixels,MaxFilterPixels,MinBlobPixels,MaxBlobPixels,MinBlobs,MaxBlobs,OverloadFrames,ExtendAlarmFrames from Zones where MonitorId = %d order by Type, Id", monitor->Id() ); if ( mysql_query( &dbconn, sql ) ) @@ -995,17 +996,18 @@ int Zone::Load( Monitor *monitor, Zone **&zones ) Polygon polygon; if ( !ParsePolygonString( Coords, polygon ) ) { Error( "Unable to parse polygon string '%s' for zone %d/%s for monitor %s, ignoring", Coords, Id, Name, monitor->Name() ); + n_zones -= 1; continue; } if ( polygon.LoX() < 0 || polygon.HiX() >= (int)monitor->Width() || polygon.LoY() < 0 || polygon.HiY() >= (int)monitor->Height() ) { Error( "Zone %d/%s for monitor %s extends outside of image dimensions, (%d,%d), (%d,%d), ignoring", Id, Name, monitor->Name(), polygon.LoX(), polygon.LoY(), polygon.HiX(), polygon.HiY() ); + n_zones -= 1; continue; } - if ( false && !strcmp( Units, "Percent" ) ) - { + if ( false && !strcmp( Units, "Percent" ) ) { MinAlarmPixels = (MinAlarmPixels*polygon.Area())/100; MaxAlarmPixels = (MaxAlarmPixels*polygon.Area())/100; MinFilterPixels = (MinFilterPixels*polygon.Area())/100; diff --git a/web/includes/functions.php b/web/includes/functions.php index 086f06c0d..57318cd22 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -831,9 +831,9 @@ function packageControl( $command ) { function daemonControl( $command, $daemon=false, $args=false ) { $string = ZM_PATH_BIN."/zmdc.pl $command"; if ( $daemon ) { - $string .= " $daemon"; + $string .= escapeshellarg(" $daemon"); if ( $args ) { - $string .= " $args"; + $string .= escapeshellarg(" $args"); } } $string .= " 2>/dev/null >&- <&- >/dev/null"; @@ -962,9 +962,9 @@ function zmaStatus( $monitor ) { function daemonCheck( $daemon=false, $args=false ) { $string = ZM_PATH_BIN."/zmdc.pl check"; if ( $daemon ) { - $string .= " $daemon"; + $string .= escapeshellarg(" $daemon"); if ( $args ) - $string .= " $args"; + $string .= escapeshellarg(" $args"); } $result = exec( $string ); return( preg_match( '/running/', $result ) ); @@ -1434,7 +1434,7 @@ function getDiskPercent($path = ZM_DIR_EVENTS) { function getDiskBlocks() { if ( ! $StorageArea ) $StorageArea = new Storage(); - $df = shell_exec( 'df '.$StorageArea->Path() ); + $df = shell_exec( 'df '.escapeshellarg($StorageArea->Path() )); $space = -1; if ( preg_match( '/\s(\d+)\s+\d+\s+\d+%/ms', $df, $matches ) ) $space = $matches[1]; diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php index 51825caae..5b0d912ed 100644 --- a/web/lang/en_gb.php +++ b/web/lang/en_gb.php @@ -618,6 +618,7 @@ $SLANG = array( 'Rewind' => 'Rewind', 'RotateLeft' => 'Rotate Left', 'RotateRight' => 'Rotate Right', + 'RTSPTransport' => 'RTSP Transport Protocol', 'RunLocalUpdate' => 'Please run zmupdate.pl to update', 'RunMode' => 'Run Mode', 'Running' => 'Running', @@ -909,6 +910,13 @@ $OLANG = array( "\"reorder_queue_size=nnn\" Set number of packets to buffer for handling of reordered packets~~~~". "\"loglevel=debug\" Set verbosity of FFmpeg (quiet, panic, fatal, error, warning, info, verbose, debug)" ), + 'OPTIONS_RTSPTrans' => array( + 'Help' => "This sets the RTSP Transport Protocol for FFmpeg.~~ ". + "TCP - Use TCP (interleaving within the RTSP control channel) as transport protocol.~~". + "UDP - Use UDP as transport protocol. Higher resolution cameras have experienced some 'smearing' while using UDP, if so try TCP~~". + "UDP Multicast - Use UDP Multicast as transport protocol~~". + "HTTP - Use HTTP tunneling as transport protocol, which is useful for passing proxies.~~" + ), 'OPTIONS_LIBVLC' => array( 'Help' => "Parameters in this field are passed on to libVLC. Multiple parameters can be separated by ,~~ ". "Examples (do not enter quotes)~~~~". diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index e6a09dfdc..700bbb431 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -210,8 +210,8 @@ $sourceTypes = array( 'Libvlc' => translate('Libvlc'), 'cURL' => "cURL (HTTP(S) only)" ); -if ( !ZM_HAS_V4L ) - unset($sourceTypes['Local']); + if ( !ZM_HAS_V4L ) + unset($sourceTypes['Local']); $localMethods = array( 'v4l2' => "Video For Linux version 2", @@ -234,6 +234,13 @@ if ( !ZM_HAS_V4L1 ) "rtpRtspHttp" => "RTP/RTSP/HTTP" ); + $rtspFFMpegMethods = array( + "rtpRtsp" => "TCP", + "rtpUni" => "UDP", + "rtpMulti" => "UDP Multicast", + "rtpRtspHttp" => "HTTP Tunnel" + ); + $httpMethods = array( "simple" => "Simple", "regexp" => "Regexp", @@ -790,23 +797,15 @@ switch ( $tab ) ?>