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 >
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: April 15 2005,17:13 QUOTE

Are you wanting to modify all bitrates or just the ones above 160?
Back to top
Profile PM MSN YIM 
ke4nt1 Offline





Group: Members
Posts: 2329
Joined: Oct. 2003
Posted: April 15 2005,19:18 QUOTE

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
Back to top
Profile PM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: April 15 2005,22:08 QUOTE

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.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: April 15 2005,23:04 QUOTE

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.


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





Group: Members
Posts: 570
Joined: June 2004
Posted: April 16 2005,01:17 QUOTE

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.
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