background top

FFMPEG - What is it? What can it do for me?

MPEG (pronounced M-peg), which stands for Moving Picture Experts Group, is the name of a family of standards used for coding audio-visual information (e.g., movies, video, music) in a digitally compressed format. FFMPEG is an opensource software video converter. YouTube uses FFMPEG, as do many other video and audio websites on the web. Simply put, FFMPEG gives you the ability to manipulate mpegs in many ways. FFMPEG has a vast array of options and can be very overwhelming. If you’re going to be working in a PHP environment then there are a few helpful tools out there to help you hit the road running.

First you’re going to need to install FFMPEG on your server. There are many resources for that and it should be relatively easy to find some examples and tutorials to get this process completed.

Once you get FFMPEG installed, you’re going to want to install the FFMPEG-PHP extension for php. This process is also fairly straight forward - if you’re having trouble you can use Google to help you resolve any issues. Unless you want to re-invent the wheel for a specific reason there is a great class wrapper called PHP Video Toolkit, which I suggest grabbing and using.

PHP Video Toolkit provides access to both FFMPEG and FLVTOOL2, which allows you to quickly and easily get to work on your video manipulation project. One note I’d like to add is if you run into a bug with liblamemp3 you can edit the Video Toolkit php section and change liblamemp3 to mp3 and that should resolve any problems. I also highly recommend reading through every example that comes with the PHP Video Toolkit as it should save you some additional time.

Remember the most important command when you get started is “print_r($videotoolkit->getLastCommand());“.

Some additional resources I found helpful:

  1. ffmpeg-php google group
  2. howto manipulate audio and video
  3. man page for ffmpeg
  4. rpms for ffmpeg

2 Responses to “FFMPEG - What is it? What can it do for me?”

  1. buggedcom Says:

    Sweet PHP Video Toolkit’s first external blog post… just like to point out the mp3 bug you mention is fixed in version 0.1.3, it depends on how you compile in lame to ffmpeg as using the liblamemp3 codec only applies if ffmpeg is compiled with –enable-libmp3lame

    I’d also like to mention that if you having trouble installing ffmpeg-php then the PHP Video Toolkit also comes with a FFmpeg-PHP adapter class that emulates all of the functionality through pure php code.

    Also if you have any feedback I’d be glad to take it into consideration when working on 0.1.4 which will include joining of videos and php4 support.

  2. rtraction » Blog Archive » Command line, PHP & background processing Says:

    […] order to better get a handle on FFMPEG I downloaded the PHPVideoToolkit. The toolkit abstracts FFMPEG into a PHP class for easier manipulation. I created a script that […]

Leave a Reply