www.mediacollege.com | Support Forum
MC Media Player
  • PHP4FFprobe

PHP4FFprobe

This is my bridge to run FFprobe from php.For those who don't know what's FFprobe is, this is a simple multimedia streams analyzer with a command-line interface based on the FFmpeg project libraries. I initialy wanted the filepositions but now we got a gui, that's the fault to Stefano that has catched my attention ;p

History / Updates:

28.02.2011:  PHP4FFprobe-4.0 simply bring graphs into reality and made Michael Rampe's dream for bitrate coming true thanks to phpgnuplot! My project was today registered as one of the ffmpeg official project, it may mean I passed today the FFmpeg exam sucessfully. By the way, let Michael learn about this thanks to this suprise link ;)

26.02.2011: The PHP4FFprobe 3.0 has an improved gui and core, ffprobeinfo() now works and displays even the ffmpeg modules version and has some overview candies joigned!

25.02.2011: The PHP4FFprobe-2.0 brings a big surprise. As you can see, the screenshots at the bottom of this page don't lie about it

24.02.2011: Version one annouced in download only

I - Basic usage for the impatient

Download PHP4FFprobe (all the versions are here) and browse index.php from a webserver.
You will got errors because you need to change the path in lib/ffprobe.php to point your ffprobe directory

II - Requirements

  1. FFprobe SVN

    FFprobe binary is not provided , FFprobe from ffmpeg wont work here, so you will have to compile the SVN version (more up to date than ffprobe provided within the ffmpeg package) to make it work. To do so on windows, use Cygwin with all libs and dev tools included. First, it requires some libs from ffmpeg to compile correctly.

    $ svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
    $ cd ffmpeg
    $ ./configure --prefix=/usr --enable-shared
    $ make
    $ make install
    						
    don't forget to use --prefix=/usr -enable-shared when compiling ffmpeg else libs won't be seen by ffprobe.

    I used svn to get the latest version like Michael Rampe recommended.
    $ svn co https://ffprobe.svn.sourceforge.net/svnroot/ffprobe/trunk ffprobe
    $ cd ffprobe
    $ ./configure --prefix=/usr --enable-shared
    $ make
    $ make install
    						
    This pulled down SVN-R92 of FFprobe.this version definitely does support the -show_frames option required here and -formats displays the list of Codecs needed to make the translation between codec_name and codec_type.
  2. PHP server

    Of course,as php4ffpobe requires php so you will have also to use a WAMP or LAMP system. There is for sample Uwamp on windows. Regexp support is required.

III - FAQ

  1. Compatibility?

    I have not tested the php4 full compatibility, should be ok I presume.

  2. Future?

    I am lacking time and interests to get rid of gnuplot using graphpite. Hey, we have to do some choices sometimes thus I just pluged it into phpGnuplot. All is ready, need a volunteer to reproduce gnuplot features by expanding graphpite, anyone? Latest release will be in: http://falun.dafa.is.free.fr/altair/download/PHP4FFprobe/

  3. Origin?

    I was on my ffprobe way to validate keyframes's filepositions. Suddently, I saw an incredible cow on the road, its name was Michael Rampe. It was a creative gnu one, rare space-I from Australia, that can generate nice video/audio bitrate curves. As a space cowboy, I tried to catch the cow scripts but they did only let me grap the video side of the corn. This was due to that grep which was making no distinctions between Audio/video part.
  4. Impressive?

    Not yet? Let's solve this with these samples where ffprobeinit() was called before.

    a)Complete dump of ffprobeinfo();

    b)Partial dump of ffprobeinfo('mario.flv'); or index.php?file=mario.flv)

  5. Funny story?

    So let's talk by finishing with the greetings and things great... I would like to thanks Michael Rampe for sharing this and Stefano Sabatini for his great ffprobe tool (and the first answer he gave me on #ffmpeg ! doh I was facing the ffprobe's author without knowing it ;p ) , Usually, like incredible things I do, nothing was planned before. However, my strategy still remains the same: when I meet nice people with nice project behind, I contribute. Thus, Stefano, I dedicate this project to you and as it is released under the terms of the license GPL, you can include my work as an extension in the ffprobe source tree. Cheers, Actarus