How to install ffmpeg-php to create thumbnails from videos?
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: How to install ffmpeg-php to create thumbnails from videos?

  1. #1
    Senior Member iBuddy's Avatar
    Join Date
    Jun 2003
    Location
    Colorado
    Posts
    253

    How to install ffmpeg-php to create thumbnails from videos?

    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?
    phpbuilder.com is my spot for PHP discussion

  2. #2
    Senior Member iBuddy's Avatar
    Join Date
    Jun 2003
    Location
    Colorado
    Posts
    253
    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.
    phpbuilder.com is my spot for PHP discussion

  3. #3
    Junior Member
    Join Date
    Aug 2006
    Posts
    1

    ffmpeg needs to be built from source with shared option

    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!

  4. #4
    Junior Member
    Join Date
    Sep 2006
    Posts
    2

    ffmpeg-php

    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.

  5. #5
    Member
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    45

    Talking

    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 Code:
    <?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!

  6. #6
    Junior Member
    Join Date
    Sep 2006
    Posts
    2
    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).

  7. #7
    Member
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    45
    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.

  8. #8
    Junior Member
    Join Date
    Oct 2006
    Posts
    3
    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!!

  9. #9
    Senior Member iBuddy's Avatar
    Join Date
    Jun 2003
    Location
    Colorado
    Posts
    253
    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.
    phpbuilder.com is my spot for PHP discussion

  10. #10
    Junior Member
    Join Date
    Oct 2006
    Posts
    3
    Quote Originally Posted by iBuddy
    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!

  11. #11
    Senior Member iBuddy's Avatar
    Join Date
    Jun 2003
    Location
    Colorado
    Posts
    253
    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.
    phpbuilder.com is my spot for PHP discussion

  12. #12
    Junior Member
    Join Date
    Oct 2006
    Posts
    3
    Quote Originally Posted by iBuddy
    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

  13. #13
    Junior Member
    Join Date
    Oct 2006
    Posts
    6

    Exclamation ffmpeg-php for youtube script installation

    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..

  14. #14
    Junior Member
    Join Date
    Dec 2007
    Posts
    1
    I want to the same future

  15. #15
    Junior Member
    Join Date
    Jun 2008
    Posts
    1
    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&#180;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");

    ?>
    Last edited by method007; 06-05-2008 at 11:47 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •