<?php/* Usage: tc2vfr.php <timecodes_file> <decimated_avi> <desired_framerate> Info: This script will create a onstant framerate AviSynth script from a timecodes v1 file, etc. Notes: Timcodes file must have the tio comment, assume statement, no more than one blank line at the bottom, and NO extra comments. */$lines = file($argv[1]);$avi = $argv[2];$afps = $argv[3];/* Find out what framerate is assumed. */$assumed = rtrim(substr($lines[1],7));/* Set up the first part of the AviSynth script. */echo "avi = avisource(\"$avi\")\r\n";echo "cfr = avi.trim(0,";/* Go through every line and figure shit out. */foreach ($lines as $line_num => $line){ if ($line_num > 1) { $array = explode(',', $line); $m1 = $array[0]-1; $a1 = $array[1]+1; if ($m1=='-1') { $m1=1; } $vfps = rtrim($array[2]); echo "$m1).assumefps($assumed).changefps($assumed)+avi.trim(".$array[0].",".$array[1].").assumefps($vfps).changefps($assumed)+avi.trim($a1,"; }}/* Finish off the script */echo "0).assumefps($assumed)\r\n";$m1 = $array[0]-1;if ($m1=='-1'){ echo "return cfr.trim(1,0).changefps($afps)";}else{ echo "return cfr.changefps($afps)";}?>