FFMPEG, XAMPP and Windows

Problems with the Windows version of XAMPP, questions, comments, and anything related.

FFMPEG, XAMPP and Windows

Postby Droobles » 05. January 2009 18:18

If you accept feature requests, I would like you to include FFMPEG in the Windows Installation of XAMPP. :wink:


I hope this is possible as I cannot find any decent information on how to install FFMPEG in PHP5 on Windows. :oops: :cry: :x


thanks
Droobles
 
Posts: 1
Joined: 05. January 2009 18:11

Re: FFMPEG, XAMPP and Windows

Postby Sharley » 05. January 2009 23:30

Droobles wrote:...I cannot find any decent information on how to install FFMPEG in PHP5 on Windows...
Where did you look?
ffmpeg forum search results
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: FFMPEG, XAMPP and Windows

Postby dmphotography » 06. January 2009 06:36

I actually wrote a tutorial on installing that and some other components required for some script programs. Take a look at this:

http://www.imgoingtoreportyou.com/install_vidiscript_windows_xampp.html

That's a guide on how to install a Youtube clone script on your site and I was quite proud of myself to figure it out, because there was very little supporting documents when it came to Windows.

FFMPEG was probably the most difficult thing to figure out, especially where to find the FFMPEG-PHP for windows.

All of my tutorials and installations I've made are based on XAMPP 1.7.0 installs and I test them on Vista, XP, and sometimes Server 2003.
Anyways, I hope that helps.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

Re: FFMPEG, XAMPP and Windows

Postby superfresh » 16. February 2009 22:04

Install ffmpeg for windows

Step 1
Install xampp, use latest version. After installation there should be a directory C:\xampp
In this example i use C:\xampp as default directory.

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

Step 3
Download ffmpeg.exe from one of the following 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 show 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, five dlls should show up namely php_ffmpeg_20050123.dll, php_ffmpeg_20050212.dll, php_ffmpeg_20050618.dll and also avcodec.dll and avformat.dll

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

Step 8
Open your php.ini file which you find in C:\xampp\php .Add the following line to the list with dlls:
extension=php_ffmpeg.dll
Check also if extension=php_gd2.dll is uncommented. If not then remove the ;

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

Step 10
Copy pthreadGC2.dll which was unpacked in step 4 to C:\WINDOWS\system32

Step 11
Restart xampp

Simple Example
Step 12
Create a directory in C:\xampp\htdocs for example www.test.dev\www
C:\xampp\htdocs\www.test.dev\www

Step 13
Open the httpd.conf file, this one you find in C:\xampp\apache\conf
Add under the line
NameVirtualHost localhost:80

the next data
<VirtualHost localhost:80>
ServerName www.test.dev
DocumentRoot C:/xampp/htdocs/www.test.dev/www
</VirtualHost>

Step 14
Find the hosts file on your computer, somewhere in the windows directory and add the following line:
127.0.0.1 www.test.dev

Step 15
Restart xampp

Step 16
Make a php file in the DocumentRoot (C:\xampp\htdocs\www.test.dev\www) for example test.php

Step 17
Add a flv file to the DocumentRoot. In this example i call it wattan.flv.

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

Step 19
Add the following code to the test.php file:
<?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 19
Open the url http:\\www.test.dev\test.php in firefox.

Step 20
enjoy!
superfresh
 
Posts: 1
Joined: 16. February 2009 21:51

Re: FFMPEG, XAMPP and Windows

Postby Izzy » 16. February 2009 22:31

Step 8
Open your php.ini file which you find in C:\xampp\php...
Incorrect, the php.ini file that XAMPP uses is to be found in the xampp\apache\bin folder and can be confirmed by going to http://localhost/xampp/phpinfo.php and look for this line Loaded Configuration File.

I have not had time to check the rest for any more incorrect steps.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: FFMPEG, XAMPP and Windows

Postby dmphotography » 20. February 2009 01:52

Izzy wrote:I have not had time to check the rest for any more incorrect steps.


LOL, no need to Izzy. That has got to be the worse instructions I've seen so far. It's way too vague for one and it makes no sense to do all of the things this person has described. GD2 has nothing to do with FFMPEG for one and it's enabled by default in XAMPP. Plus, a lot of the instructions are wrong.

It was instructions like that that made me make my website trying to straighten it out for those who tried following something like that. Wew, that's rough.
For great video and written tutorials and guides on creating your own web server and installing things such as forums, blogs, etc., visit http://myownhomeserver.com
dmphotography
 
Posts: 191
Joined: 15. December 2008 14:25
Location: Columbus, MS
Operating System: Windows 7

Re: FFMPEG, XAMPP and Windows

Postby adeelshahid » 03. June 2009 07:18

Regardsless of all you guys discourging superfresh that the steps are this way or that way,

the steps worked for me and I think they are pretty easy, you just need a brain :wink:
adeelshahid
 
Posts: 2
Joined: 04. October 2008 09:10

Re: FFMPEG, XAMPP and Windows

Postby BDS1400 » 29. October 2010 23:25

I stopped at STEP 11 and got it to work on XAMPP 1.7.3 in Windows 7
BDS1400
 
Posts: 1
Joined: 29. October 2010 23:24

Re: FFMPEG, XAMPP and Windows

Postby Charca » 25. November 2010 01:26

Worked great for me too on Windows 7, thanks for the instructios, superfresh.

Just one thing, to make it work on Win7 64 bits I had to copy the dlls on Windows/SysWOW64/ as well.
Hope this helps anyone.
Charca
 
Posts: 1
Joined: 25. November 2010 01:23

Re: FFMPEG, XAMPP and Windows

Postby nickgee » 29. December 2010 00:50

Hi first post, but after spending close to 5 hours on this I'd like to say that the above dll files didn't work for me but the two links at the bottom of this page http://tutpages.com/?page_id=20 provided more friendly results and ffmpeg now shows up in php_info(). :)

I'm on Vista (bleh), 32-bit, and am using XAMPP 1.7.1 Beta5. (Can't use the latest because it comes with PHP 5.3 and some Drupal modules still have problems with that.)

Hope that helps if you're having problems with this.
nickgee
 
Posts: 1
Joined: 29. December 2010 00:43

Re: FFMPEG, XAMPP and Windows

Postby vladkras » 24. February 2011 13:42

Charca wrote:Just one thing, to make it work on Win7 64 bits I had to copy the dlls on Windows/SysWOW64/ as well.
Hope this helps anyone.

it helped my very much, big thx

i'm using the latest xampp lite with php 5.3.1 on Windows 7 64-bit
http://quezar.ro/php_ffmpeg/ link doesn't work anymore, so i took the archive here: http://rapidshare.com/#!download|934l34 ... _5.3.1.rar
copied php_ffmeg.dll to php\ext & other DLLs to Windows/SysWOW64 (only for 64-bit), and added extension=php_ffmeg.dll in php.ini file
that's all, now i can see ffmpeg in phpinfo()

(whatch readme.txt inside the archive for better English)
vladkras
 
Posts: 1
Joined: 24. February 2011 13:14

Re: FFMPEG, XAMPP and Windows

Postby cham » 20. April 2011 08:59

Created zero sized file. May I know what's the error?
I run the command in command line and gives error as follows.
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)
[flv @ 00AA6C70]Unsupported video codec (7)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000
/1) -> 25.00 (25/1)
Input #0, flv, from 'wattan.flv':
Duration: 00:05:54.0, start: 0.000000, bitrate: N/A
Stream #0.0: Video: 0x0007, 25.00 tb(r)
Stream #0.1: Audio: 0x000a, 44100 Hz, stereo
picture size invalid (0x0)
Cannot allocate temp picture, check pix fmt
cham
 
Posts: 1
Joined: 20. April 2011 08:54


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 70 guests