Wed 7 Jan 2009
Please use the server setup page to request a quote.
How to install ffmpeg-php on a dreamhost shared host under a users account
This HOWTO now includes setup instructions for the following stuff:
- autoconf
- LAME
- ffmpeg
- GD2
- mplayer+mencoder
- Ruby
- flvtool2
- libogg
- libvorbis
- PHP
- ffmpeg-php
Disclaimer: Some of you might not be able to make it all work due to various reasons, that does not mean it cannot be done.
For installation assistance please also read The install prerequisites page where we list the requirements for the server setup. Clip-share, vshare, alstrasoft, social media are all scripts which we have setup successfully on Dreamhost, Bluehost, godaddy and many other shared hosting environments (as on 10May2007)
Rayzz, PHPMotion and OSTube also successfully deployed on shared hosts (as on 10August 07)
Prepare the directory
structure
mkdir bin
mkdir lib
mkdir tmp
chmod 777 tmp
chmod 775 bin
chmod 775 lib
Export some environment
variables
export TMPDIR=$HOME/tmp
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH
export CPATH=$HOME/include:/usr/local/include:$CPATH
export LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LIBRARY_PATH
mkdir src
cd src
AUTOCONF
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar -zxf autoconf-2.60.tar.gz
cd autoconf-2.60
./configure "--prefix=$HOME"
make
make install
LAME
wget http://nchc.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
tar -zxvf lame-3.97.tar.gz
cd lame-3.97
./configure "--prefix=$HOME" "--enable-shared"
make
make install
LIBOGG
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar -zxf
libogg-1.1.3.tar.gz
cd libogg-1.1.3
./configure --prefix=$HOME
make
make install
LIBVORBIS
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
tar -zxf libvorbis-1.1.2.tar.gz
cd libvorbis-1.1.2
./configure --prefix=$HOME
make
make install
FFMPEG
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg/
./configure "--prefix=$HOME" "--cross-compile" "--enable-shared" "--enable-mp3lame" "--extra-cflags=-I$HOME/include" "--extra-ldflags=-L$HOME/lib"
make
make install
GD2
wget http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
tar -zxf gd-2.0.33.tar.gz
cd gd-2.0.33
./configure --prefix=$HOME
make
make install
MPlayer + Mencoder
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
bunzip2 essential-20061022.tar.bz2
tar -xf essential-20061022.tar
mv essential-20061022 $HOME/lib
wget http://www3.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2
bunzip2 MPlayer-1.0rc1.tar.bz2
tar -xf MPlayer-1.0rc1.tar
cd MPlayer-1.0rc1
./configure --prefix=$HOME --with-codecsdir=$HOME/lib/essential-20061022
make
make install
RUBY
cd $HOME/src
wget ftp://ftp.ruby-lang.org/pub/ruby/stable-snapshot.tar.gz
tar -zxf stable-snapshot.tar.gz
cd ruby
make distclean
./configure --prefix=$HOME
make
make install
FLVTOOL2
wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
tar -zxvf flvtool2_1.0.5_rc6.tgz
cd flvtool2_1.0.5_rc6
ruby setup.rb config –prefix=$HOME
ruby setup.rb setup
ruby setup.rb install
PHP
wget http://us2.php.net/distributions/php-4.4.4.tar.bz2
bunzip2 php-4.4.4.tar.bz2
tar xf php-4.4.4.tar
cd php-4.4.4
./configure --prefix=$HOME --libdir=$HOME/lib --bindir=$HOME/bin --with-ffmpeg=$HOME
make
make install
FFMPEG-PHP
wget http://superb-east.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.0.tbz2
bunzip2 ffmpeg-php-0.5.0.tbz2
tar -xf ffmpeg-php-0.5.0.tar
cd ffmpeg-php-0.5.0
phpize
./configure "--prefix=$HOME" "--libdir=$HOME/lib" "--bindir=$HOME/bin" "--with-ffmpeg=$HOME"
make clean
make install
Setup users environment
to use the php installed earlier
cd $HOME/lib
cp $HOME/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so ./
cp $HOME/src/php-4.4.4/php.ini-recommended php.ini
vi php.ini (add extension= /home//lib/ffmpeg.so)</STRONG>< /STRONG>
To enable site:
cp $HOME/bin/php $HOME/cgi-bin/php.cgi
add a .htaccess with following content
AddHandler phpFive .php
Action phpFive /cgi-bin/php.cgi
You might need to also run the following
“ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib ”
” export LIBRARY_PATH=
$HOME/lib:$LIBRARY_PATH”
“export
CPATH=$HOME/include/:$HOME/include/lame/”
as well as put it ahead of any
call to ffmpeg in your PHP code. Please send questions through the sitecontact form
.-Imtiaz (khanimtiaz at gmail dot com)
We have got this procedure working on a variety
of shared hosts besides dreamhost. For installation assistance please also read
the install prerequisites page
December 29th, 2006 at 10:42 am
Hi I get the error message “Cannot find autoconf.” when trying to use the command “phpize” in the step of installing ffmpeg-php
Can anyone help?
December 29th, 2006 at 7:36 pm
Hi
I’m trying to install ffmpeg-php on dreamhost
I followed your instructions, however, when I came to the step to install ffmpeg-php when I use the phpize command the following error message
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.
When i try to configure ffmpeg it says it is an invalid file or directory.
I’m not too sure about the structure of the files are they all in the root of the directory with the exception of php 4?
January 4th, 2007 at 12:44 am
David had a problem with autoconf which was resolved by reinstalling autoconf and then completing the install as directed in the document. It’s working now at uploadartist dot com
January 5th, 2007 at 1:31 am
there is a small mistake with dashes in ./configuration line. It must be like this;
ffmpeg
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg/
./configure –-prefix=$HOME –-cross-compile –-enable-shared
make
make install
January 6th, 2007 at 12:34 am
Hi,
First Happy New Year !!
David how could you complie ffmpeg with AMR+LAME?
Can you write the shell codes?
Thanks…
January 7th, 2007 at 12:49 am
Hi Arda,
The trick is to install LAME first and then install ffmpeg with LAME support.
And the name is Imtiaz, David is one of the people whom I’ve set this up for
January 24th, 2007 at 10:28 pm
Hi have compiled everything above the ffmpeg, but i dont see to compile ffempeg itself. I’m a newbie to this so i really tried to figure out things but no luck. I get an sort of error.
Here it is:
————–
Unable to create and execute files in /tmp. Set the TMPDIR environment
variable to another directory and make sure that /tmp is not mounted
noexec.
Sanity test failed.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file “config.err” produced by configure as this will help
solving the problem.
———————–
What does it mean? What do i do here?
I would absolutely appriciate it if anyone could help me out here please.
Thank you,
Dann
January 26th, 2007 at 1:52 pm
Hi dann,
You missed the
export TMPDIR=$HOME/tmp
run that and then try again it should work if not then let me know I’ll check on your server.
-Imtiaz
January 28th, 2007 at 11:25 pm
Hello, can anyone please tell me the folder structure; How and where to put the files? do they go into (src) folder or what? I would much appriciate it.
thank you.
January 30th, 2007 at 2:18 am
Hi Beni,
Please go through this document. The folder structure is clearly explained at the top, the src folder will hold all the source to build the components. If you think something is confusing please let me know and I’ll go ahead and change it.
-Imtiaz
January 30th, 2007 at 5:49 am
I have compiled the ffmpeg (old version) and compiled the lame and added the amr codecs to the ffmpeg and enabled mp3lame while compiling
but when I try to compile the mplayer
I see the following error in the configuration log …
Although the so file is in the lib folder
what should I do?
============ Checking for libmp3lame (for mencoder) ============
#include
int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf(”%d%d\n”,lv.major,lv.minor); return 0; }
cc -O4 -march=athlon-xp -mcpu=athlon-xp -pipe -ffast-math -fomit-frame-pointer -I/home//include -I/usr/X11R6/include -I/usr/include/freetype2 -L/home//lib -o /home//tmp/mplayer-conf-19371-12812.o /home//tmp/mplayer-conf-19464-12812.c -lmp3lame -lm
ldd /home//tmp/mplayer-conf-19371-12812.o
libmp3lame.so.0 => not found
libm.so.6 => /lib/libm.so.6 (0×40021000)
libc.so.6 => /lib/libc.so.6 (0×40043000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0×40000000)
/home//tmp/mplayer-conf-19371-12812.o: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory
Result is: no
##########################################
January 30th, 2007 at 9:47 am
I installed eveything but when i try to install ffmpeg-php and then run phpize, it say autoconf not found. As you mentioned above to reinstall autoconf, i did three times but still the same problem. please please can someone help me just a bit. as im really broke these days and i cannot pay anyone to install it for me. so any help i would be appriciate it.
——————————————————————-
And Imtiaz thanks for your help, i tried the way you told me but again im stuch with the autoconf anot found.
thank you in advance
February 3rd, 2007 at 3:25 am
Hi Beni,
do an export PHP_AUTOCONF=autoconf and it should work
February 3rd, 2007 at 10:47 pm
Hi,
I have tryed to compile and install the ffmpeg and ffmpeg-php and I have much truble doing it, so I did a search in google and find Your site which explain this installation, but need more info on it.
Would like to know is this install info is for shared hosting or for dedicted hosting, because I’m in shared hosting on dreamhost and don’t have permissions to write on /home dir…
I encounter error installing autoconf…
I seems to have compiled it, but when I try to install it I get this error
usr/bin/install: cannot create regular file `/bin/autom4te’: Permission denied
/usr/bin/install: cannot create regular file `/bin/autoconf’: Permission denied
/usr/bin/install: cannot create regular file `/bin/autoheader’: Permission denied
/usr/bin/install: cannot create regular file `/bin/autoreconf’: Permission denied
/usr/bin/install: cannot create regular file `/bin/ifnames’: Permission denied
/usr/bin/install: cannot create regular file `/bin/autoscan’: Permission denied
/usr/bin/install: cannot create regular file `/bin/autoupdate’: Permission denied
make[2]: *** [install-binSCRIPTS] Error 1
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1
It seems like I haven’t permissiom to make dir or any thing else on home dir, so the question is how I gona install something in here???
This is what I would like to know:
What this meens “–prefix=$HOME” in ./configure “–prefix=$HOME” don’t understand is this relative or apsolute path, what I have to enter here ????
My apsolute path is /home/.matzoh/dxxx/auto-purchasing-tips.com/video/
I saw that many others have the same problems and it would be nice if you explain a litle bit more detailed about that home prefix and what goes where because something is not working like in David case You said that he fix it but You didn’t explain what exactly He fixed and I think this would be of great help to every one..
If anyone have such problem and he/she solved it, please post the explained problem solving right here thanks,
Nemanja
February 4th, 2007 at 10:54 am
Just so I don’t forget:
On bluehost:
1…. mencoder should be installed last
2…. u need ffmpeg
3…. CPATH
export PATH=$HOME/bin:$PATH
export CPATH=$HOME/include/:$HOME/include/lame/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
export LIBRARY_PATH=$HOME/lib:$LIBRARY_PATH
4…. Sleep
5…. for flvtool2 u need ot first install ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5-p12.tar.gz
tar -zxf ruby-1.8.5-p12.tar.gz
cd ruby-1.8.5-p12
./configure –prefix=$HOME
make
make install
cd ../flvtool2_1.0.5_rc6
$HOME/bin/ruby setup.rb config –prefix=$HOME
$HOME/ruby setup.rb setup
$HOME/ruby setup.rb install
It just might save the day someday…
February 4th, 2007 at 11:08 am
Hi Nemanja,
The $HOME in –prefix=$HOME, is an environment variable which translates into /home/dxxx/ on your dreamhost server (the .matzoh will be removed). I am constantly updating this document as it gets me a lot of hits and a number of small installation jobs so please go ahead and ask questions I’ll try and make the doc as helpful as possible.
Also if you would like to have me set up your server please contact me through the contact form and use your real email id when doing so.
Warm Regards
Imtiaz
February 4th, 2007 at 11:53 pm
I see nobody answered me…
I have problem installing mp3lame on dreamhost
The shared object is not seen during configuration of mencoder
see the post above
Waiting for your reply ASAP
February 5th, 2007 at 11:32 am
Hi,
I find my problem, I was using script phpshell and wasn’t been able to do anything…
But now I used putty and it all went well in installation process(I think so).
But now I have new problem I get this error message when I setup my youtube clone site and try to upload some movie… this is the error I get, don’t quite understand what it meens:
Fatal error: Cannot instantiate non-existent class: ffmpeg_movie in /home/.matzoh/xxxx/auto-purchasing-tips.com/video/upload.php
Can anyone help or advice on this matter??
Nemanja
February 22nd, 2007 at 7:04 am
Hire Imtiaz for all your problems… he did a great(and cheap) job of setting this up for me without a glitch. I use php5, so I didnt want the php ffmpeg package, and he still worked it out.
Thanks man!
February 26th, 2007 at 5:53 am
Hello, I need help. All steps ok, but when I will compile ffmpeg-php I get this error at make install:
make: *** [ffmpeg-php.lo] Error 1
warning: `ImgReSampleContext’ is deprecated
warning: `ImgReSampleContext’ is deprecated
`AVFrac’ is deprecated (
php.h: No such file or directory
php_ini.h: No such file or directory
php_globals.h: No such file or directory
ext/standard/info.h: No such file or directory
In file included from /home/jack/ffmpeg-php-0.5.0/ffmpeg-php.c:33
error: syntax error before “ffmpeg_module_entry”
error: conflicting types for ‘av_register_all’
error: conflicting types for ‘register_ffmpeg_movie_class’
and others…
February 27th, 2007 at 4:16 am
Hi Leandro,
Please have a look at: http://www.netbrix.net/archives/39
I do this for a living so if you’re interested maybe you could buy me a lunch or gas for the car
cheers
Imtiaz
March 6th, 2007 at 6:02 pm
HI, i am having the same problem that Beni had when i phpize ffmpeg-php. I tried “export PHP_AUTOCONF=autoconf” but that didn’t seem to do anything. Am i not doing it right? Which directory do i need to be in when i do it? What exactly does it do, because i am getting the same results.
Thanks, this is a great guide!
March 15th, 2007 at 2:15 pm
when i try to download the file with WGET it conencts to server, but i get a 404???
March 15th, 2007 at 2:36 pm
The 404 error only occurs with MENCODER… and again the PHPize dosnt work….. also tried the export…. AUTOconf installed fine… over and over again!!!
March 17th, 2007 at 2:31 pm
Hi! I tried with: export AUTO_CONF=autoconf before phpize, but didn’t work…
Say: Cannot find autoconf. Please check your….
March 17th, 2007 at 2:33 pm
This happen when I try ti install ffmpeg-php
I can’t then ./configure the ffmpeg-php
March 25th, 2007 at 8:12 am
Hi Daniel,
Try looking at the autoconf setup. If you do not see a autoconf binary in $HOME/bin (assuming shared host) then you probably need to install autoconf and make sure it works before proceeding.
also check the environment variables specifically PATH and LD_LIBRARY_PATH
If all else fails browse over to http://www.netbrix.net/archives/39
Warm Regards
Imtiaz
May 19th, 2007 at 5:53 pm
under Setup users environment
cp $HOME/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so ./
the extensions dir inside $HOME/lib/php/ is not cretade during installation!! wht did I missed??
May 20th, 2007 at 5:44 pm
hey hi guys,
first of thanks to you guys! good informations, but I am having a problem installing ffmpeg-php, however I have installed everything else succesesfuly!
but the only problem that cost me lost of heachache is that when i try to run the phpize command, it says ” -bash: phpize: command not found” I serached on google, nothing usefull found so far. I have a VPS server, which is alrady php1, php4, php5 is installed by the defult, i try to cantact my hosting comapny, they denied to assist me, due the VPS server is a unmanaged, but anyway, if you guys hahve any sulotion, or any other alternative, or knowing any other command insted of phpize, help me. I will be obliged.
thanks
June 22nd, 2007 at 6:52 am
Hello Imtiaz,
thanks for the information I was able to install every thing but I switched php4.4 with php5.2 and got every thing installed. I installed mplayer last as I missed it. Will it be a problem.
My question is on dreamhost you have separate folders per each domain. So where should I create cgi-bin directory and where should I place the .htaccess file.
Can I put the environment variables somewhere so that I need not edit all the php files where ffmpeg is called?
June 25th, 2007 at 2:46 am
I followed this tutrial and everything went well.
Towards the end I needed to hire Imtiaz to get everything to work with my script.
Within 24 hours of contacting Imtiaz I had my script up and running with no further issues.
He quoted me a fair price for the work that I needed and I would highly recomend him and his services to anyone wishing to set up FFMPEG etc.
I told Imtiaz exactly how I wanted things to run and that’s exactly what I got.
No messing, No Misunderstandings, No confusion.
Take my advice, stop strugling and get a professional on the case.
I am more than happy with the services and the speed of the services and would gladly recomend Imtiaz to anyone wishing to install all these things.
http://www.netbrix.net/archives/39
Without a doubt, If I ever need anything in this are of expertise doing again, I know who I’m gonna call!
Stop pulling your hair out, spend a few bucks and get it done right!
Thanks again Imtiaz!
Great work!!!!
Mike (Completely 101% Happy Customer)
June 28th, 2007 at 2:44 am
Thanks to your excellent instructions I have a fully working version of ffmpeg and ffmpeg-php on my Bluehost shared hosting account.
I can now transcode well and make thumnails using ffmpeg and ffmpeg-php
Just one thing..the enable falg on ffmpeg compilation is
–enable-libmp3lame
Thanks a tonne ..and i would recommend Bluehost to get all this compiled.
HJ
July 4th, 2007 at 11:53 am
Arian: I had the same problem as you. Check out this message:
http://www.redhat.com/archives/fedora-list/2004-December/msg07707.html
The poster suggests installing the php-devel package which should contain the phpize utility.
July 30th, 2007 at 4:08 pm
Hi Imtiaz, I have a problem when I close my ssh conection , because before that I can encode and use the ffmpeg program very well. but when I close my ssh conection after I install and play with ffmpeg , and I try to use it again the following error outputs:
error while loading shared libraries: libavformat.so.51: cannot open shared object file: No such file or directory
but the libavformat.so.51 already exists in the lib folder.
When I run the ffmpeg program succesfully a litle notice outputs :
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. Do not report crashes to FFmpeg developers.
frame= 456 fps=120 q=31.0 Lsize= 406kB time=30.4 bitrate= 109.3kbits/s
but it works, the real missworking happens when I close the ssh conection
I will apriciatte your help
sorry form my bad english
Regards!
July 30th, 2007 at 4:39 pm
Hi , it’s me again, I think I resolve the problem ,’of provisional form’, when I do a new ssh conection to my server i have to declare this variable:
export TMPDIR=$HOME/tmp
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH
export CPATH=$HOME/include:/usr/local/include:$CPATH
export LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LIBRARY_PATH
the quiestion here , is , how can I to leave these declared variables of permanent form
August 10th, 2007 at 7:49 am
hi Miguel,
Put those in you profile (usually ~/.bash_profile but will differ from shell to shell)
October 1st, 2007 at 12:24 pm
Thanks for this. I am creating a new site with a section for uploading videos. I am using Drupal and its FlashVideo Module.
I just installed lame+ffmpeg and it works! My project site is hosted over at Site5 with a shared hosting account.
November 25th, 2007 at 1:23 pm
Hi,
I’m on the part on installing ffmpeg after entering this line
./configure “–prefix=$HOME” “–cross-compile” “–enable-shared” “–enable-mp3lame” “–extra-cflags=-I$HOME/include” “–extra-ldflags=-L$HOME/lib”
I’m getting an error:
Unknown option “-prefix=
please help
November 28th, 2007 at 3:52 am
I think it should be
--prefix=$HOME --cross-compile --enable-shared --enable-mp3lame --extra-cflags=-I$HOME/include -–extra-ldflags=-L$HOME/libFebruary 15th, 2008 at 5:22 pm
after installed php version 4.4.4 I came this error
[pandora]$ php -r ‘phpinfo();’ | grep ffmpeg
PHP Warning: Unknown(): Unable to load dynamic library ‘.//home/vietpro/lib/ffmpeg.so’ - .//home/vietpro/lib/ffmpeg.so: cannot open shared object file: No such file or directory in Unknown on line 0
Error in argument 1, char 2: option not found r
thanks
February 18th, 2008 at 2:53 am
I followed instruction and it is terrific.
I used this to configure,
./configure “–prefix=$HOME” “–cross-compile” “–enable-shared” “–enable-libamr-nb” “–enable-libamr-wb” “–enable-libmp3lame” “–enable-libvorbis” “–enable-libxvid” “–extra-cflags=-I$HOME/include” “–extra-ldflags=-L$HOME/lib” “–enable-gpl” “–enable-nonfree”
and make / make install runs smoothly.
But when I use this command
ffmpeg -i source target.flv to convert movie, I met this error:
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. You may try recompiling using gcc >= 4.2.
Do not report crashes to FFmpeg developers.
Input #0, mpeg, from ‘MOV01615.MPG’:
Duration: 00:01:07.2, start: 0.110000, bitrate: 2913 kb/s
Stream #0.0[0×1c0]: Audio: mp2, 32000 Hz, mono, 64 kb/s
Stream #0.1[0×1e0]: Video: mpeg1video, yuv420p, 640×480 [PAR 1:1 DAR 4:3], 104857 kb/s, 25.00 tb(r)
Output #0, flv, to ‘demo3.flv’:
Stream #0.0: Video: flv, yuv420p, 640×480 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25.00 tb(c)
Stream #0.1: Audio: libmp3lame, 32000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
[libmp3lame @ 0×2aadd5ebf800]flv does not support that sample rate, choose from (44100, 22050, 11025).
Could not write header for output file #0 (incorrect codec parameters ?)
And output file has no sound. Any idea? What GCC 4.2 means to me? I installed on the bluehost account.
Thanks.
February 18th, 2008 at 6:57 am
Hi Frank,
Try the following instead:
ffmpeg -i source -ar 22050 target.flv
March 4th, 2008 at 10:02 am
hey - you are a genius! this is brilliant, i have it working on bluehost, kind of…
i want to script the conversion of .amr to .mp3s using shell scripts.
have found that i do need to export the environment variables to avoid error executing ffmpeg.
however when i script this it doesn’t seem to have any effect. If you could help i’d really appreciate it - i have a .sh file which has been chmod 755ed and in it is:
#!/bin/bash
export TMPDIR=$HOME/tmp
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH
export CPATH=$HOME/include:/usr/local/include:$CPATH
export LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LIBRARY_PATH
as i say, when i execute is i get no output to screen and ffmpeg still doesn’t work…
thanks again…
nick
March 6th, 2008 at 11:38 pm
Hi Nick,
What is the rest of the shell script. More important what is the actual command that you are using to run the conversion.
March 9th, 2008 at 9:00 am
Just a few days ago i had ffmpeg-php working. then i got the bright
idea to try to add a codec to ffmpeg. so i re-installed ffmpeg and
then ffmpeg-php. i then noticed this error which i did NOT get before.
Fatal error: Call to a member function togdimage() on a non-object
$movie = new ffmpeg_movie(”testmovie.wmv”);
$cap = $movie->getFrame(1);
$img = $cap->togdimage();
that is my php code. (i have also tried MANY different movie types)
now i have figured out that all functions called from $cap return that
error, $cap returns false, but am not sure why. i have not changed
this code at all, yet it worked before this.
I have the latest ffmpeg, the latest ffmpeg-php, the latest php, and
the latest gd library installed.
also, in an outputted phpinfo() page, it says that ffmpeg-php is
installed correctly. i also printed out:
get_class_methods(”ffmpeg_frame”)
and
get_class_methods(”ffmpeg_movie”)
and that returns all the functions, they are all there, including
togdimage.
when configuring php, i have read mixed ideas. some say to use –with-
gd, and some say –with-gd=shared. i have tried both, with no success
with either.
here is my configuration command for “ffmpeg” TMPDIR=”/tmp2″ ./configure –enable-libmp3lame –enable-libvorbis –disable-mmx –enable-shared
a) if i don’t have the TMPDIR=”/tmp2″ there, it will say “Unable to
create and execute files in /tmp. Set the TMPDIR environment
variable to another directory and make sure that /tmp is not mounted
noexec. Sanity test failed.”. but the /tmp2 dir does exist and is
chmodded 7777.
b) i have installed libOGG many times but when i have –enable-libogg
as an option it says “Unknown option..” so i just take it out.
and for ffmpeg-php i dont use any configuration parameters. once
ffmpeg-php is installed, i go to “/usr/local/lib/php/extensions/no-debug-non-zts-20060613/” and copy ffmpeg.so to “/usr/local/lib/php/extensions/” (one directory up), and in my php.ini file i have:
extension_dir = “/usr/local/lib/php/extensions/”
extension=ffmpeg.so
in my phpinfo(), it DOES recognize ffmpeg-php. but the functions out
of the class wont work.
Can anyone further help me debug this problem?
April 13th, 2008 at 1:31 am
I’m having problems with the same problems with the phpize/autoconf step for FFMPEG-PHP.
I just noticed that when I run phpize, I get this:
[xxxxxx]$ phpize
Configuring for:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
But, in from phpinfo(), I get this:
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
So, obviously, phpize is looking at the wrong version of php (I compiled php5 with FastCGI support using this: http://wiki.dreamhost.com/Advanced_PHP_configuration
So, can anyone tell me how I can make it pick up my new php, and use it to compile ffmpeg-php? It’s the only thing I still need to get a video mod of mine working
April 13th, 2008 at 6:45 pm
Hi Rasengan,/bin is where you have all the binaries(php, phpize, php_config etc) then run the following:
You will need to tell the shell to look at the installed PHP in your home dir.
This you can do by setting the PATH system variable.
So if /home/
export PATH=/home/user/bin:$PATH
To check run:
which phpize
This should return /home/user/bin/phpize
then do the phpize etc.
Also as listed here you will need the auto conf setup to make it all work.
Cheers
April 21st, 2008 at 3:39 am
Hi I try to install ffmpeg when i use this command “./configure –prefix=$HOME –cross-compile –enable-shared” I am getting this message Unknown option “–cross-compile”., can you tell me why i got this error? i also try to install ffmpeg-php
after install i didnt find ffmpeg.so file i check all folder but i didnt find it anywhere. how ca i fix this?
April 21st, 2008 at 4:32 am
Hi jigs,
The reason that happened is because the version of ffmpeg you are using is different from what I used. Please replace –cross-compile with –enable-cross-compile to make it work
Also if you run into similar problems run a ./configure –help to see a list of all options available.
ffmpeg.so wont happen because the ffmpeg failed to compile to begin with and so the extension cant be built.
April 26th, 2008 at 10:46 pm
Hello
BIG THANKS to all of you for your information.
I have just ONE question.
When I hit my “test_ffmpeg.php” in my browser and I get THIS ERROR . . .
Can’t load extension /usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so
But the .so EXISTS at /home/cooolest/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so location!
What’s up with that???????
Anyone can help????
April 28th, 2008 at 10:15 pm
Hi coolest,
you need to edit your php.ini and change the path to the extension_dir to /home/cooolest/lib/php/extensions/no-debug-non-zts-20060613/
If you need help installing let me know.
October 5th, 2008 at 12:01 am
Hi i have this problem:
~/src/lame-3.97]$ ./configure “–prefix=$HOME” “–enable-shared”
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for gawk… gawk
checking whether make sets $(MAKE)… yes
checking whether to enable maintainer-specific portions of Makefiles… no
checking for style of include used by make… GNU
checking for gcc… gcc
checking for C compiler default output file name… configure: error: C compiler cannot create executables
See `config.log’ for more details.
———————–
gcc
-jailshell: /usr/bin/gcc: Permission denied
what i have to do? thx
October 12th, 2008 at 2:04 pm
I think ive given setting this up a good enough. I mainly wanted to do it myself to learn. I would like you to set the rest of my failed attempt up but would really wanna know what you had to do to fix it. It’s more for my personal knowledge than for getting the site up. lemme know if you can quote me.
October 12th, 2008 at 5:06 pm
Isaac,
It looks like you’re missing the c++ compiler. Please have theh ost install the package gcc-cpp or gcc-c++