August 15th, 2005

mplayer tricks

» ,

Several months ago, I mentioned I was looking for mplayer documention. My wife has a bunch of wma files which she ripped using Windows Media Player but can’t play on iPod or iTunes now. We could probably rip again but being OSS geek, we like to inflict pain upon ourselves to look for the most obscure ways to do things. So the answer is obviously mplayer (with lame)

Actually it wasn’t so bad. It can be done using two command line:

mplayer original.wma -ao pcm -ao temp.wav
lame -V 5 temp.wav final.mp3

But this is not enough and I have to write this into a shell script allow conversion in batch. Batch is important, of course, since my wife actually has a lot of wma files to convert..okay, not so many, just 8 of them but hey, the final wma2mp3 script is definitely worth the effort.

Save it in your directory, do a chmod +x wma2mp3 and there you go. It works on Mac too! I know, I know, there is EasyWMA but did I mention I like to inflict pain on myself?

Incidently, mplayer also comes with a incredible tool called mencoder which does transcoding, resizing, encoding, and all sort of filters using command line. It is a perfect tool to downsize my VideoCD or AVI files to watch it on my Zaurus.

mencoder -oac mp3lame -lameopts mode=3:preset=24 -ovc lavc -lavcopts
  vcodec=mpeg4:vhq:vbitrate=384:keyint=250 -vop expand="320:240" 
  -o output.avi input.avi

See? It is so simple! One line does it all. It only takes about 30mins to encode 60mins of video (most windows program I tried takes nearly 3hours for 60mins of video) and the final output is barely 120mb. Here is the fitzaurus script if you are interested.

Comments are closed.