Tuesday, February 28, 2006

Convert your AVI files to MPEG Format in Linux

I had some movies that I wanted to Play in my DVD Player, So I had converted the same from .avi files to mpeg format in Mandrake 2006 .

Heres what I did,

Download ffmpeg

[root@mybox Nayagan.DVDRip]# urpmi ffmpeg

ftp://ftp.planetmirror.com/pub/plf/mandrake/free/2006.0/
./i586/ffmpeg-0.4.9-0.pre1.6.1.20060plf.i586.rpm
installing ffmpeg-0.4.9-0.pre1.6.1.20060plf.i586.rpm from
/var/cache/urpmi/rpms

Preparing... #############################################
1/1: ffmpeg #############################################


To Check File Type Before Conversion :

[root@mybox Movies]# file Nayagan_CD1.avi
Nayagan_CD1.avi: RIFF (little-endian) data, AVI, 576 x 320, 25.00 fps
, video: DivX 3 Low-Motion, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)

To Convert from .avi to .mpg

[root@mybox Movies]# ffmpeg -i Nayagan_CD1.avi -ab 56 -ar 22050 -b 500 -s 320x240 Nayagan_CD1.mpg

This takes a good one hour as file size was around 700 MB

To Check File Type after the conversion:

[root@mybox Movies]# file Nayagan_CD1.mpg
Nayagan_CD1.mpg: MPEG sequence, v1, system multiplex

I still have to check if this works with my DVD player... will update this later.