#!/mod/bin/jimsh package require cgi source /mod/webif/lib/setup require ts.class pretty_size header set rfile [cgi_get file] set ts [ts fetch $rfile] set dir [file dirname $rfile] # 45 minute chunks set max $(45 * 60) set len [$ts duration 1] set esttime $(int($len * 0.025)) if {[$ts get definition] eq "HD"} { set esttime $($esttime * 4) } puts "
Split recording into 45 minute segments " set bytesperminute $([$ts size] / ($len / 60)) while {$len > 0} { incr part incr len -$max puts "" } puts "
File:$rfile
Length:[clock format $len -format "%T"]
Size:[pretty_size [$ts size]] ([$ts get definition])
Time: Splitting will take around [clock format $esttime -format "%T"]
Part $part
waiting...
"