ffmpeg.php
1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?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/" );
?>