Powered by Blogger.

Install ffmpeg in Windows Server

Install ffmpeg for windows

Step 1

Install xampp, use latest version. After accession there should be a agenda C:\\xampp
In this archetype i use C:\\xampp as absence directory.

Step 2

Check if gd2 is installed, you can do this by application phpinfo() in you script.

Step 3

Download ffmpeg.exe from one of the afterward links:
http://ffdshow.faireal.net/mirror/ffmpeg/
http://arrozcru.no-ip.org/ffmpeg_builds
http://ffdshow.faireal.net/mirror/ffmpeg/
http://www.paehl.com/open_source/?Convert_Tools:FFMPEG
http://oss.netfarm.it/mplayer-win32.php

Step 4

Unpack the downloaded zip or 7z file, three files should appearance up namely ffmpeg.exe, ffplay.exe, pthreadGC2.dll .

Step 5

Download the ffmpeg windows dll files:
http://azzerti.free.fr/php_ffmpeg_win32.zip

Step 6

Unpack the downloaded zip file, 5 dlls should appearance up namely php_ffmpeg_20050123.dll, php_ffmpeg_20050212.dll, php_ffmpeg_20050618.dll and aswell avcodec.dll and avformat.dll

Step 7

Copy 1 of 3 dlls which you've unpacked in footfall 6 into C:\\xampp\\php\\extensions. Rename the dll to php_ffmpeg.dll

Step 8

Open your php.ini book which you acquisition in C:\\xampp\\php .Add the afterward band to the account with dlls:

extension=php_ffmpeg.dll
Check aswell if extension=php_gd2.dll is uncommented. If not again abolish the ;

Step 9

Copy the avcodec.dll and avformat.dll which you've unpacked in footfall 6 to C:\\WINDOWS\\system32

Step 10

Copy pthreadGC2.dll which was unpacked in footfall 4 to C:\\WINDOWS\\system32

Step 11

Restart xampp
Simple Example

Step 12

Create a agenda in C:\\xampp\\htdocs for archetype www.test.dev\\www
C:\\xampp\\htdocs\\www.test.dev\\www

Step 13

Open the httpd.conf file, this one you acquisition in C:\\xampp\\apache\\conf
Add beneath the line
NameVirtualHost localhost:80
the next data
ServerName www.test.dev
DocumentRoot C:/xampp/htdocs/www.test.dev/www


Step 14

Find the hosts book on your computer, about in the windows agenda and add the afterward line:
127.0.0.1 www.test.dev

Step 15

Restart xampp
 
Step 16

Make a php book in the DocumentRoot (C:\\xampp\\htdocs\\www.test.dev\\www) for archetype test.php

Step 17

Add a flv book to the DocumentRoot. In this archetype i alarm it whatever.flv.

Step 18

Copy ffmpeg.exe which you've unpacked in footfall 4 into the DocumentRoot.(C:\\xampp\\htdocs\\www.test.dev\\www)

Step 19

Add the afterward cipher to the test.php file:
$ffmpegpath = "ffmpeg.exe";
$input = 'whatever.flv';
$output = 'whatever.jpg';
if (make_jpg($input, $output)){
echo 'success';
}else{
echo 'bah!';
}
function make_jpg($input, $output, $fromdurasec="01") {
global $ffmpegpath;
if(!file_exists($input)) acknowledgment 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)) acknowledgment false;
if(filesize($output)==0) acknowledgment false;
return true;
}
?>

Step 19

Open the url http:\\\\www.test.dev\\test.php in firefox.

Bannerad

Artikel Terpopuler

Tags

Blogumulus by Roy Tanck and Amanda Fazani