Introduced -f to force local cddb or template
[clinton/abcde.git] / abcde.1
1 .TH ABCDE 1
2 .SH NAME
3 abcde \- Grab an entire CD and compress it to Ogg/Vorbis, MP3, FLAC, Ogg/Speex and/or MPP/MP+(Musepack) format.
4 .SH SYNOPSIS
5 .B abcde
6 .I [options] [tracks]
7 .SH DESCRIPTION
8 Ordinarily, the process of grabbing the data off a CD and encoding it, then
9 tagging or commenting it, is very involved.
10 .BR abcde
11 is designed to automate this. It will take an entire CD and convert it into
12 a compressed audio format - Ogg/Vorbis, MPEG Audio Layer III, Free Lossless
13 Audio Codec (FLAC), Ogg/Speex or MPP/MP+(Musepack). With one command, it will:
14 .TP
15 .B *
16 Do a CDDB query over the Internet to look up your CD or use a locally stored CDDB entry
17 .TP
18 .B *
19 Grab a track from your CD
20 .TP
21 .B *
22 Compress it to Ogg/Vorbis, MP3, FLAC, Ogg/Speex and/or MPP/MP+(Musepack) format
23 .TP
24 .B *
25 Comment or ID3 tag it
26 .TP
27 .B *
28 Give it an intelligible filename
29 .TP
30 .B *
31 Delete the intermediate WAV file (or save it for later use)
32 .TP
33 .B *
34 Repeat until finished
35 .SH OPTIONS
36 .TP
37 .B \-1
38 Encode the whole CD in a single file. The resulting file uses the CD title
39 for tagging.
40 .TP
41 .B \-a [actions]
42 Comma-delimited list of actions to perform. Can be one or more of:
43 cddb, read, normalize, encode, tag, move, playlist, clean. Normalize
44 and encode imply read. Tag implies cddb, read, encode. Move implies
45 cddb, read, encode, tag. Playlist implies cddb. The default is to
46 do all actions except normalize and playlist.
47 .TP
48 .B \-b
49 Enable batch mode normalization. See the BATCH configuration variable.
50 .TP
51 .B \-c [filename]
52 Specifies an additional configuration file to parse. Configuration options
53 in this file override those in /etc/abcde.conf or $HOME/.abcde.conf.
54 .TP
55 .B \-C [discid]
56 Allows you to resume a session for
57 .I discid
58 when you no longer have the CD available (abcde will automatically resume if
59 you still have the CD in the drive). You must have already finished at
60 least the "read" action during the previous session.
61 .TP
62 .B \-d [devicename]
63 CD\-ROM block device that contains audio tracks to be read.
64 .TP
65 .B \-D
66 Capture debugging information (you'll want to redirect this \- try 'abcde \-D
67 2>logfile')
68 .TP
69 .B \-f
70 Force the use of a locally cached CDDB entry and fallback to a template if none
71 is found. For faster network-disconnected operation.
72 .TP
73 .B \-j [number]
74 Start [number] encoder processes at once. Useful for SMP systems. Overrides
75 the MAXPROCS configuration variable. Set it to "0" when using distmp3 to avoid
76 local encoding processes.
77 .TP
78 .B \-k
79 Keep the wav files after encoding.
80 .TP
81 .B \-l
82 Use the low-diskspace algorithm. See the LOWDISK configuration variable.
83 .TP
84 .B \-L
85 Use a local CDDB repository. See CDDBLOCALDIR variable.
86 .TP
87 .B -n
88 Do not query CDDB database. Create and use a template. Edit the template to
89 provide song names, artist(s), ...
90 .TP
91 .B -N
92 Non interactive mode. Do not ask anything from the user. Just go ahead.
93 .TP
94 .B -m
95 Create DOS-style playlists, modifying the resulting one by adding CRLF line
96 endings. Some hardware players insist on having those to work.
97 .TP
98 .B \-o [filetype]
99 Select output type. Can be "ogg", "mp3", "flac", "spx" or "mpc". Specify a
100 comma-delimited list of output types to obtain all specified types. See
101 the OUTPUTTYPE configuration variable.
102 .TP
103 .B \-p
104 Pads track numbers with 0\'s.
105 .TP
106 .B \-r [hosts...]
107 Remote encode on this comma-delimited list of machines using distmp3. See
108 the REMOTEHOSTS configuration variable.
109 .TP
110 .B \-s [number]
111 Start the numbering of the tracks at a given number. It only affects the
112 filenames and the playlist. Internal (tag) numbering remains the same.
113 .TP
114 .B \-S [speed]
115 Set the speed of the CD drive. Needs CDSPEED and CDSPEEDOPTS set properly
116 and both the program and device must support the capability.
117 .TP
118 .B \-v
119 Show the version and exit
120 .TP
121 .B \-V
122 Be a bit more verbose. On slow networks the CDDB requests might give the
123 sensation nothins is happening.
124 .TP
125 .B \-x
126 Eject the CD when all tracks have been read. See the EJECTCD configuration
127 variable.
128 .TP
129 .B \-h
130 Get help information.
131 .TP
132 .B [tracks]
133 A list of tracks you want abcde to process. If this isn't specified, abcde
134 will process the entire CD. Accepts ranges of track numbers -
135 "abcde 1-5 7 9" will process tracks 1, 2, 3, 4, 5, 7, and 9.
136 .SH OUTPUT
137 Each track is, by default, placed in a separate file named after the track
138 in a subdirectory named after the artist under the current directory.
139 This can be modified using the OUTPUTFORMAT and VAOUTPUTFORMAT
140 variables in your abcde.conf. Each file is given an extension identifying
141 its compression format, '.ogg', '.mp3', '.flac', '.spx', or '.mpc'.
142 .SH CONFIGURATION
143 abcde sources two configuration files on startup - /etc/abcde.conf and
144 $HOME/.abcde.conf, in that order.
145 .TP
146 The configuration variables have to be set as follows:
147 .TP
148 .B VARIABLE=value
149 Except when "value" needs to be quoted or otherwise interpreted. If other
150 variables within "value" are to be expanded upon reading the configuration
151 file, then double quotes should be used. If they are only supposed to be
152 expanded upon use (for example OUTPUTFORMAT) then single quotes must be used.
153 .TP
154 All sh escaping/quoting rules apply.
155 .TP
156 Here is a list of options abcde recognizes:
157 .TP
158 .B CDDBURL
159 Specifies a server to use for CDDB lookups.
160 .TP
161 .B OGGENCODERSYNTAX
162 Specifies the style of encoder to use for the Ogg/Vorbis encoder. Valid options
163 are \'oggenc\' (default for Ogg/Vorbis) and \'vorbize\'.
164 This affects the default location of the binary,
165 the variable to pick encoder command-line options from, and where the options
166 are given.
167 .TP
168 .B MP3ENCODERSYNTAX
169 Specifies the style of encoder to use for the MP3 encoder. Valid options are
170 \'lame\' (default for MP3), \'gogo\', \'bladeenc\', \'l3enc\' and \'mp3enc\'.
171 Affects the same way as explained above for Ogg/Vorbis.
172 .TP
173 .B FLACENCODERSYNTAX
174 Specifies the style of encoder to use for the FLAC encoder. At this point only
175 \'flac\' is available for FLAC encoding.
176 .TP
177 .B SPEEXENCODERSYNTAX
178 Specifies the style of encoder to use for Speex encoder. At this point only
179 \'speexenc\' is available for Ogg/Speex encoding.
180 .TP
181 .B MPPENCODERSYNTAX
182 Specifies the style of encoder to use for MPP/MP+ (Musepack) encoder. At this
183 point we only have \'mppenc\' available, from corecodecs.org.
184 .TP
185 .B NORMALIZERSYNTAX
186 Specifies the style of normalizer to use. Valid options are \'default\'
187 and \'normalize'\ (and both run \'normalize-audio\'), since we only support it, ATM.
188 .TP
189 .B HELLOINFO
190 Specifies the Hello information to send to the CDDB server. The CDDB
191 protocol requires you to send a valid username and hostname each time you
192 connect. The format of this is username@hostname.
193 .TP
194 .B CDDBLOCALDIR
195 Specifies a directory where we store a local CDDB repository. The entries must
196 be standard CDDB entries, with the filename being the DISCID value. Other
197 CD playing and ripping programs (like Grip) store the entries under ~/.cddb
198 and we can make use of those entries.
199 .TP
200 .B CDDBCOPYLOCAL
201 Store local copies of the CDDB entries under the $CDDBLOCALDIR directory.
202 .TP
203 .B CDDBUSELOCAL
204 Actually use the stored copies of the CDDB entries. Can be overriden using the
205 "-L" flag (if is CDDBUSELOCAL in "n"). If an entry is found, we always give
206 the choice of retrieving a CDDB entry from the internet.
207 .TP
208 .B OUTPUTDIR
209 Specifies the directory to place completed tracks/playlists in.
210 .TP
211 .B WAVOUTPUTDIR
212 Specifies the temporary directory to store .wav files in. Abcde may use up
213 to 700MB of temporary space for each session (although it is rare to use
214 over 100MB for a machine that can encode music as fast as it can read it).
215 .TP
216 .B OUTPUTFORMAT
217 Specifies the format for completed Ogg/Vorbis, MP3, FLAC, Ogg/Speex or MPP/MP+
218 (Musepack) filenames.
219 Variables are included
220 using standard shell syntax. Allowed variables are GENRE, ALBUMFILE, ARTISTFILE,
221 TRACKFILE, TRACKNUM, and YEAR. Default is
222 \'${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}-${TRACKFILE}\'.
223 Make sure to use single quotes around this variable. TRACKNUM is
224 automatically zero-padded, when the number of encoded tracks is higher than
225 9. When lower, you can force with '-p' in the command line.
226 .TP
227 .B OUTPUTTYPE
228 Specifies the encoding format to output, as well as the default extension and
229 encoder. Defaults to "ogg". Valid settings are "ogg" (Ogg/Vorbis), "mp3"
230 (MPEG-1 Audio Layer III), "flac" (Free Lossless Audio Codec), "spx" (Ogg/Speex)
231 and "mpc" (MPP/MP+ (Musepack)). Values like "ogg,mp3" encode the tracks in
232 both Ogg/Vorbis and MP3 formats.
233 .P
234 For each value in OUTPUTTYPE, abcde expands a different process for encoding,
235 tagging and moving, so you can use the format placeholder, OUTPUT, to create
236 different subdirectories to hold the different types. The variable OUTPUT will
237 be 'ogg', 'mp3', 'flac', 'spx' and/or 'mpc', depending on the OUTPUTTYPE you define.
238 For example
239 .P
240 OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}._${TRACKFILE}'
241 .TP
242 .B VAOUTPUTFORMAT
243 Just like OUTPUTFORMAT but for Various Artists discs. Default is whatever
244 OUTPUTFORMAT is set to.
245 .TP
246 .B PATHNAMES
247 The following configuration file options specify the pathnames of their
248 respective utilities: LAME, GOGO, BLADEENC, L3ENC, XINGMP3ENC, MP3ENC,
249 VORBIZE, OGGENC, FLAC, SPEECENC, MPPENC, ID3, ID3V2, CDPARANOIA, CDDA2WAV,
250 HTTPGET, CDDISCID, CDDBTOOL, EJECT, NORMALIZE, DISTMP3, VORBISCOMMENT, and
251 CDSPEED.
252 .TP
253 .B COMMAND-LINE OPTIONS
254 If you wish to specify command-line options to any of the programs abcde
255 uses, set the following configuration file options: LAMEOPTS, GOGOOPTS,
256 BLADEENCOPTS, L3ENCOPTS, XINGMP3ENCOPTS, MP3ENCOPTS, VORBIZEOPTS,
257 OGGENCOPTS, FLACOPTS, SPEEXENCOPTS, MPPENCOPTS, ID3OPTS, ID3V2OPTS,
258 CDPARANOIAOPTS, CDDA2WAVOPTS, HTTPGETOPTS, CDDBTOOLOPTS, EJECTOPTS,
259 DISTMP3OPTS, NORMALIZEOPTS, CDSPEEDOPTS, and CDSPEEDVALUE.
260 .TP
261 .B CDROM
262 If set, it points to the CD-Rom device which has to be used for audio
263 extraction. Abcde tries to guess the right device, but it may fail.
264 .TP
265 .B MAXPROCS
266 Defines how many encoders to run at once. This makes for huge speedups
267 on SMP systems. You should run one encoder per CPU at once for maximum
268 efficiency, although more doesn't hurt very much. Set it "0" when using
269 mp3dist to avoid getting encoding processes in the local host.
270 .TP
271 .B LOWDISK
272 If set to y, conserves disk space by encoding tracks immediately after
273 reading them. This is substantially slower than normal operation but
274 requires several hundred MB less space to complete the encoding of an
275 entire CD. Use only if your system is low on space and cannot encode as
276 quickly as it can read.
277 .TP
278 .B BATCH
279 If set to y, enables batch mode normalization, which preserves relative
280 volume differences between tracks of an album. Also enables nogap encoding
281 when using the \'lame\' encoder.
282 .TP
283 .B KEEPWAVS
284 It defaults to no, so if you want to keep those wavs ripped from your CD,
285 set it to "y". You can use the "-k" switch in the command line. The default
286 behaviour with KEEPWAVS set is the keep the temporary directory and the wav
287 files even you have requested the "clean" action.
288 .TP
289 .B PADTRACKS
290 If set to "y", it adds 0's to the file numbers to complete a two-number
291 holder. Usefull when encoding tracks 1-9.
292 .TP
293 .B PLAYLISTFORMAT
294 Specifies the format for completed playlist filenames. Works like the
295 OUTPUTFORMAT configuration variable. Default is
296 \'${ARTISTFILE}_\-_${ALBUMFILE}.m3u\'.
297 Make sure to use single quotes around this variable.
298 .TP
299 .B PLAYLISTDATAPREFIX
300 Specifies a prefix for filenames within a playlist. Useful for http
301 playlists, etc.
302 .TP
303 .B DOSPLAYLIST
304 If set, the resulting playlist will have CR-LF line endings, needed by some
305 hardware-based players.
306 .TP
307 .B COMMENT
308 Specifies a comment to embed in the ID3 or Ogg comment field of each
309 finished track. Can be up to 28 characters long. Supports the same
310 syntax as OUTPUTFORMAT. Does not currently support ID3v2.
311 .TP
312 .B REMOTEHOSTS
313 Specifies a comma-delimited list of systems to use for remote encoding using
314 distmp3. Equivalent to -r.
315 .TP
316 .B mungefilename
317 mungefilename() is an abcde shell function that can be overridden via
318 abcde.conf. It takes CDDB data as $1 and outputs the resulting filename on
319 stdout. It defaults to eating control characters, apostrophes and
320 question marks, translating spaces and forward slashes to underscores, and
321 translating colons to an underscore and a hyphen.
322 .br
323 If you modify this function, it is probably a good idea to keep the forward
324 slash munging (UNIX cannot store a file with a '/' char in it) as well as
325 the control character munging (NULs can't be in a filename either, and
326 newlines and such in filenames are typically not desirable).
327 .TP
328 .B mungegenre
329 mungegenre () is a shell function used to modify the $GENRE variable. As
330 a default action, it takes $GENRE as $1 and outputs the resulting value
331 to stdout converting all UPPERCASE characters to lowercase.
332 .TP
333 .B pre_read
334 pre_read () is a shell function which is executed before the CDROM is read
335 for the first time, during abcde execution. It can be used to close the CDROM
336 tray, to set its speed (via "setcd" or via "eject", if available) and other
337 preparation actions. The default function is empty.
338 .TP
339 .B EJECTCD
340 If set to "y", abcde will call eject(1) to eject the cdrom from the drive
341 after all tracks have been read.
342 .SH BACKEND TOOLS
343 abcde requires the following backend tools to work:
344 .TP
345 .B *
346 An Ogg/Vorbis, MP3, FLAC, Ogg/Speex or MPP/MP+(Musepack) encoder (oggenc, vorbize, lame, gogo, bladeenc, l3enc, mp3enc, flac, speexenc, mppenc)
347 .TP
348 .B *
349 An audio CD reading utility (cdparanoia, cdda2wav, dagrab)
350 .TP
351 .B *
352 cd-discid, a CDDB DiscID reading program.
353 .TP
354 .B *
355 An HTTP retrieval program: wget, fetch (FreeBSD) or curl (Mac OS X, among others).
356 .TP
357 .B *
358 (for MP3s) id3 or id3v2, id3 v1 and v2 tagging programs.
359 .TP
360 .B *
361 (optional) distmp3, a client/server for distributed mp3 encoding.
362 .TP
363 .B *
364 (optional) normalize, a WAV file volume normalizer.
365 .SH "SEE ALSO"
366 .BR cdparanoia (1),
367 .BR cdda2wav (1),
368 .BR dagrab (1),
369 .BR normalize-audio (1),
370 .BR oggenc (1),
371 .BR vorbize (1),
372 .BR flac (1),
373 .BR speexenc(1),
374 .BR mppenc(1),
375 .BR id3 (1),
376 .BR wget (1),
377 .BR fetch (1),
378 .BR cd-discid (1),
379 .BR distmp3 (1),
380 .BR distmp3host (1),
381 .BR curl(1)
382 .SH AUTHORS
383 Robert Woodcock <rcw@debian.org>
384 Jesus Climent <jesus.climent@hispalinux.es>