Some fixes pointed out by Maxim Romanov. Also simply the loading of events to not join the Monitors table

This commit is contained in:
Isaac Connor 2016-12-15 16:55:47 -05:00
parent f6c377c2b4
commit 46da2ff70b
2 changed files with 5 additions and 5 deletions

View File

@ -983,8 +983,8 @@ function getImageSrc( $event, $frame, $scale=SCALE_BASE, $captureOnly=false, $ov
if ( ! file_exists( $eventPath.'/'.$captImage ) ) {
# Generate the frame JPG
if ( $event['DefaultVideo'] ) {
$command ='ffmpeg -v 0 -i '.$eventPath.'/'.$Event->DefaultVideo().' -vf "select=gte(n\\,'.$frame['FrameId'].'),setpts=PTS-STARTPTS" '.$eventPath.'/'.$captImage;
system( $command, $output, $retval );
$command ='ffmpeg -v 0 -i '.$eventPath.'/'.$event['DefaultVideo'].' -vf "select=gte(n\\,'.$frame['FrameId'].'),setpts=PTS-STARTPTS" '.$eventPath.'/'.$captImage;
system( $command, $retval );
} else {
Error("Can't create frame images from video because there is no video file for this event " );
}

View File

@ -143,11 +143,11 @@ foreach( dbFetchAll( $monitorsSql ) as $row )
}
$rangeSql = "select min(E.StartTime) as MinTime, max(E.EndTime) as MaxTime from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(E.StartTime) and not isnull(E.EndTime)";
$eventsSql = "select E.Id,E.Name,E.StartTime,E.EndTime,E.Length,E.Frames,E.MaxScore,E.Cause,E.Notes,E.Archived,E.MonitorId from Events as E inner join Monitors as M on (E.MonitorId = M.Id) where not isnull(StartTime)";
$eventsSql = "select * from Events where not isnull(StartTime)";
if ( !empty($user['MonitorIds']) )
{
$monFilterSql = ' AND M.Id IN ('.$user['MonitorIds'].')';
$monFilterSql = ' AND MonitorId IN ('.$user['MonitorIds'].')';
$rangeSql .= $monFilterSql;
$eventsSql .= $monFilterSql;
@ -818,7 +818,7 @@ xhtmlHeaders(__FILE__, translate('Timeline') );
//crossorigin has to be added below to make caption work in chrome
?>
<video id="preview" width="100%" controls crossorigin="anonymous">
<source src="<?php echo "/events/".getEventPath($event)."/event.mp4"; ?>" type="video/mp4">
<source src="<?php echo getEventDefaultVideoPath($event); ?>" type="video/mp4">
Your browser does not support the video tag.
</video>