Konversi AVI ke MPG di Linux pada umumnya dan Fedora 9 pada khusunya dapat dilakukan manakala anda sudah memiliki paket yang bisa melakukan encoding dan decoding. Dalam kesempatan ini saya menggunakan MEncoder.
Untuk melakukan konversi, sebelumnya install dulu paket MEncoder. Karena saya menggunakan Fedora 9 atau IGOS Nusantara 3, saya bisa memanfaatkan fasilitas YUM. Untuk instalasi paket menggunakan YUM, anda harus menjadi super user.
Perintah baris:
# yum install mencoder
Code :
[root@lenovo ~]# yum install mencoder*
Loaded plugins: refresh-packagekit
livna | 2.4 kB 00:00
http://mirror.unej.ac.id/fedora/releases/9/Everything/i386/os/repodata/repomd.xml: [Errno 12] Timeout:
Trying other mirror.
fedora | 2.4 kB 00:00
rpmfusion-free-updates | 2.4 kB 00:00
rpmfusion-free | 951 B 00:00
http://mirror.unej.ac.id/fedora/updates/9/i386.newkey/repodata/repomd.xml: [Errno 12] Timeout:
Trying other mirror.
updates-newkey | 3.4 kB 00:00
updates | 2.6 kB 00:00
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package mencoder.i386 0:1.0-0.100.20090204svn.fc9.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mencoder i386 1.0-0.100.20090204svn.fc9.1 rpmfusion-free-updates 3.0 M
Transaction Summary
================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 3.0 M
Is this ok [y/N]: y
Downloading Packages:
mencoder-1.0-0.100.20090204svn.fc9.1.i386.rpm | 3.0 MB 06:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : mencoder 1/1
Installed:
mencoder.i386 0:1.0-0.100.20090204svn.fc9.1
Complete!
[root@lenovo ~]#
Selanjutnya anda tinggal melakukan konversi file AVI ke MPG. Misal, anda punya file input.avi dan mau dikonversi menjadi output.mpg. Maka perintah baris yang digunakan adalah sbb :
Perintah baris (buat dalam satu baris):
$ mencoder input.avi -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 -o output.mpg -oac lavc -ovc lavc -lavcopts acodec=mp2:abitrate=224:vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2:aspect=4/3
Tulislah dalam satu baris.
Code :
[root@lenovo ~]# mencoder input.avi -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 -o output.mpg -oac lavc -ovc lavc -lavcopts acodec=mp2:abitrate=224:vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2:aspect=4/3
MEncoder SVN-r28461-4.3.0 (C) 2000-2009 MPlayer Team
CPU: Genuine Intel(R) CPU T2300 @ 1.66GHz (Family: 6, Model: 14, Stepping: 8)
success: format: 0 data: 0x0 - 0x1f54c80
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [XVID] 720x480 24bpp 23.976 fps 983.9 kbps (120.1 kbyte/s)
[V] filefmt:3 fourcc:0x44495658 size:720x480 fps:23.976 ftime:=0.0417
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
PACKET SIZE: 2048 bytes, deltascr: 221184
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
Limiting audio preload to 0.4s.
Increasing audio density to 4.
[mpeg4 @ 0xa2dfba0]Invalid and inefficient vfw-avi packed B frames detected
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.50:1 - prescaling to correct movie aspect.
videocodec: libavcodec (720x480 fourcc=3167706d [mpg1])
[VE_LAVC] High quality encoding selected (non-realtime)!
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Writing header...1f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
INITV: 0.200, 0.158, fps: 23.976
Pos: 0.8s 20f ( 0%) 0.00fps Trem: 2min 0mb A-V:0.057 [0:223]
BUFFER UNDEFLOW at stream 0, raising muxrate to 2200 kb/s, delta_scr: 201076
BUFFER UNDEFLOW at stream 1, raising muxrate to 2420 kb/s, delta_scr: 182796
Pos: 233.9s 5609f (99%) 66.82fps Trem: 0min 39mb A-V:0.068 [1157:223]
Broken frame at 0x393343
Pos: 234.3s 5618f (100%) 66.83fps Trem: 0min 39mb A-V:0.067 [1158:223]
Flushing video frames.
Writing index...
Overhead: 2.030% (821548 / 40462036)
Writing header...
Video stream: 1158.268 kbit/s (144783 B/s) size: 33919261 bytes 234.276 secs 5618 frames
Audio stream: 224.000 kbit/s (27999 B/s) size: 6560182 bytes 234.292 secs
[root@lenovo ~]#
Proses konversi seharusnya sudah berhasil. Sekarang anda tinggal memeriksa apakah file output.mpg sudah terbentuk.
Selamat mencoba.
Sumber :
http://www.linuxforums.org/