From: Alex Sadleir Date: Tue, 25 Dec 2012 02:10:01 +0000 Subject: hourly/convo ffmpeg generrators X-Git-Url: http://maxious.lambdacomplex.org/git/?p=scannr.git&a=commitdiff&h=8d7b3ae18aa4678cf07f988bdb6bcc72f938c5e4 --- hourly/convo ffmpeg generrators --- --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,6 +2,7 @@ + @@ -9,13 +10,13 @@ - + @@ -37,13 +38,14 @@ - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -144,6 +173,7 @@ @@ -151,7 +181,7 @@ @@ -209,8 +239,8 @@ + - + + + + + + + + + @@ -265,21 +318,21 @@ - - + + - + - + @@ -349,90 +402,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + --- a/generateConvos.php +++ b/generateConvos.php @@ -1,4 +1,5 @@ prepare('select * from recordings limit 100;'); --- /dev/null +++ b/generateHourlys.php @@ -1,1 +1,24 @@ +prepare("select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, count(filename), array_to_string(array_agg(filename), ',') filenames from recordings group by tgid, ahour, aday order by aday DESC, ahour, tgid;"); +$sth->execute(); +$hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); +foreach($hourlies as $hourly) { + $filename = $hourly['tgid'].'-'.str_replace(' 00:00:00+1','',$hourly['aday']).'-'.$hourly['ahour'].'.3gp'; + + if(!file_exists("hourly/".$filename)) { + + $filenames = explode(",",$hourly['filenames']); + $cmd = "/usr/local/bin/ffmpeg -i data/".implode(" -i data/",$filenames)." -ar 8000 -ab 4.75k -ac 1 hourly/".$filename . ' 2>&1'; + //print_r($hourly); + exec ( $cmd,$output,$returncode ); + echo $cmd.'
'; + if ($returncode != 10) { + //print_r($output); + //die(); + } + } +} + +