+ + +">" class=""/> + +
1 ) { ?> diff --git a/web/skins/classic/views/image-ffmpeg.php b/web/skins/classic/views/image-ffmpeg.php new file mode 100644 index 000000000..082c75099 --- /dev/null +++ b/web/skins/classic/views/image-ffmpeg.php @@ -0,0 +1,76 @@ +$fid, 'Type'=>'Normal', 'Score'=>0 ); +} else { + $frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventId = ? AND Score = ?', NULL, array( $eid, $event['MaxScore'] ) ); +} + +$maxFid = $event['Frames']; + +$firstFid = 1; +$prevFid = $frame['FrameId']-1; +$nextFid = $frame['FrameId']+1; +$lastFid = $maxFid; + +$alarmFrame = $frame['Type']=='Alarm'; + +if ( isset( $_REQUEST['scale'] ) ) + $scale = validInt($_REQUEST['scale']); +else + $scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); + +$Transpose = ''; +if ( $event['VideoWriter'] == "2" ) { + $Rotation = $event['Orientation']; +// rotate right + if ( in_array($event['Orientation'],array("90"))) + $Transpose = 'transpose=1,'; +// rotate 180 // upside down cam + if ( in_array($event['Orientation'],array("180"))) + $Transpose = 'transpose=2,transpose=2,'; +// rotate left + if ( in_array($event['Orientation'],array("270"))) + $Transpose = 'transpose=2,'; +} +$focusWindow = true; +$Scale = 100/$scale; +$fid = $fid - 1; +#$command = 'ffmpeg -v 0 -i '.getEventDefaultVideoPath($event).' -vf "select=gte(selected_n\,'.$fid.'),setpts=PTS-STARTPTS" '.$Transpose.',scale=iw/'.$Scale.':-1" -frames:v 1 -f mjpeg -'; +$command = 'ffmpeg -v 0 -i '.getEventDefaultVideoPath($event).' -vf "select=gte(n\\,'.$fid.'),setpts=PTS-STARTPTS,'.$Transpose.'scale=iw/'.$Scale.':-1" -f image2 -'; +header('Content-Type: image/jpeg'); +system($command); +?>