Click to See Complete Forum and Search --> : How to install ffmpeg-php to create thumbnails from videos?


iBuddy
08-12-2006, 01:26 AM
I'm trying to install this extension:
http://ffmpeg-php.sourceforge.net/


I dont understand this part:

Run autoconf in your php source directory to update the configure script.

1. cd /path/to/php_sources
2. autoconf

Configure PHP with the ffmpeg option.

1. ./configure [other options...] --with-ffmpeg=yes


im at /usr/local/lib/php and do not see anything about autoconf?

iBuddy
08-12-2006, 01:36 AM
I get this error after putting "make install"

checking for ffmpeg headers... configure: error: ffmpeg headers not found. Make sure you've built ffmpeg as shared libs using the --enable-shared option
root@server [/usr/local/lib/php/extensions/ffmpeg]# make clean && make
make: *** No rule to make target `clean'. Stop.
root@server [/usr/local/lib/php/extensions/ffmpeg]# make install
make: *** No rule to make target `install'. Stop.
root@server [/usr/local/lib/php/extensions/ffmpeg]#


when i put "./configure --enable-shared --prefix=/usr"
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20020429
checking for re2c... exit 0;
checking for gawk... gawk
checking for ffmpeg support... yes, shared
checking for ffmpeg headers... configure: error: ffmpeg headers not found. Make sure you've built ffmpeg as shared libs using the --enable-shared option
root@server [/usr/local/lib/php/extensions/ffmpeg]#


=-------------------
directions
--------------------
BUILDING FFMPEG
---------------

cd /path/to/ffmpeg
./configure --enable-shared --prefix=/usr
make clean && make
[become root]
make install


BUILDING FFMPEG-PHP AS A SHARED EXTENSION
-----------------------------------------

1. Build php if not already built (See the file INSTALL in your php source directory)

2. Unpack the archive and copy the ffmpeg extension directory into your the
php sources extensions directory

tar -xjf ffmpeg-php.X.XX.tar.gz
cp ffmpeg /path/to/php_sources/ext

3. cd into the ffmpeg extension directory

cd /path/to/php_sources/ext/ffmpeg

4. Run phpize (included in the php installation) to build configuration files

phpize

5. Configure and build

./configure && make

6. Install the shared extension

make install (you may need to become root depending on your installation)

If everything went as planned, ffmpeg-php is now installed as a shared library.
You must explicitly load it in your scripts using dl(ffmpeg.so) or if you want
it available to all scripts by default add extension=ffmpeg.so to your php.ini
file which will tell php to load it when starting up.


BUILDING FFMPEG-PHP AS PART OF THE PHP BINARY
---------------------------------------------

1. Unpack the archive and copy the ffmpeg extension directory into your the php
sources extensions directory

tar -xjf ffmpeg-php.X.XX.tar.gz
cp ffmpeg /path/to/php_sources/ext

2. Run autoconf to rebuild the php configure script and add the --with-ffmpeg
option

cd /path/to/php_sources
autoconf

2. configure php using...

./configure --with-ffmpeg=yes

...and build and install php.

The ffmpeg-php methods should now be built directly into php and so no need to
explicitly load the extension at runtime.

phpuser3491
08-18-2006, 01:52 PM
Hi,

You need to download ffmpeg and build from source if you haven't already done so. Uninstall your current ffmpeg installation or package before you begin.

First, you'll need to install the subversion client which lets you download source code if you don't already have it. Check your distribution for a subversion package you can install.

Then see http://ffmpeg.mplayerhq.hu/download.html for the download instructions to get the source code. As it says, you'll need to run:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

This will get the source code for ffmeg.

cd to the ffmpeg directory, the run:

./configure --enable-mp3lame --enable-libogg --enable-vorbis --enable-shared

If you don't have lame, or ogg, or vorbis installed, remove any of those parameters. The main thing is that "--enable-shared" needs to be turned on.
What this does is build the ffmpeg libraries as shared files, which will make it
possible for ffmpeg-php to use these same libraries when you build it.

Then do make and make install to install ffmpeg (it will go into /usr/local/ directories).

After you've done this, go back to the ffmpeg-php source and try configure and make once again. Should work this time.

Good luck!

onemoverx
09-05-2006, 10:51 PM
hi,

I can't download de ffmpeg source from svn but I already downloaded some souces but It doesn't work. Can you tell me where I can download the source of ffmpeg and how to build it to use it in php.

thanks for all.

Salkcin
09-05-2006, 11:05 PM
Download the latest version from:
http://ffdshow.faireal.net/mirror/ffmpeg/

