View Full Version : Installing FFMPEG

07-19-2008, 09:04 AM
wget http://code.dattasmoon.com/installer/source/ffmpeg.tar.gz
tar -zxvf ffmpeg.tar.gz
cd ffmpeg

If you want to include mp3 support, please install lame (directions on how to install Here (http://forums.westhost.com/showthread.php?t=11563)) first, then use this:

./configure --prefix=/usr/local/ffmpeg --enable-libmp3lame --enable-shared --extra-cflags=-I/usr/local/lame/include --extra-ldflags=-L/usr/local/lame/lib
If you want libvorbis as well (directions on how to install here (http://forums.westhost.com/showthread.php?t=11567)), then use this:

./configure --prefix=/usr/local/ffmpeg --enable-libmp3lame --enable-libvorbis --enable-shared --extra-cflags="-I/usr/local/lame/include -I/usr/local/libvorbis/include -I/usr/local/libogg/include" --extra-ldflags="-L/usr/local/lame/lib -L/usr/local/libvorbis/lib -L/usr/local/libogg/lib"
otherwise use this:

./configure --prefix=/usr/local/ffmpeg --enable-shared

After you are done configuring it, make it

make && make install

It is really that easy, you can also do this to make programs find it easier

cd /usr/local/bin
ln -s /usr/local/ffmpeg/bin/ffmpeg
ln -s /usr/local/ffmpeg/bin/ffserver
lastly, lets link it all up, edit the file located at /etc/ld.so.conf and add this line:

then run


Some people have asked me about PHP integration, and here is how to do that:
First download it from here: http://sourceforge.net/project/showfiles.php?group_id=122353&package_id=133626
then lets extract, and build

tar -jxvf ffmpeg-php-*
cd ffmpeg-php-*
./configure -with-ffmpeg=/usr/local/ffmpeg
make && make install

Now you can make your own youtube site, here is some php code that will help you along: http://money-code.com/node/46
Want me to make a tutorial on how to install something? PM me!
got questions? Reply below to ask them

WestHost - DWinans
07-19-2008, 11:50 AM
If you run into issues running the ./configure command try re-installing the Gnu Compiler Collection in Site Manager.

07-20-2008, 05:13 PM
I found a working php extension for ffmpeg, the installation instructions have been modified to show how to install it as well.

07-21-2008, 04:10 PM
Added how to include libvorbis into ffmpeg

09-27-2008, 08:28 PM
So it appears FFMPEG has done some work to break itself. New versions of FFMPEG will not work because it starts requiring direct access to the Hardware (V4L to be specific). Anyway you can download the newest revision that does not include these changes:
I have updated the tutorial on how to use the new version

11-19-2008, 12:57 PM
For use MOV files I must enable lib amr and x264 in the config.
How can I enable this functions in FFMPEG?

12-22-2008, 02:19 PM
I compiled all the libraries from source with some variations on the above instructions and


Everything compiled correctly and added to /etc/ld.so.config and issued ldconfig

But, when configuring ffmpeg
./configure --prefix=/usr/local/ffmpeg --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-gpl --enable-shared --extra-cflags="-I/usr/local/lame/include -I/usr/local/libvorbis/include -I/usr/local/libogg/include -I/usr/local/xvid/include" --extra-ldflags="-L/usr/local/lame/lib -L/usr/local/libvorbis/lib -L/usr/local/libogg/lib -L/usr/local/xvid/lib" --disable-mmx

I get xvid not found. It is in the location given and I've even tried ftping and el4 rpm to the /usr/local lib and include directories, but to no avail. Any ideas what's wrong? I can't find support for this anywhere (though some guy at mplayerhq had the same issue, I didn't see how it was resolved)

12-22-2008, 02:21 PM
try ./configure --help

12-29-2008, 06:48 PM

Thanks for the instructions it really help me with the installation of ffmpeg. But I am not able to install ffmpeg-php. The make command always fails on me. When running the make command I get:

/usr/local/ffmpeg/include/libavformat/avformat.h:188: error: storage size of `pix_fmt' isn't known
make: *** [ffmpeg-php.lo] Error 1

I am wondering if any has had the same trouble. I have read on-line is has to do with the versions of ffmpeg and ffmpeg-php not being compatible. I have tried older versions of ffmpeg-php with no luck. I have also tried the latest ffmpeg with the latest ffmpeg-php and still got the error. I was just wondering if anyone has run into this problem or knows how to fix it.


12-30-2008, 07:15 AM
When I compiled all that stuff, I used the prefix command to put binaries in a subdirectory /usr/local as you see in my config again. Then I put ln -s sym links in the /usr/local/bin and tested that the binaries were working with, e.g. which ffmpeg

I configured ffmpeg-php with
./configure --with-ffmpeg=/usr/local/ffmpeg

but the make didn't work, something with the include avformat.h and avcodec.h which throws a number of errors. I think I'll try recompiling ffmpeg

12-30-2008, 07:31 AM
I thought I would add this link to this thread also. There is an installer that works on a WestHost account that makes installing ffmepeg easier. SITE GONE You can actually use the ffmpeginstall version that is for root but you have to edit the install.sh file.
Change line 47:

if [[ $who == "root" ]];then
You would need to replace root with your username. Since we have root like access this works fine. It well install a lot of other things and in fact gives you a full working version of ffmepeg way beyond what you may need. For example it has set up for ruby. If you open up start.sh you can see everything the script does. In fact you may want to examine other files in the download to see some of the things he did to get them to install. :)

02-27-2009, 07:31 AM
I can't seem to get this thing installed. I'm getting permission denied errors.

02-27-2009, 09:26 AM
what command are you running, what edit did you make, folder are you working in?

03-16-2009, 12:17 PM

Thanks for the instructions it really help me with the installation of ffmpeg. But I am not able to install ffmpeg-php. The make command always fails on me. When running the make command I get:

/usr/local/ffmpeg/include/libavformat/avformat.h:188: error: storage size of `pix_fmt' isn't known
make: *** [ffmpeg-php.lo] Error 1

I am wondering if any has had the same trouble. I have read on-line is has to do with the versions of ffmpeg and ffmpeg-php not being compatible. I have tried older versions of ffmpeg-php with no luck. I have also tried the latest ffmpeg with the latest ffmpeg-php and still got the error. I was just wondering if anyone has run into this problem or knows how to fix it.


I'm getting the same exact problem, can someone please help!

/usr/local/ffmpeg/include/libavformat/avformat.h:165: error: storage size of `pix_fmt' isn't known
make: *** [ffmpeg-php.lo] Error 1

03-17-2009, 11:49 AM
I've tried figuring out the problems with avformat.h but can't seem to find a solution. I thought it may be an issue with the version being newer that is available now but I backed up a couple versions and it still did not make a difference.

The SITE GONE does still work and in fact I am installing it at the moment on a new account. It does have everything including the kitchen sink :) but for most that may be just what they wanted. It does take some time to install everything and you need to make sure that you chmod the files ending in .sh to 755.

03-17-2009, 12:38 PM
I tried the sherin thing and it would not install it properly (ffmpeg failed installing).

It installed just about everything else though.

03-17-2009, 04:14 PM
Yes I must correct my comment. It failed on me this time also. :( I haven't quite sorted out why it is failing this time.

05-02-2009, 10:21 AM
I know it has been a while, but anyone ever found a solution to the ffmpeg-php problem?

/usr/local/ffmpeg/include/libavformat/avformat.h:188: error: storage size of `pix_fmt' isn't known
make: *** [ffmpeg-php.lo] Error 1

Share, for the love of God. I am out of hairs to pull.

07-22-2009, 10:32 PM
So can anyone help clarify this for me? I really need to get ffmpeg working, however none of the links in the thread are working anymore - including the older version of ffmpeg that doesnt require direct hardware access, and the precompiled file that wildjoker mentions.

Can anybody break this down into instructions that I would understand?

01-31-2010, 09:54 PM
Trying to run the PHP integration and I get this error....Please advise....Thank you very much!!!

[/usr/local/bin]$ ./configure -with-ffmpeg=/usr/local/ffmpeg
-sh: ./configure: No such file or directory
[/usr/local/bin]$ make && make install'/usr/bin/phpize'
make: *** No targets specified and no makefile found. Stop.

02-01-2010, 04:43 AM
configure would not be in /usr/local/bin. It would be in the directory where you downloaded and unzipped the PHP source files.

02-08-2010, 02:11 AM
On this issue:

The last step on Dattas post needs a little fixing. I am not sure what changed since this post, but it appears you cannot edit the /etc/ld.so.conf file as it is a root file our VPS accounts cannot edit.

Instead you need to create a ffmpeg.conf within the /etc/ld.so.conf . d directory (just make one using vi), add /usr/local/ffmpeg/lib to the file, then save. Afterwards run ldconfig and it should work.

02-08-2010, 06:58 AM
/etc/ld.so.conf should be owned by you. my accounts are still that way. Then again my accounts are older so it is good to know there is an alternative if newer accounts are created with the file owned by root.

02-08-2010, 10:33 AM
Actually, so is mine. But for some reason lots of thins are not working:

wget is not working and I cannot change permissions on the mentioned file or any of the bin, lib or includes folders within /usr/local/ .

trying to compile x264 now and I am sooooo out of luck. Even after installing nasm...it fails because the permissions issue above.

SInce I got your attention...I do have an ffmpeg binary with all the goodies in it, but I can't seem to figure out how to use it.

How exactly do you use the ffmpeg binary? Just upload and use?

Funny thing, I was at VPS.net for a month or so and now that I am back in here I can see the huge advantages of VPS.net for this sort of thing.

02-08-2010, 12:24 PM
This is still a WH 3.0 account correct? I am pretty sure you would not have /usr/local in WH 4.0 but figured I should clarify that one since you said you where over at VPS.net then returned here. :)

Not sure what files you would need to change permissions on. True you may not have premission to write to some existing files but that is why you would us --prefix=/usr/local/ffmpeg when configuring things. That is actually why you would then run the ln commands while in /usr/local/bin that has towards the end of his post. Since you used the prefix /usr/local/ffmpeg it created the bin directory in that directory. You still have write access to /usr/local/bin where you want to create the links (ln) to the binaries.

If wget is not working on your account then something is not right. :) Have you asked WestHost about that?

If you have the binaries you could try and upload them to /usr/local/bin but I am not sure that in this case that would work. Where did you get the binary?

02-08-2010, 12:52 PM
First of all...thanks for the replies. I have seen this post many times and even posted once but I figure it was so old you were out of the loop...

yes, still a 3.0 account.

As for the prefix....I think I figure that part out as I was doing it, still no dice.

I found the binaries at a CentOS site somewhere in the hudred of links I search. I got ffmpeg working, just the x264 that is killing me.

I am gonna try it again in a little while.

And no wget is not working, no nasm....

02-08-2010, 03:29 PM
What error do you get when you try to use wget? Actually you should be able to contact WestHost about wget and they should be able to check and make sure it is working. nasm would not be installed by default on our accounts. You would need to install it yourself.

It is kind of hard to guide you since you are not giveing any specifics but don't forget that you may need to use --prefix=/usr/local/theapp when your run configure is you are running in to write permission issues. theapp would be replaced with the name of what ever you are trying to install. :)

02-08-2010, 09:34 PM
You kidding me man? You are already more help than I expected.

I am running Drupal + ffmpeg wrapper. I installed and compiled ffmpeg and it is working fine in Drupal. The Test Conversion works, at least for the video formats I tested....except h264. So I moved to install x264 and it seems I kept running into dead ends:

I used the latest x264 snapshot from git via http.

First of all it would not compile because it kept telling me I needed nasm. I was under the impression yasm would work, but it did not, so I installed nasm.

The ./configure I used for the install was:

./configure -with-ffmpeg=/usr/local/ffmpeg

And gave me this in result:

Unknown option -with-ffmpeg=/usr/local/ffmpeg, ignored
Platform: X86
System: LINUX
avis input: no
mp4 output: no
pthread: no
vfw: no
debug: no
visualize: no

You can run 'make' now.

On make everything seemed fine, but on make install I got these errors:

install -d /usr/local/bin /usr/local/lib /usr/local/include
install: cannot change permissions of `/usr/local/bin': Operation not permitted
install: cannot change permissions of `/usr/local/lib': Operation not permitted
install: cannot change permissions of `/usr/local/include': Operation not permitted

So I tried changing he permissions on those three via ssh (so I could see groups). No dice. I cannot and I presume because they are root.

So I was about to give up. I saw somebody else had posted on the x264 and this is the only thread that mentioned it..

02-09-2010, 07:46 AM
Well again it comes down to "where" you are trying to install. By default when you install something a prefix of /usr/local is used. That means that the program is trying to modify /usr/local/bin, /usr/local/lib and /usr/local/include. While we have some rights in these directories you are correct we do not have full root access to them since they are owned by root. You should be able to use --prefix=/usr/local/x264 when you configure it. To make sure type ./configure --help and it should give you output of what can be used when configuring x264. :) You might have to link to the binaries that are created in /usr/local/x264/bin like you did with ffmpeg and add the /usr/local/x264/lib to your /etc/ld.so.conf and run ldconfig.

What some folks at WestHost have done is create a "/usr/local" directory that thy use for their own installs. For example if you check this page http://www.domsch.com/westhost/ , Matt on some occasions uses the prefix of /home/myusername. Since that is a directory he created he has full access to it and the bin,lib and include directories that are in it. Then he adds /home/myusername/lib in his /etc/ld.so.conf. In this way he does not have to keep going through the last step of adding a new lib directory on each install. I know it is a bit late for you to do this but for others who are reading this it might be worth setting up.

05-04-2010, 07:24 AM
Hello all.

This maybe an old thread. But I have hit a brick road. I Have followed all the instructions and it has worked all the way (including mp3 support and libvorbis) until I get to

make && and make install

If you look at the picture attached. You will see an error about "tuner". Now I am a linux noob. So I am at a lost as to what to do next.

Hope somebody can help.


05-05-2010, 05:45 AM
Newer versions of ffmpeg tries to access hardware like video cards and such on the system they are installed on. We don't have that option here. In fact even over at vps.net where they have an image you can install with ffmpeg, I am pretty sure it is an older version because in a hosting environment you don't have access to the video card... in fact I am pretty sure there isn't one. :)

Now with that being said, I did do some current searching on this and it could be that this would let you get past the problem. http://eitwebguru.com/fix-make-libavdevicev4l-o-error-1/. They where able to disable v41 and v42 when configuring ffmpeg to get past this error.

05-05-2010, 10:21 AM
Thanks for that info. Got me pass it and it installed.

Now when I get to install ffmpeg-php. I Get this error.

/usr/local/ffmpeg/include/libavformat/avformat.h:250: error: storage size of `pix_fmt' isn't known
make: *** [ffmpeg-php.lo] Error 1

What do you think I can do to get passed this last hurdle?

05-05-2010, 01:30 PM
I bet you can disable it... well maybe. Try configure --help and see if it gives you any details on what you can disable during the configure process. I didn't have much luck on Google but you might have better luck then me. the pix_fmt is I think the key. I know at one time I read something about this and folks having errors but can't find it now. Could be a read it over at the vps.net forum so that might be a place to check out.

05-05-2010, 02:49 PM
I Gave up. 2 hours on Google and no joy :(

But it's not a big issue. I Don't think I need it right now.

I have got my FFmpeg installed and it is doing the job I want it to do. Working on a new version of www.OnlineTruckers.org Using JomSocial with video uploading enabled. Now I have to just get it working with iPhones and I will be happy ;)

05-06-2010, 11:08 AM
I beat it! :) It took some time but I finally figure out what was going on. You have to do some extra work to get ffmpeg_php going since we ffmpeg itself is installed in a location that is not default.

