sting up ffmpeg to work in XAMPP

1.6k Views Asked by At

I'm trying to figuring out how to install and use ffmpeg on windows 64 with XAMPP.

I have flow this tutorial and install the ffmpeg-php librarys and I can see the expansion in the phpinfo().

Now I put my ffmpeg.exe in the site root folder and I run this php script:

extension_loaded('ffmpeg') or die('Error in loading ffmpeg');

function convertTo( $input, $output ) 
{
echo $cmd = "ffmpeg -i $input $output";
$outputData = array();
exec( $cmd , $outputData);
echo "<br/>";
print_r($outputData);
}

convertTo( "input.mp4", "output.flv" );

and I get this output:

ffmpeg -i input.mp4 output.flv
Array ( )

but no encoded file. My php safe mode is off and the movie file is in the root folder too.

workplace info:

  • win7 64bit
  • XAMPP 1.7.2
  • Apache 2.2
  • php 5.3.5

Help will be appreciated.

1

There are 1 best solutions below

4
On

for windows, use ffmpeg.exe and modify code

function convertTo( $input, $output ) 
{
echo $cmd = "c:\\ffmpeg\\ffmpeg -i $input $output";
$outputData = array();
exec( $cmd , $outputData);
}

convertTo( "d:\www\input.mp4", "d:\www\output.flv" );

$outputdata not return anything, so don't expect output.