User Feedback :: MP3 transcoding in Emelfm



Are you wanting to modify all bitrates or just the ones above 160?
I'd like to have the option to do whatever I choose
with a large stash of files...

e.g. - a low-width streaming icecast = 64k/mono
e.g. - a med-width streaming icecast = 96k/stereo
e.g. - a high-width streaming icecast = 160k/stereo
e.g. - some 128 bit versions for the car/personal player/etc.

Drivespace is really, really cheap these days.
So, making multiple pools of a group of cuts is no biggie.
Preserving bandwidth is a must,
and anywhere I can save cpu cycles is a good thing.

Again, these are just copies ,
as I have all the "good" stuff backed-up onto discs..

Thinking something similar to SU's bittorrent-gui.
( without the gui , for now )
1. Pick the sources
2. Pick the bitrate
3. Pick the destination
4. Hit GO!
and then go make coffee.......

I'm betting there is already a front-end to do this,
and I haven't found it yet, that uses the same tools
like lame, mpg321, oggenc, mp3info, etc...

73
ke4nt

If you write a script, please be careful on how you handle your parameters.

For example:

filename=$1

will not work if your filename contains a space character.

but

filename="$*"

should work.

It shouldn't be too hard to build a script that does the same thing using a directory name as the argument instead of the individual filename.

filenames with spaces suck. I don't use them, ever, and have no idea why people like them.
If i run into a situation where spaces cause a script to fail, then i'll fix it, but usually i don't bother until the situation arises.  Also, the "$*" will work in this instance, but will not work so easily in scripts using multiple parameters....another reason to consider dumping spaces. =o)

I'd say a function would be useful for recursive directories, so you can just call that function for each level you go.  Again, this is untested.
Code Sample

encode_files() {
the code mentioned earlier, or something similar
}
find_files() {
for this_dir in $1/*; do
[ -d "$this_dir" ] && find_files $this_dir
encode_files
done
}

Are the files being saved into the same directories?  If so that's another thing to consider, to prevent the same files being reencoded.

I agree about spaces being a problem.  The best I could come up for emelfm button code was this:

echo %f | xargs -n 1 | xargs --replace=foo lame -b 96 "foo" "96-foo"

It handles re-encoding all of the selected files, but only if they have no spaces.  It puts a prefix on the file name, so I could see a problem with prefixes stacking up quickly.  You could easily have a base name for the files, and then change the prefix and -b switch for the different rates so that's not really a problem.

I thought I should have been able to use 1 xargs command but I needed two.  I had to load the gnu-utils.dsl file first.  busybox xargs didn't cut it.

EDIT:

an even better way is this:

ls %f | xargs --replace=foo lame -S -b 96 "foo" "96-foo"

it handles multiple files like the previous one, but also handles files with spaces in their names.  using the -S switch in lame keeps the ncurses garbage away from the emelfm window.

Next Page...
original here.