Install:
unzip it to a folder on your computer. thatīs all! ;)


This is how I use ffmpeg and PHP
<?php

// movie.avi.... name of the movie you want to take a screenshot from
// 00:00:00.... Where in the movie do you wanna take your screenshot, 10 seconds from start? ex: 00:00:10
// picname..... name your generated pic

exec("START c:/ffmpeg/ffmpeg -vcodec png -i movie.avi -ss 00:00:00 -vframes frames picname%d.png");

?>

Thatīs about it!

onemoverx
09-05-2006, 11:29 PM
althought I cannot reach that address, I can see by the php code that you aren't using the ffmpeg-php extension but executing a system command (which sometimes is a little dangerous).

Salkcin
09-06-2006, 12:15 PM
The address works for me...

About the system commands, it depends on how you use it. I donīt see how calling ffmpeg this way would be dangerous.

slashQuit
10-14-2006, 12:12 AM
Hi, I just found this thread through a google search, i'm trying to use FFMPEG as well... Just wanted to know if the original poster got it to work. I want to use it to convert video formats to .flv (i've also go LAME to convert audio to .mp3)

Any advise or tips? I've never installed anything on a server before, or called it to execute. I want to have it execute on upload and do the conversion of the file.

Thanks!!

iBuddy
10-14-2006, 04:29 AM
It was a pain in the ass to finally get it installed. I had my host assist installing this because there was constant errors. Its not a very easy thing to install.

slashQuit
10-18-2006, 03:06 PM
It was a pain in the ass to finally get it installed. I had my host assist installing this because there was constant errors. Its not a very easy thing to install.

Did you use it just to take screenshots of the uploaded video, or to convert video files to .flv?

I'd like to do both, however, the most important is to convert to .flv

If you did do the conversion, how did you execute it using php?

Thanks!

iBuddy
10-18-2006, 03:11 PM
I used it for both. I haven't used it much since I got it on because I haven't had much time to play with it. I will try and find the php code I used for you.

slashQuit
10-18-2006, 09:58 PM
I used it for both. I haven't used it much since I got it on because I haven't had much time to play with it. I will try and find the php code I used for you.

That would be very nice of you :)

Appreciate it very much! I downloaded and installed FFMPEG on my server, hopefully it installed correctly. We'll find out once I put it together :D

scripteaze
10-20-2006, 05:18 PM
Ok,

1. tar -xjf ffmpeg-php-X.x.x.tar.gz
2. cp ffmpeg-php /path/to/php_sources/ext
Run autoconf in your php source directory to update the configure script.
1. cd /path/to/php_sources
2. autoconf


I already have php installed via yum, im on fedora c5. I dont see any php sources folder..Am i supossed to be reinstalling PHP as well???

I wish directions were a little more directional..

Please help me im almost bald from this.. :mad:

avadhesh
12-25-2007, 03:05 AM
I want to the same future

method007
06-05-2008, 10:26 AM
Hi all .I am running Apache/1.3.33 (Win32) and don't know how to instal this ffmpeg. I tried Salkcin php code but it never worked.The page takes for ever to load and nothing happens!! could any one tell me step by step on how to install ffmpeg in apache Apache/1.3.33 (Win32)(wamp server).Thanks


Download the latest version from:
http://ffdshow.faireal.net/mirror/ffmpeg/

Install:
unzip it to a folder on your computer. that´s all!


This is how I use ffmpeg and PHP


<?php

// movie.avi.... name of the movie you want to take a screenshot from
// 00:00:00.... Where in the movie do you wanna take your screenshot, 10 seconds from start? ex: 00:00:10
// picname..... name your generated pic

exec("START c:/ffmpeg/ffmpeg -vcodec png -i movie.avi -ss 00:00:00 -vframes frames picname%d.png");

?>

emranbd
08-10-2008, 03:47 AM
hi any once help me.

how i am available to install ffmpega wamp server or apache2triad

please help me if anyonce know .

thanks
regards
emran

Jaredzusmc
08-17-2008, 06:38 AM
Great question. Seems like this topic is more than 2 years old. I hope the original poster hasn't stopped watching...
:D
Similar issues here. Needing a bit more direction than what is already listed.
Objective: - convert/encode/trans-code uploaded video into alt. format.
* needs to be video.avi/xvid/mpeg/mov into .divx
- Any direction towards this goal..???
- (Matroska container support would be nice, but not necessary. I can enter values at the CLI for de-muxing)
:evilgrin: