Home » Cakephp, Linux, PHP

flv, ffmpeg and PHP: File conversion

25 May 2009 204 views View Comments admin

Hi friends,

2 days ago I got a project in which I have to upload avi, mpeg or 3gp movie clip and convert this clip to flv as well generate thumbnail for this video. I know that this can be done through ffmpeg. But I didn,t know how haha..

Well I searched enough and start making environment for development. I did following mistakes.. I am listing those  mistakes. I am 100% sure it will save your day.

I was using Windows environment: FFmpeg is primarily made for Linux environment not for windows. Some experts developed windows version of ffmpeg.  Some functions are unavailable in windows version. SO I suggest you to use Linux environment.

I thought that only ffmpeg can do everything: FFmpeg is a command line tool to do video related task (only video) such as clipping, video conversion, frame extraction etc. But for the sound, watermarking you have to use other packages too. I will tell about these details later.

php-ffmpeg and ffmpgeg: I was very much confuse between php-ffmpeg and ffmpeg. I after 30 minutes of googling I came to know that ffmpeg-php is extension for php which provide handy functions to convert videos and if you use ffmpeg then you have to use exec() command to execute ffmpeg commands.

Step by step procedure to convert video:

1. Setup Linux system.. forget that windows can do the job!

2. follow instructions and install all required modules. here is comprehensive step by step procedure available http://vexxhost.com/blog/2007/03/03/installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-libogg-%E2%80%93-the-easy-way/ . if you face any problem then you can ask me.

Remember: Installation order  LAME->FFmpeg->Ruby->FLVTool2

3. Now you have successfully setup environment. Download any example from net and run.

The  best thing I got is videotoolkit you can download it from Here . It saved my day. you can also try it. It’s really worth to try this!

Hope this article will helpful. If you still have any problem then ask.. Happy coding….

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Post to Twitter

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
  • Great tricks ;)
  • Katılmıyorum ;)
  • Shishir
    plz tell me how can we convert videos into flv and make thumbnail in windows environment using php. plz show me small program in php.
    my mail id is shishirsunny222938@gmail.com
    @gmail:disqus 
    thanks
  • Navdeep Sharma
    Respected Dear,

    will you tell me where i got this tool flvtoo2 i m searching this tool but i cant find it
  • abhinavzone
    =======================================
    To join Facebook, please follow the link below: http://www.facebook.com/r.php?... =======================================

    Hi,

    The following person invited you to be their friend on Facebook:

    Abhinav Varshney (Invite sent: May 13, 2011)

    Facebook is a great place to keep in touch with friends, post photos and videos, and create events. But first you need to join! Sign up today to create a profile and connect with the people you know.
    Thanks,
    The Facebook Team

    To join Facebook, please follow the link below: http://www.facebook.com/r.php?...
    =======================================
    The message was sent to If you don't want to receive these emails from Facebook in the future, please follow the link below to unsubscribe. http://www.facebook.com/o.php?... Facebook, Inc. P.O. Box 10005, Palo Alto, CA 94303
  • abhinavzone
    =======================================
    To join Facebook, please follow the link below: http://www.facebook.com/r.php?... =======================================

    Hi,

    The following person invited you to be their friend on Facebook:

    Abhinav Varshney (Invite sent: May 13, 2011)

    Facebook is a great place to keep in touch with friends, post photos and videos, and create events. But first you need to join! Sign up today to create a profile and connect with the people you know.
    Thanks,
    The Facebook Team

    To join Facebook, please follow the link below: http://www.facebook.com/r.php?...
    =======================================
    The message was sent to If you don't want to receive these emails from Facebook in the future, please follow the link below to unsubscribe. http://www.facebook.com/o.php?... Facebook, Inc. P.O. Box 10005, Palo Alto, CA 94303
  • abhinavzone
    Hi,

    Elrada Technologies is inviting you to join Facebook.

    Once you join, you'll be able to connect with the Elrada Technologies Page, along with people you care about and other things that interest you.

    Thanks,
    Elrada Technologies

    To sign up for Facebook, follow the link below:
    http://www.facebook.com/p.php?...

    You are receiving this email from Elrada Technologies. Elrada Technologies has sent you this message through Facebook. If you no longer want to receive messages through Facebook, click the link below.
    http://www.facebook.com/o.php?...
    Facebook, Inc. P.O. Box 10005, Palo Alto, CA 94303
  • abhinavzone
  • abhinavzone
    @letsnurture Try this on linux. as mentioned above you need these software before proceeding "LAME->FFmpeg->Ruby->FLVTool2" !
    this FFMPEG is made for linux, so work better on linux.
    You will get problem with really large videos on linux environment ( > 1GB ). To resolve this you need to increase SWAP size.
  • Hi Kunali,

    I've got in same scenario. I mean I need to convert media type for example mpeg,avi into flv. I'm using JW player to play these videos.

    Now using FFMPEG, i can convert the small video but I could not convert large video(around 100 Mb). I'm experimenting this stuff on window environment

    Do you have any idea how can I convert the large video into FLV using ffmpeg.

    Will things gonna be all right if i use Linux?

    Thanks
    SachIN
  • Anil
    How to instal FFMPEG in online server.
  • Anil
    how to setup FFMPEG in Online server
blog comments powered by Disqus