Convert videos to FLV format using ffmpeg

Among the many formats supported by ffmpeg there is the FLV format. The FLV format became relatively famous a few years ago, before the introduction of the <video> tag in HTML5. Then, it was one of the easiest ways to introduce video on any website.

The operation of these sites was somewhat complex as they required Flash add-ons, which were the ones who were actually able to play this video format.

In recent years, thanks to the introduction of the <video> tag and the support given by the latest versions of Internet browsers, this FLV format has fallen into disuse. Anyway we teach you how to convert any file to this format as it is still used in a few places, and can be useful.

Well, using the basic structure of ffmpeg command:

ffmpeg -i input_file [filters] output_file

All we have to do is to indicate ffmpeg to produce an output file type with the .flv extension. The same program will detect file extension output, and therefore it is not necessary (although it can be done) to specify the codec filters. In this example we will convert one file named video.avi into a FLV file called video.flv:

ffmpeg -i video.avi video.flv -hide_banner

As you can see, what ffmpeg does in this case it is to transform a video that has a video stream in mpeg4 format into one that has flv format. As a result we get a file video.flv in this format in a very fast conversion process because compressing a video using this video codec does not take too long.

If I may I should recommend avoiding this format, and using the better MP4 (with H246) and WebM (with VP8 or VP9) formats for your videos, as these formats will be compatible with virtually all existing broesers (between the two formats) and also they are formats that offer better image quality, with a much better compression (usually the videos in these formats occupy less than half space than the ones in FLV format)

    Did you find this article helpful?