Posts Tagged ‘flvtool2’

simple way to install flvtool2 on a centos server | 00.00 duration of a video?

Sunday, November 28th, 2010

During the conversion of videos to flv format using ffmpeg, most video scripts use flvtool2 to calculate the duration of the video and to make the thumbs, sometimes it so happens that although flvtool2 is installed on the server, the duration is not calculated and all videos come out a 00.00 duration or the thumbs aren’t created, in this case it s better to reinstall flvtool2.
A simple way to reinstall flvtool2 with out having to reinstall the all ffmpeg libraries is the scope of this post.
First, make sure you have the newest version of Ruby installed from the Site Manager.
Login to root of your server, I assume it is a Centos 5.5 and enter the following commands:

# cd /usr/local/src
# wget
# tar zxf flvtool2-1.0.6.tgz
# cd flvtool2-1.0.6
# ruby setup.rb config –prefix=/usr/local/
# ruby setup.rb setup
# ruby setup.rb install

this will install the application into /usr/local/bin for you, and that is all. You are done, To use it, you can use this:
# cat /var/videos/flv/video.flv | flvtool2 -U stdin /var/videos/flv/video.flv

this will add the metadata to the flv file so that media players can read the file correctly.

On the official flvtool2 page the description of flvtool2 is:
FLVTool2 is a manipulation tool for Macromedia Flash Video files (FLV). It can calculate a lot of meta data, insert an onMetaData tag, cut FLV files, add cue points (onCuePoint), show the FLV structure and print meta data information in XML or YAML.

Of course if you host your video site with us FFmpeg Hosting this problems will not arise!! 🙂