These are the components you need
1. FFMPEG : to convert to flash
2. FLVTOOL2: to insert meta data that are required by a flash player to play flash
3. FlowPlayer: Though not need for the conversion, you can use FlowPlayer to play the flash file. To test the conversion you can even use mplayer , how ever mplayer does not need meta data info , thus a flv file playable through mplayer might not be playable by a flash player.
1. First of all make sure that you have the environment ready for compiling and you are familiar with compiling/installing PHP extensions(PHP extension requirement is for ffmpeg-php that will be covered in the next post).you can refer to http://r4vi.org/index.html/?q=node/38
for some help.
2. you can do an apt-get install for FFMPEG
apt-get install ffmpeg libpostproc0d libpostproc-dev libavifile-0.7c2 libavformat0d libavcodec-dev libavcodec0d libavformat-dev
This is more than enough for normal media conversions , but not for FLV creations. the reason is FLV uses mp3 for audio and default apt-get does not have the mp3 encoder.
so you need to download the source from http://ffmpeg.mplayerhq.hu/download.html
for me it was easier to do the download than the SVN.
3. Then before installing you might need to install lame.
I am not sure whether you need this step as ffmpeg source might contain the required code, how ever i had lame installed before ffmpeg source compilation, so you might as well do that.
install lame libraries
Add in your /etc/apt/sources.list
deb http://www.debian-multimedia.org lenny main
or
deb http://www.debian-multimedia.org testing main
and then do
apt-get install lame lame-extras liblame-dev liblame0
you should now have libmp3lame.so in /usr/lib
4. since i need mp3 encoding do a source compilation. The best source i found for this was http://vexxhost.com/blog/2007/03/03/installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-libogg-%E2%80%93-the-easy-way/
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
remember the --enable-libmp3lame part as that is the reason we are compiling from source to enable mp3 encoding through lame.
echo '#define HAVE_LRINTF 1' >> config.h
then make
and then make install
then repeat the other steps mentioned in the above mentioned tutorial.
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.5
i got an error for libmp3lame.so.0 , which is because i had installed lame before, so thats why i think you might not need to install lame , as ffmpeg install produces the libmp3lame.so.0.
well that should be enough for ffmpeg install. test by converting a media file, and in the conversion if you see notices of missing codecs ( like i did for mp3), then you might have to download them and put inside the ffmpeg , libavcodec directory and recompile with those codec support.
4. next step is FLVTOOL2, since its ruby based you will have to install ruby first
apt-get install ruby rbot ruby1.8-examples rdoc1.8 ri1.8