View Waheed Akhtar's profile on LinkedIn

Follow Waheed Akhtar on Twitter

Valid XHTML 1.0 Transitional

iPage Affordable Web Hosting only $3.50/mo

How to install ffmpeg on windows PDF Print E-mail
User Rating: / 92
PoorBest 
Written by Waheed Akhtar   
Wednesday, 07 January 2009 19:10


Let me introduce you to ffmpeg first.

ffmpeg is widely used for media format conversions or encoding. You may have seen on Youtube. Whatever media format you upload, it is converted into streaming flash files.(.flv). You can get more information about ffmpeg from http://ffmpeg.mplayerhq.hu/

ffmeg installation on Linux may be easy because primarily it is made for Linux not Windows. However some good experts have made it for windows also.

As I worked on ffmpeg, one thing is confirmed that you must have dedicated Windows server to install ffmpeg. There are a lot of changes in the OS and PHP settings.

Right now I will guide you to install ffmpeg on Windows XP. If you want to install it on Windows 2003 server then you can contact me.

Ok, please follow these steps to install ffmpeg on your Windows XP machine.

1- You must have PHP version 5.2.6 or above installed

2- Graphics library GD2 must also be installed.

3- Now download ffmpeg.exe file from this URL http://ffmpeg.arrozcru.org/builds/

4- Put this file on a base or short location like c:/ffmpeg/ffmpeg.exe this path will be used in DOS commands. So keep it easy and simple.

5- In fact this is the only file required for encoding files. However I am giving you whole application development guide like creating frame images and flash movie player etc.

6- If you switch to DOS simply give a source and destination file like
c:/ffmpeg/ffmpeg.exe –i d:/myfile.mpg d:/myfile.flv /y
It will start converting file.
You must have know-how about the parameters that you have to set for file encoding. This will increase or decrease size and quality of your output file. Read the documentation on this URL. http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html

7- Now come to another thing. It is called ffmpeg-php extension. This extension is made to manipulate encoded files. You can create frames and logo for your output file.

8- You can download ffmpeg-php extension and API documentation from this URL

a) http://sergey89.ru/files/ffmpeg-php/ffmpeg-php-win32-all.zip

b)http://groups.google.com/group/ffmpeg-php-windows/browse_thread/thread/0c46df97c0898f63?pli=1

c)http://sourceforge.net/projects/ffmpeg-php

9- Copy all fmpeg-php dll files into PHP "ext" (extensions) folder or System32,
Where the extensions are located.

10- Make this entry in php.ini
[PHP_ffmpeg]
extension=php_ffmpeg.dll

11- Now restart your PC. It’s good, because sometimes IIS restart doesn’t show effect.

12- Take phpinfo() to check that extension is installed successfully. I hope it will be there. J

13- As ffmpeg.exe will be executed from DOS within PHP. There is a function in PHP called exec() for that. However it will not work straight away. Restart your pc in safe mode with Administrator account. Because mostly Windows XP won’t let set security permissions in normal mode. Here is a very good example of setting permissions. http://www.somacon.com/p255.php

14- Ok, everything is done, How should we test that it is working?
here is the code
http://www.sajithmr.me/ffmpeg-sample-code

If sample code is printing all the information then your ffmpeg installation is successful and you can carry on with development of your application development.

When working on Home or PC, you might face some issues like slow encoding, It is because ffmpeg encoding requires more resources. You must experiment with small video/audio clips. However on Web servers you can try large files also.

If you are looking for ffmpeg hosting with everything ready then you can try Cirtex Hosting

Last Updated on Monday, 30 January 2012 06:57
 
COMMENTS (22)
Excellent
22 Thursday, 07 June 2012 06:30
gandh
Excellent article
Working link for the broken PHP example link
21 Thursday, 15 December 2011 05:35
John
http://www.sajithmr.me/ffmpeg-sample-code
Thank You
20 Tuesday, 22 November 2011 06:25
swap
Great to the point tutorial,installed it in few minutes

Thank You
FFMPEG for php 5.3
19 Wednesday, 16 November 2011 06:39
Arun Kumar
Hey guys,

Now builds for php 5.3 is available in this link http://sergey89.ru/files/ffmpeg-php/ . This may be usefull to you i think. Please read that readme inside that zip file it has clear explanation
It works for 32 bit os. but not for my 64 bit (Windows 7 Home premium). Is that any solution?
18 Saturday, 15 October 2011 09:37
Deb
I followed the same process and successfully configured ffmpeg-php in my Windows Xp (32 bit os). But its not working for my Windows 7 home premium (64 bit). Anyone can help? thanks in advance
thanks for this article
17 Friday, 19 November 2010 12:57
jatin
this is working perfect with php 5.2.6 and can u tell me php-ffmpeg module that support php 5.3.0
i have change my php version from 5.3.0 to 5.2.6
Addition to article
16 Thursday, 22 July 2010 06:19
KK
I would like to thank you for your wonderful article and tutorial on FFMPEG extension Module for PHP.

