Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (4) </ [1] 2 3 4 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: MP3 transcoding in Emelfm, syntax challenge< Next Oldest | Next Newest >
ke4nt1 Offline





Group: Members
Posts: 2329
Joined: Oct. 2003
Posted: April 14 2005,19:51 QUOTE

I've got lame transcoding some mp3's in emelfm for me,
so I can load up my usbkeys for my DSL carputer.

Most of my rips are at 320 vbr , which is overkill for both
the carputer, and the ride home..  160's will do nicely.

So, I archive the 320's onto dvd-r's for later use..

Once I have a selection to goto the carputer, I make them
transcode into 160 or 128..  I'm using this in emelfm to do it.
( as a button option )

" lame --mp3input %f -h -v -b 160 {160}.mp3 "

which works , but leaves me with a smaller file called
{160}.mp3    ..  It seems I can't use the %f variable twice
in the same statement..   Is there a way I can actually make
the filename be created at the same time the new file is made ?

e.g.   ABC.mp3  becomes ABC-128.mp3  
       XYZ.mp3 becomes XYZ-160.mp3

I'm guessing I'd have to make a script to do this, and make
emelfm run the script, rather than try to do it as a button
option within emelfm..  

It is nice to see a song I want, click on it ,
and get a 128 bit ready-to-go file for the USBkey in seconds..
( without having to go back and rename it )

Any Ideas ?

73
ke4nt
Back to top
Profile PM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: April 14 2005,22:16 QUOTE

This may sound obvious, but my first place to look would be to look at the emelfm documentation / home page / google for information.

But if I were doing it, I wouldn't bother and just write a small script to build a new filename from the original string parameter "$*".

maybe something like:

!/bin/bash
lame --mp3input "$*" -h -v -b 160 "160_$*"
exit

It is possible to add the 160 as a suffix to the output filename but it will require some string manipulation to squeeze it in between the filename and the .mp3 file extension.  sed might be a good choice for that.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: April 14 2005,22:16 QUOTE

I'm guessing you can probably use %f more than once, but maybe it gets screwy when you try to create a new filename using %f as the base.  I haven't got emelfm right now to do any tests, so the only thing that i know would definitely work is a script.

#!/bin/bash
filename=$1
newfile=`echo ${filename}|awk -F .mp3 '{print $1}'`
lame --mp3input ${filename} -h -v -b 160 ${newfile}-160.mp3


Not tested, but it's something to try.  It'd be added to emelfm with "scriptname %f".


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: April 14 2005,22:44 QUOTE

In Emelfm %{} is the sytnax where you are prompted for a new filename. I use it for repacking .dsl files.

Does this help?

Chris
Back to top
Profile PM MSN YIM 
ke4nt1 Offline





Group: Members
Posts: 2329
Joined: Oct. 2003
Posted: April 15 2005,16:32 QUOTE

While clivesay's idea does work,
I would still have to manually enter filenames every time..

..so , the script looks like the way to go..  

... thinking a step or two further ahead ...

If I wanted to process an entire repository of stuff ,
( after I've backed up the good 320 VBR versions to DVD-R )
What would be the trick to making your script suggestions
work recursively thru hundreds of sub-dirs ?

Where I could start the script in sub-dir  e.g. " XYZ BAND " ,
and have it process ALL the mp3's in every album under
the  XYZ BAND dir, from whatever bitrate they are now to whatever I choose,
and write to a similar filename on the drive,
and preferably deleting the older version..

That would probably curb my bandwidth, and save drivespace.
(similar to icecasting, without the overhead of re-encoding
  to a lower bitrate on-the-fly ..)

73
ke4nt
Back to top
Profile PM 
15 replies since April 14 2005,19:51 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (4) </ [1] 2 3 4 >/
reply to topic new topic new poll
Quick Reply: MP3 transcoding in Emelfm

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code