The first step in building my YouTube clone is making sure all the programs on the server work. If you remember from yesterday, I’m using FFmpeg and JW FLV Player.
Here are some great instructions for installing FFmpeg on a Linux server. Unfortunately my Google-foo was not so strong this morning and I ended up playing around for a while before I found that page. The real trick is making sure you have LAME installed before you compile FFmpeg.
After that, converting a video from QuickTime to FLV is a simple command like this:
ffmpeg -i movie.mov -ar 22050 movie.flv
The -ar option sets the audio rate on the FLV file. Flash movies are very particular about audio bit rate. It must be either 44,100, 22,050, or 11,025. FFmpeg is smart enough to resample the audio track. Depending on the format of your original file, you might also need to specify the audio codec with -acodec mp3.
The JW FLV Player comes with a sample HTML file. It was a simple matter to replace their Flash movie with mine in the HTML and adjust the parameters so it would be the right size on the page.
So far everything has been pretty painless. Tomorrow things will get more interesting when I start trying to fully automate this process.