There is one mistake in the article .. at step 9
->Copy all fmpeg-php dll files into PHP "ext" (extensions) folder or System32, Where the extensions are located
You also have to copy .dll files to System 32. folder
too. Otherwise extension will not work..
Thanks for the guide and exemple
15 Tuesday, 29 June 2010 11:56
Mohamed
It was great. However, I will recommend everyone to carefully follow the steps
never mind my last post
14 Friday, 25 June 2010 06:54
dessy
my god,i can't believe it,

finally ffmpeg has show up on my php info,
thank you so much for your guide,so happy right now after a lot of trying and trying...

if you guys,still get frustrated...don't give up

you'll make it
Reply:
13 Thursday, 24 June 2010 06:10
Ayesha
make sure that u r using php 5.2.9 or 5.2.8 coz that might be the issue, and do copy all dlls in system32 and ext folder. Hopefully this will resolve your problem.
what i miss with my installation
12 Wednesday, 23 June 2010 12:23
dessy
i've copied my dll file in system32 folder and i've added
this;
[PHP_ffmpeg]
extension=php_ffmpeg.dll
on my php.ini but,i still can't find ffmpeg configuration at php info

i've download this link
http://sourceforge.net/projects/ffmpeg-php, but i still don't know what's this for,

so what i miss with my installation?

p.s: i've send an email too
I have honestly tried it all..
11 Saturday, 19 June 2010 20:31
Andrew
Hi guys, I am having a problem. I want to create a personal site with video, audio and image uploading functionality, and I have learnt a lot of php and mysql along the way. but now I've gotten to a dead end when it comes to the uploading of the videos... I need it to play back in a common format. My research has brought me to FFMPEG... but I am just not coming right.

I have followed all instructions and restarted all services (WAMP) but I get error messages. "PHP Startup: ffmpeg: Unable to initialize module... "

I honestly have no idea why,I copied all ddl as instructed.

I will be grateful for any feedback at all, and will always be glad to help where I can with other problems..

Andrew

Admin Reply.

ffmpeg-php library is currently for the version upto PHP 5.2.6, while Wamp is using PHP 5.3.x.
this is causing problems. So install previous version Wamp and Xampp with PHP 5.2.6.

I will try to look any solution for current versions.
Installing
10 Wednesday, 16 June 2010 03:14
junaid
Hi very helpfull tutorial i have installed ffmpeg on windows 7 operating system in easyphp i have successfully able to convert the files using php just one thing when it converts file its prompt cmd window like is this is normal ? or i have done something wrongs .Thanks

Admin Reply,

Well, May be it is because of User Access Control. Search "how to turn off User Access Control in Windows 7".
thanks
9 Wednesday, 26 May 2010 15:25
mylène
GREAT !!
Thaks a lot for the guide !
cannot get FFMPEG extension installed!
8 Monday, 10 May 2010 04:43
Saman
Thanks for the great article! However, I followed all the steps and FFMPEG extension is still not showing up on phpinfo(). And when I try the sample code it cannot load the extension and says: "Error in loading ffmpeg".

I am running php5.3.0 on Windows Vista and MS IIS 7.0 (I do not run my php on Apache).

I copied the php_ffmpeg.dll in the ext folder and added the entery below to the php.ini:

[PHP_ffmpeg]
extension=php_ffmpeg.dll

Could you please help me get FFMPEG extension installed properly?

Thanks a lot!
-Saman

Admin Reply:
Saman, Please copy the dlls to you System folders as well. i.e /system32
Plz guide me to install ffmpeg-php
7 Wednesday, 10 March 2010 05:24
abi
hi,
your step by step for ffmpeg is very useful.
I got a error after adding all dll files to ext folder in wampserver.
The error is unable load dynamic library.
Plz guide me to overcome the error.

Admin Reply,
Copy same dll files in Windows System folder.
ffmpeg installation on windows 2003 vps
6 Thursday, 08 October 2009 07:33
Maheswaran S
Good article,
Can you please guide me in installing ffmpeg in windows 2003 virtual private server
(VPS)
Thanks in advance,
Maheswaran S
Great Guide
5 Tuesday, 29 September 2009 16:16
Liz
After 3 hours of searching, finally a guide that made ffmpeg-php show on my php 5.2.6. Great article. Cheers!
excellent
4 Saturday, 01 August 2009 07:38
JChristian
excellent article ... I was looking everywhere how to install ffmpeg ... thanks!
Need help in PHP_FFMPEG installation
3 Thursday, 16 July 2009 06:42
karthik
I Have Downloaded files from the below URL
http://sourceforge.net/projects/ffmpeg-php

but in that i did not find any files named php_ffmpeg.dll.So can u give me the exect link where i can download the php_ffmpeg exes and dlls

Admin Reply:
Please download it from this link http://sergey89.ru/files/ffmpeg-php/ffmpeg-php-win32-all.zip
Installing FFMPEG on a windows server 2003 system
2 Sunday, 19 April 2009 20:19
Joe
Sounds like it's not going to be easy..could use some help. If interested please reply
Thanks for the guide and example
1 Monday, 19 January 2009 22:09
Saleem
It was great. However, I will recommend everyone to carefully follow the steps. You missed one, it will not work.

ADD_YOUR_COMMENT

YOURALIAS:
YOUREMAIL:
Title:
FULLTEXT:
  SECRETWORD_IMAGE
SECRETWORD: