User Feedback :: MP3 transcoding in Emelfm
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
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.
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".
In Emelfm %{} is the sytnax where you are prompted for a new filename. I use it for repacking .dsl files.
Does this help?
Chris
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
Next Page...
original here.