Wednesday, January 27, 2010

How to convert avi to flv in Linux.

I did a couple of tests and these are the results that I've come up with.
Needless to say that I am no expert,
they are personal opinions,
see them as a starting point.

In the examples we will convert ".avi" to ".flv",
and simply copy the sound.
avi properties:
codec: mpeg4 (lavc) DX50
bitrate: I think its VBR (variable bit rate)
resolution: 640x480
frames per second: 30fps
video size: 5.4MB
sound: mp3
sound size: 1MB
total SIZE: 6.4MB


The tool we will be using is called ffmpeg.
It's a command line application, but very simple to use.
Probably already installed in your computer

We use the cd command to guide the terminal
to the folder where the "input.avi" file is.
example:

cd /home/username/Video



A typical command, then, would be:

explanation:
ffmpeg the program
-i input.avi the input file
-b 1024k the output bitrate
-s 320x240 the output resolution
-r 25 the output frames per second
-acodec copy the output audio codec
movie_1024_320_25_.flv the output file

A) For minimum decent results (updated 19-01-2008)
(poor quality, but not disturbing)
(resulted file size: less than 6.9MB)

ffmpeg -i input.avi -b 600k -s 320x240 -r 25 -acodec copy movie_600_320_25_.flv



B) For medium results (NOTE: this is temporary)
(resulted file size: 8MB)

ffmpeg -i input.avi -b 1024k -s 352x264 -r 25 -acodec copy movie_1024_352_25_.flv



C) For best results (file too big, maybe?)
(resulted file size: 22MB)

ffmpeg -i input.avi -b 2028k -s 640x480 -r 30 -acodec copy movie_2028_640_30_.flv



Further reading:
http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html
http://flowplayer.org/documentation/encoding

I found these steps from : http://forums.liveleak.com/showthread.php?t=1716 .



---

No comments:

Post a Comment

Feel free to leave your question or comment here, we will reply you as soon as possible.