STEP 1Download den nyeste version af ffmpeg, og pak de 3 filer ud til en mappe.
http://ffdshow.faireal.net/mirror/ffmpeg/STEP 2Download dll filer for ffmpeg, og pak de 5 filer ud til den samme mappe
http://azzerti.free.fr/php_ffmpeg_win32.zipSTEP 3Kopier den udpakkede fil
php_ffmpeg_20050618.dll til
c:\xampp\php\ext og omdøb den til
php_ffmpet.dllSTEP 4Åben din
php.ini fil (c:\xampp\php\php.ini)
Under
Dynamic Extensions tilføj linien
extension=php_ffmpeg.dllSTEP 5Kopier de udpakkede filer
avcodec.dll, avformat.dll og
pthreadGC2.dll til
c:\windows\system32 eller
c:\windows\syswow64 alt efter om apache køres som 32bit eller 64bit.
STEP 6Genstart Apache servicen.
Hvis du let vil teste at det virker:
I et af dine websites fx c:\xampp\htdocs\testsite
STEP 1Kopier en
.flv fil ind i mappen
STEP 2Kopier den udpakkede
ffmpeg.exe ind i mappen
STEP 3Lav en ny php fil, fx
test.php og tilføj følgende kode til den:
<?php
$ffmpegpath = "ffmpeg.exe";
$input = 'wattan.flv';
$output = 'wattan.jpg';
if (make_jpg($input, $output)){
echo 'success';
}else{
echo 'bah!';
}
function make_jpg($input, $output, $fromdurasec="01") {
global $ffmpegpath;
if(!file_exists($input)) return false;
$command = "$ffmpegpath -i $input -an -ss 00:00:$fromdurasec -r 1 -vframes 1 -f mjpeg -y $output";
@exec( $command, $ret );
if(!file_exists($output)) return false;
if(filesize($output)==0) return false;
return true;
}
?>
STEP 4Åben hjemmesiden i en browser (testet med Firefox)