[Bradford] Uses for the command line - newbies

Philip Wyett philwyett at gmx.com
Fri Apr 3 04:39:30 UTC 2009


Hi all,

Being that someone broke the thread. Yup, same culprit who uses wrong
email addresses. ;-) Sorry couldn't help myself. I'll start a new one
for command line uses.

Uses for the command line that a GUI application doesn't cover these
days can be quite difficult unless you are getting very down and dirty
with switches or scripting for batch work. Newbies rarely need these
abilities unless it's a real saver.

One I use often for converting mp3 to ogg takes you into the realms of
named pipes, which is not exactly newbie material but I shall work
through it here.

Prerequisites

 - Have lame installed
 - Have oggenc installed

What is the process?

  - Convert mp3 to wav format
  - Convert wav format to ogg

What is a named pipe?

  http://en.wikipedia.org/wiki/Named_pipe

Why use a named pipe here?

  Using a named pipe will allow us to convert from mp3 to wav sending
the output to our named pipe. Nothing occurs until we take the previous
input and output it to our wav to ogg command. The process now will only
output the final ogg file and the much larger wav file will never be
written to hard disk, thus saving space, which can be beneficial when
converting large files.

Sample audio filename: brad_lug_theme_tunes.mp3

Step 1: Create our named pipe

  mkfifo my_pipe

Step 2: Convert to wave into the named pipe

Open a new terminal and enter command below.

  lame --decode brad_lug_theme_tunes.mp3 my_pipe

Step 3: Release input from named pipe and convert to ogg

Open a new terminal and enter command below.

  oggenc -q 5 my_pipe -o brad_lug_theme_tunes.ogg

Step 4: Delete the named pipe

  rm -f my_pipe

All done. You have converted an audio file without the need to waste all
that hard disk space storing an intermediate wav file. :-)

The above process can be used in many conversion situations and for
batch processing be employed within a shell script.

Regards

Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mailman.lug.org.uk/pipermail/bradford/attachments/20090403/e9713680/attachment.pgp 


More information about the Bradford mailing list