ffmpeg.php 1.26 KB
<?php
ini_set( "max_execution_time", "3600" );
function converttoflv( $in, $out )
{
 /*
//exec("$config[ffmpeg] -i $config[vdodir]/$vdoname -acodec mp3 -ar 22050 -ab 32 -f flv $config[flvdodir]/".$vid.".flv");
  @unlink( $out );

  $cmd = "ffmpeg -v 0 -i $in -ar 22050 $out 2>&1";
  //$cmd = "ffmpeg -i $in -ar 22050 -ab 32 -f flv -s 320x240 $out";
  //exec($cmd);
  $fh = popen( $cmd, "r" );

  while( !feof($fh) )
  {
    $output = fgets($fh, 256);
    print_r($output);
  }
  pclose( $fh );   print $in;
exit;  */
move_uploaded_file($in, $out);
}

function flv_import( $upfile, $path )
{
  //$fname = preg_replace( '/\..*$/', '', basename( $fname ) );
  $fname = mktime();
  $flvpath = "$fname.flv";
  $thumbpath = "$fname.gif";
//print $path . $flvpath; exit;
  converttoflv( $upfile['tmp_name'], $path . $flvpath );
  return  $flvpath;
}


function getDirFiles($dirPath)
{
    if ($handle = opendir($dirPath))
    {
        while (false !== ($file = readdir($handle))) {
            $fullpath = $dirPath . '/' . $file;
            if (!is_dir($fullpath) && $file != "CVS" && $file != "." && $file != "..")
                $filesArr[] = trim($fullpath);
        }
        closedir($handle);
    }

    return $filesArr;
}


//flv_import( $_FILES['movie'], "./uploaded/movies/" );


?>