One-stop Installation Guide for Create a Linux Server-side FLV conversion environment

2007-8-6 Update: Based on the my own FLV conversion knowledge, I have started a Web 2.0 service call – VCASMO. It is a video + PowerPoint online presentation platform.

If you want to convert other video format to FLV (sorenson codec), everybody will suggest using FFmpeg. In fact, only FFmpeg is not enough for successfully create a server-side command line conversion environment to create FLV with video and audio, plus the FLV 1.1 metadata information. I have stroked for a whole day to setup my Linux server (Fedora Core 3), so I wrote down my note here for other people and myself as a reference.

Purely install FFmpeg is not enough, the FLV converted has no audio, because FLV audio codec is mp3, so you need LAME support. Moreover, the FLV converted has no metadata, you cannot know the dimension, duration such important information for a FLV player swf. Therefore, you need another free tool: FLVTool2, which is written in Ruby, so I have to install Ruby in my server, too.

Overall installation order: LAME->FFmpeg->Ruby->FLVTool2, if you want to access video info through FFmpeg in php, you can install ffmpeg-php, too.

Please login as root first:

Install LAME
Download from LAME site, type the following command to compile and install it:
./configure --enable-shared --prefix=/usr
make
make install

enable-shared to make sure FFmpeg can use LAME later. Type lame in command line to see help after install succeed.

Note: you can also use yum to install FFmpeg, it will install dependency LAME, too, so you can skip this step.
yum install ffmpeg

Install FFmpeg
Download from FFmpeg site through CVS, type the following command to get the latest copies from CVS and save to your $home (currenly path after login into consule) with folder name “ffmpeg”:cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
To compile and install it, type the following command:
./configure --enable-gpl --enable-mp3lame --enable-shared --prefix=/usr
make clean && make
make install

enable-shared to make sure ffmpeg-php can use FFmpeg later (if you do not use ffmpeg-php, you do not need –enable-shared –prefix=/usr). Type ffmpeg in command line to see help after install succeed.

Note: you can also use yum to install FFmpeg:
yum install ffmpeg

Install Ruby
Download from Ruby site, type the following command to compile and install it:
./configure
make
make install

Install FLVTool2
Download from FLVTool2 site, type the following command to compile and install it:
ruby setup.rb config
ruby setup.rb setup
sudo ruby setup.rb install

Type flvtool2 in command line to see help after install succeed.


Installation is completed here. If you want to access video infomation easily in php, there is a ffmpeg-php you can try. You can follow the instruction inside the package to install it. I installed it as a Shared Extension and did not edit php.ini to add extension=ffmpeg.so When I try its test_ffmpeg.php to verfiy the installation. I saw an error:Unable to load dynamic library './ffmpeg.so' - ./ffmpeg.so: cannot open shared object file: No such file or directoryYou have to copy ffmpeg.so to your php extension folder, or like me, I just copy the file to the same folder of the php script is located.

Follow up

Other Reference

89 Replies to “One-stop Installation Guide for Create a Linux Server-side FLV conversion environment”

  1. Hey Kay-Rules, thanks for the info! It helped me as I too was having Kim’s problem.

    Thanks again.

  2. Thanks for the step by step guide.

    Like others even I am having the audio problem. ffmpeg converts my video files to flv but without sound. I also tried to install with ./congifure –enable-libmp3lame but no success.

    Does any one have a solution for this.

    Cheers,
    Sudar

  3. Nice one mate. I only used the section to get ffmpeg working for flv and sound! And it worked a treat. Big thank you!

  4. Pingback: Embedding Flash
  5. i installed cvs from this location…….. http://home.wanadoo.nl/cwdegier/cvs.html

    i create username and passwd as,
    [root@ksangam /]# htpasswd -d /home/cvsroot/passwd henk
    New password:(henk)
    Re-type new password:(henk)
    Updating password for user henk
    [root@ksangam /]# cvs login

    [root@ksangam /]# export CVSROOT=:pserver:henk@ksangam:/home/cvsroot
    [root@ksangam /]# cvs login
    Logging in to :pserver:henk@ksangam:2401/home/cvsroot
    CVS password:(henk)
    Fatal error, aborting.
    henk: no such user….

    its giving error, what to do? plz

  6. I cann’t agree totally, i am engaing in exactly the server-side command line conversion to creat FLV with video, and audio.
    However, i didn’t directly go to FFmpeg, i’ve tried and tested several versions, command line, desktop applications, or SDK,finding a SDK works excellently. It is called Flash Video MX SDK V2, which indeed works for me quite well.

    Not only this but thumbnail picture grabbing, video trimming, cropping, and batch conversion are all available
    Well, i trust it will give you a pleasant impression. Anyway, try and see:

    http://www.flvsoft.com/flv_encoder_sdk/

    ================
    If you want to convert other video format to FLV (sorenson codec), everybody will suggest using FFmpeg. In fact, only FFmpeg is not enough for successfully create a server-side command line conversion environment to create FLV with video and audio, plus the FLV 1.1 metadata information. I have stroked for a whole day to setup my Linux server (Fedora Core 3), so I wrote down my note here for other people and myself as a reference

  7. I have created wmv file from bitmaps using ffmpeg,but i could not have to control duration of the created wmv,I want to control it,but i have no idea,please help me..

  8. in order to include sound in the flv on linux
    use the option -acodec libmp3lame -ar 22050
    (libmp3lame must also be enabled at compilation of ffmpeg)

  9. I want to upload an audio by splitting it into two parts, I mean to say that the output audio file must be of less duration compared to orginal one.

  10. Nothing works. From step one, all I get is ‘command not found’.

    What could I be doing wrong. Especially if Im typing everything directly as written in tutorial.

    Help is very important.

  11. Pingback: Heel Toe
  12. i am using ffmpeg.exe tool to convert any video file format to .flv file it is working in localhost correctly but it is not working
    in the server…..

    any one help me…

  13. Hi. I followed all the steps above and tried to execute ffmpeg, ffserver.
    But, I got error message for
    ffmpeg –>
    ffmpeg : error while loading shared libraries : libavdevice.so.52: cannot open shared object file : no such file or directory

    ffserver –>
    ffserver : error while loading shared libraries : libavformat.so.52: cannot open shared object file : no such file or directory

    Thanks.

  14. Cheers

    Whenever I try to burn a music CD on iTunes it makes this odd clicking sound and doesn’t end up burning the CD.
    I tried using the regular drag and drop onto the DVDRW burning folder itself and it still makes this odd clicking noise.
    I’m using esperanza DVD and they worked fine when I first got them then all of a sudden it’s doing this.
    I’ve tried another brand of disk (noname) and it’s still making the same noise…

    Any advice anyone?

    _________________
    Best fapturbo

Comments are closed.