Created
November 29, 2014 01:58
-
-
Save codeliger/7f3825db76005026a9f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Total Frames | |
$tfr = $argv[1]; | |
// Frames Per Second | |
$fps = $argv[2]; | |
// Key-frame Interval | |
$kfi = $argv[3]; | |
// Total Key Frames | |
$tkf = ($tfr - ($tfr % $kfi) ) / $kfi; | |
// Elapsed Time | |
$eti = ( $tfr - ($tfr % $fps) ) / $fps; | |
echo "\n"; | |
echo "Total Frame Count : $tfr\n"; | |
echo "Key-frame Interval : $kfi\n"; | |
echo "Frames Per Second : $fps\n"; | |
echo "Total Run Time : $eti Seconds\n"; | |
echo "Total Key-frames : $tkf\n"; | |
echo "\n"; | |
for($i = 1; $i <= $tfr; $i++){ | |
$pad = str_pad($i, strlen($tfr), "0", STR_PAD_LEFT); | |
if( !($i % $kfi) ) | |
echo "F$pad [X]"; | |
else | |
echo "F$pad [ ]"; | |
echo ($i % $fps == 0) ? "\n" : null; | |
} | |
echo "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage php keyframe-analyser.php [frames] [fps] [key-frames]