diff --git a/scripts/zmvideo.pl.in b/scripts/zmvideo.pl.in index dcb3633fb..17212bee2 100644 --- a/scripts/zmvideo.pl.in +++ b/scripts/zmvideo.pl.in @@ -203,19 +203,17 @@ if ( $event_id ) { $concat_name = $filter_name if $concat_name eq ''; } -my $sql = " SELECT max(F.Delta)-min(F.Delta) as FullLength, - E.*, - unix_timestamp(E.StartTime) as Time, +my $sql = " SELECT (SELECT max(Delta) FROM Frames WHERE EventId=Events.Id)-(SELECT min(Delta) FROM Frames WHERE EventId=Events.Id) as FullLength, + Events.*, + unix_timestamp(Events.StartTime) as Time, M.Name as MonitorName, M.Width as MonitorWidth, M.Height as MonitorHeight, M.Palette - FROM Frames as F - INNER JOIN Events as E on F.EventId = E.Id - INNER JOIN Monitors as M on E.MonitorId = M.Id - WHERE EventId = ? - GROUP BY F.EventId" - ; + FROM Events + INNER JOIN Monitors as M on Events.MonitorId = M.Id + WHERE Events.Id = ? + "; my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() ); Debug($sql); diff --git a/web/includes/functions.php b/web/includes/functions.php index 0f0441d38..586e1829a 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1043,7 +1043,9 @@ function createVideo( $event, $format, $rate, $scale, $overwrite=false ) { $command .= " -s ".sprintf( "%.2f", ($scale/SCALE_BASE) ); if ( $overwrite ) $command .= " -o"; - $result = exec( escapeshellcmd( $command ), $output, $status ); + $command = escapeshellcmd( $command ); + $result = exec( $command, $output, $status ); +Debug("generating Video $command: result($result outptu:(".implode("\n", $output )." status($status"); return( $status?"":rtrim($result) ); }