I noticed that when running make it was complaining early on about not being able to include files. I created some symbolic links in /usr/local/include on a long shot and it worked. So log in via SSH and then issue these commands. Now the code below does assume that you where following the directions at the first of this post and that when you installed ffmpeg to start with you did it with --prefix=/usr/local/ffmpeg. If not you need to change the paths below to match what you did use.

cd /usr/local/include
ln -s /usr/local/ffmpeg/include/*
ln -s /usr/local/ffmpeg/include/libavcodec
ln -s /usr/local/ffmpeg/include/libavdevice
ln -s /usr/local/ffmpeg/include/libavformat
ln -s /usr/local/ffmpeg/include/libavutil

That fixed the error you where having but I still ran into a problem with libsswscale. I don't know if it was just something I did but when I first installed ffmpeg or what, but I did have to go back and install that. If it is not installed then you won't have a /usr/local/ffmpeg/include/libsswscale directory. More then likely I could have just copied from the source directory but I went ahead and ran the make and make install for that library. I am not sure where you decompressed your orginal sources but I just did it at root so the code below is a reflection of that.

cd /ffmpeg-0.5.1/libsswscale
make install
Once you take care of the above you should be good to go on installing ffmpeg_php. Just to be safe I ran make distclean first then ran ./configure again.

cd /ffmpeg-php-0.6.0
make distclean
./configure --with-ffmpeg=/usr/local/ffmpeg
make install
I hope that gets you going. When I get some time I want to do a new tutorial on this with all the steps from start to finish. I think at this point if anyone visited this thread they would get a bit lost. :)