Gentoo Archives: gentoo-user

From: dexters84 <dexters84@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Batch audio converter?
Date: Sun, 27 Apr 2008 16:00:57
Message-Id: 4814A348.3030809@gmail.com
In Reply to: [gentoo-user] Batch audio converter? by Mark Knecht
1 Tweak below script a little and it should do the trick - should work the
2 way it is - but I haven't tested it, it's a port of mine video encoder
3 for multiple directories.
4
5 #!/bin/bash
6
7 new_files=$(find /path/to/input/ -iname "*.ogg")
8 inc=1
9 for x in $new_files
10 do
11 filename[$inc]=$x
12 char_count=$(stat $filename[$inc]|wc -c)
13 name_end=$(($char_count - 6))
14 out_name[$inc]=$(echo $filename[$inc]|cut -c 10-$name_end)
15 ffmpeg -i $filename -vcodec mp3 -ac 2 -ar 44100 -ab 256k
16 /path/to/out/$out_name.mp3
17 inc=$(($inc + 1))
18 done
19
20
21 Mark Knecht pisze:
22 > Hi,
23 > I've got about 200GB of OGG and FLAC files on my local machine. My
24 > son bought an iPod and wants me to do a batch conversion to mp3. Can
25 > anyone recommend something in portage that can do this in more or less
26 > a single step? Directory hierarchy is basically
27 > band/album/audio_files.
28 >
29 > Extra points I suppose if it can write the output to a different
30 > machine across the network - Windows XP or Gentoo - so that I don't
31 > have to deal with storage issues in this end.
32 >
33 > Thanks,
34 > Mark
35 >
36
37 --
38 gentoo-user@l.g.o mailing list