Tuesday, December 09, 2008

Scripts I use

These are a couple of scripts I use to convert files between media formats. The only advantage of using these is that I don't need to remember all the crazy command line options.

rm_to_wav.sh
--------------------
basename=`echo $1 |awk -F. '{print $1}'`
mplayer -cache 32 -ao pcm -ao pcm:file=$basename.wav $1


wav_to_mp3.sh
----------------------
basename=`echo $1 |awk -F. '{print $1}'`
lame -V2 $1 $basename.mp3


Usage:
-----------
rm_to_wav.sh filename.rm
wav_to_mp3.sh filename.wav

3 comments:

  1. Wow, I thought you were against using GUI ;-)

    ReplyDelete
  2. Have you a tool to convert visual media files to a common format, say DivX?
    Many a times, I would want to watch a movie/video sometime later which is available in physical media like CD/DVD, but carrying it around everywhere is impracticable. If only they could be copied (legally for personal use) as a single file for viewing later by a tool, I'd just be one of its frequent users!

    ReplyDelete