= 352 && $device_height >= 288 ) { $video_size = "352x288"; } elseif ( $device_width >= 176 && $device_height >= 144 ) { $video_size = "176x144"; } else { $video_size = "128x96"; } if ( !isset( $rate ) ) $rate = reScale( RATE_SCALE, $event['DefaultRate'], ZM_WEB_DEFAULT_RATE ); $event_dir = ZM_DIR_EVENTS."/".$event['MonitorId']."/".sprintf( "%d", $eid ); $video_formats = array(); $ffmpeg_formats = preg_split( '/\s+/', ZM_FFMPEG_FORMATS ); foreach ( $ffmpeg_formats as $ffmpeg_format ) { preg_match( '/^([^*]+)(\**)$/', $ffmpeg_format, $matches ); $video_formats[$matches[1]] = $matches[1]; if ( $matches[2] == '*' ) { $default_video_format = $matches[1]; } elseif ( $matches[2] == '**' ) { $default_phone_format = $matches[1]; } } if ( isset($default_phone_format) ) { $video_format = $default_phone_format; } elseif ( isset($default_video_format) ) { $video_format = $default_video_format; } else { $video_format = $ffmpeg_formats[0]; } if ( !empty($generate) ) { $command = ZM_PATH_BIN."/zmvideo.pl -e ".$event['Id']." -f ".$video_format." -r ".sprintf( "%.2f", ($rate/RATE_SCALE) )." -S ".$video_size; if ( $overwrite ) $command .= " -o"; $generated = exec( $command, $output, $status ); } $video_files = array(); if ( $dir = opendir( $event_dir ) ) { while ( ($file = readdir( $dir )) !== false ) { $file = $event_dir.'/'.$file; if ( is_file( $file ) ) { if ( preg_match( '/-S([\da-z]+)\.(?:'.join( '|', $video_formats ).')$/', $file, $matches ) ) { if ( $matches[1] == $video_size ) { $video_files[] = $file; } } } } closedir( $dir ); } if ( isset($download) ) { header( "Content-disposition: attachment; filename=".$video_files[$download]."; size=".filesize($video_files[$download]) ); readfile( $video_files[$download] ); exit; } ?> <?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangVideo ?> - <?= $event['Name'] ?>
checked>

0 ) { $index = 0; foreach ( $video_files as $file ) { preg_match( '/^(.+)-((?:r[_\d]+)|(?:F[_\d]+))-((?:s[_\d]+)|(?:S[0-9a-z]+))\.([^.]+)$/', $file, $matches ); if ( preg_match( '/^r(.+)$/', $matches[2], $temp_matches ) ) { $rate = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); $rate_text = isset($rates[$rate])?$rates[$rate]:($rate."x"); } elseif ( preg_match( '/^F(.+)$/', $matches[2], $temp_matches ) ) { $rate_text = $temp_matches[1]."fps"; } if ( preg_match( '/^s(.+)$/', $matches[3], $temp_matches ) ) { $scale = (int)(100 * preg_replace( '/_/', '.', $temp_matches[1] ) ); $scale_text = isset($scales[$scale])?$scales[$scale]:($scale."x"); } elseif ( preg_match( '/^S(.+)$/', $matches[3], $temp_matches ) ) { $scale_text = $temp_matches[1]; } ?>
/