Recursive CDDB local dir work
[clinton/abcde.git] / abcde.1
... / ...
CommitLineData
1.TH abcde 1
2.SH NAME
3abcde \- 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
8Ordinarily, the process of grabbing the data off a CD and encoding it, then
9tagging or commenting it, is very involved.
10.BR abcde
11is designed to automate this. It will take an entire CD and convert it into
12a compressed audio format - Ogg/Vorbis, MPEG Audio Layer III, Free Lossless
13Audio Codec (FLAC), Ogg/Speex or MPP/MP+(Musepack). With one command, it will:
14.TP
15.B *
16Do a CDDB query over the Internet to look up your CD or use a locally stored CDDB entry
17.TP
18.B *
19Grab an audio track (or all the audio CD tracks) from your CD
20.TP
21.B *
22Normalize the volume of the individual file (or the album as a single unit)
23.TP
24.B *
25Compress to Ogg/Vorbis, MP3, FLAC, Ogg/Speex and/or MPP/MP+(Musepack) format(s), all in one CD read
26.TP
27.B *
28Comment or ID3/ID3v2 tag
29.TP
30.B *
31Give an intelligible filename
32.TP
33.B *
34Calculate replaygain values for the individual file (or the album as a single unit)
35.TP
36.B *
37Delete the intermediate WAV file (or save it for later use)
38.TP
39.B *
40Repeat until finished
41.SH OPTIONS
42.TP
43.B \-1
44Encode the whole CD in a single file. The resulting file uses the CD title
45for tagging. If the resulting format is a flac file with an embeded cuesheet,
46the file can be used as a source for creating other formats.
47.TP
48.B \-a [actions]
49Comma-delimited list of actions to perform. Can be one or more of:
50cddb, read, normalize, encode, tag, move, replaygain, playlist, clean. Normalize
51and encode imply read. Tag implies cddb, read, encode. Move implies
52cddb, read, encode, tag. Replaygain implies cddb, read, encode, tag and move.
53Playlist implies cddb. The default is to do all actions except normalize,
54replaygain and playlist.
55.TP
56.B \-b
57Enable batch mode normalization. See the BATCHNORM configuration variable.
58.TP
59.B \-B
60Disable batch mode replaygain. It processes file by file to add the replaygain
61information. See the NOBATCHREPLAYGAIN configuration variable.
62.TP
63.B \-c [filename]
64Specifies an additional configuration file to parse. Configuration options
65in this file override those in /etc/abcde.conf or $HOME/.abcde.conf.
66.TP
67.B \-C [discid]
68Allows you to resume a session for
69.I discid
70when you no longer have the CD available (abcde will automatically resume if
71you still have the CD in the drive). You must have already finished at
72least the "read" action during the previous session.
73.TP
74.B \-d [devicename | filename]
75CD\-ROM block device that contains audio tracks to be read. Alternatively, a
76single-track flac file with embeded cuesheet.
77.TP
78.B \-D
79Capture debugging information (you'll want to redirect this \- try 'abcde \-D
802>logfile')
81.TP
82.B \-e
83Erase information about encoded tracks from the internal status file, to enable
84other encodings if the wav files have been kept.
85.TP
86.B \-g
87Enable lame's \-\-nogap option. See the NOGAP variable. WARNING: lame's
88\-\-nogap disables the Xing mp3 tag. This tag is required for mp3 players to
89correctly display track lengths when playing variable-bit-rate mp3 files.
90.TP
91.B \-h
92Get help information.
93.TP
94.B \-j [number]
95Start [number] encoder processes at once. Useful for SMP systems. Overrides
96the MAXPROCS configuration variable. Set it to "0" when using distmp3 to avoid
97local encoding processes.
98.TP
99.B \-k
100Keep the wav files after encoding.
101.TP
102.B \-l
103Use the low-diskspace algorithm. See the LOWDISK configuration variable.
104.TP
105.B \-L
106Use a local CDDB repository. See CDDBLOCALDIR variable.
107.TP
108.B \-n
109Do not query CDDB database. Create and use a template. Edit the template to
110provide song names, artist(s), ...
111.TP
112.B \-N
113Non interactive mode. Do not ask anything from the user. Just go ahead.
114.TP
115.B \-m
116Create DOS-style playlists, modifying the resulting one by adding CRLF line
117endings. Some hardware players insist on having those to work.
118.TP
119.B \-M
120Create a CUE file with information about the CD. Together with the possibility
121of creating a single file (see option "\-1"), one can recreate the original CD.
122If the cuesheet is embeded in a flac single file it can be used as source for
123encoding other formats.
124.TP
125.B \-o [filetype][:filetypeoptions]
126Select output type. Can be "vorbis" (or "ogg"), "mp3", "flac", "spx", "mpc" or
127"wav". Specify a comma-delimited list of output types to obtain all specified
128types. See the OUTPUTTYPE configuration variable. One can pass options to the
129encoder for a specific filetype on the command line separating them with a
130colon. The options must be escaped with double-quotes.
131.TP
132.B \-p
133Pads track numbers with 0\'s.
134.TP
135.B \-r [hosts...]
136Remote encode on this comma-delimited list of machines using distmp3. See
137the REMOTEHOSTS configuration variable.
138.TP
139.B \-R
140When CDDBLOCALDIR and CDDBUSELOCAL are defined, search recursively under the
141defined directory for matches of the CDDB entry.
142.TP
143.B \-s [fields...]
144List, separated by comas, the fields to be shown in the CDDB parsed entries.
145Right now it only uses "year" and "genre".
146.TP
147.B \-S [speed]
148Set the speed of the CD drive. Needs CDSPEED and CDSPEEDOPTS set properly
149and both the program and device must support the capability.
150.TP
151.B \-t [number]
152Start the numbering of the tracks at a given number. It only affects the
153filenames and the playlist. Internal (tag) numbering remains the same.
154.TP
155.B \-T [number]
156Same as \-t but changes also the internal (tag) numbering. Keep in mind that
157the default TRACK tag for MP3 is $T/$TRACKS so it is changed to simply $T.
158.TP
159.B \-u
160Set CDDBPROTOCOL to version 6, so that we retrieve UTF-8 encoded CDDB
161information, and we tag and add comments with a proper encoding. This flag will
162be removed and -U will be added to set it to version 5 once version 6 becomes
163the default.
164.TP
165.B \-v
166Show the version and exit
167.TP
168.B \-V
169Be a bit more verbose. On slow networks the CDDB requests might give the
170sensation nothins is happening.
171.TP
172.B \-x
173Eject the CD when all tracks have been read. See the EJECTCD configuration
174variable.
175.TP
176.B \-w [comment]
177Add a comment to the tracks ripped from the CD.
178.TP
179.B \-W [number]
180Concatenate CD\'s. It uses the number provided to define a comment "CD #" and
181to modify the numbering of the tracks, starting with "#01".
182.TP
183.B \-z
184DEBUG mode: it will rip, using cdparanoia, the very first second of each track
185and proceed with the actions requested very quickly, also providing some
186"hidden" information about what happens on the background. CAUTION: IT WILL
187ERASE ANY EXISTING RIPS WITHOUT WARNING!
188.TP
189.B [tracks]
190A list of tracks you want abcde to process. If this isn't specified, abcde
191will process the entire CD. Accepts ranges of track numbers -
192"abcde 1-5 7 9" will process tracks 1, 2, 3, 4, 5, 7, and 9.
193.SH OUTPUT
194Each track is, by default, placed in a separate file named after the track
195in a subdirectory named after the artist under the current directory.
196This can be modified using the OUTPUTFORMAT and VAOUTPUTFORMAT
197variables in your abcde.conf. Each file is given an extension identifying
198its compression format, 'vorbis' for '.ogg', '.mp3', '.flac', '.spx', '.mpc', or '.wav'.
199.SH CONFIGURATION
200abcde sources two configuration files on startup - /etc/abcde.conf and
201$HOME/.abcde.conf, in that order.
202.TP
203The configuration options stated on those files can ba overriden by providing
204the appropiate flags at runtime.
205.TP
206The configuration variables have to be set as follows:
207.TP
208.B VARIABLE=value
209Except when "value" needs to be quoted or otherwise interpreted. If other
210variables within "value" are to be expanded upon reading the configuration
211file, then double quotes should be used. If they are only supposed to be
212expanded upon use (for example OUTPUTFORMAT) then single quotes must be used.
213.TP
214All sh escaping/quoting rules apply.
215.TP
216Here is a list of options abcde recognizes:
217.TP
218.B CDDBURL
219Specifies a server to use for CDDB lookups.
220.TP
221.B HELLOINFO
222Specifies the Hello information to send to the CDDB server. The CDDB
223protocol requires you to send a valid username and hostname each time you
224connect. The format of this is username@hostname.
225.TP
226.B CDDBLOCALDIR
227Specifies a directory where we store a local CDDB repository. The entries must
228be standard CDDB entries, with the filename being the DISCID value. Other
229CD playing and ripping programs (like Grip) store the entries under ~/.cddb
230and we can make use of those entries.
231.TP
232.B CDDBLOCALRECURSIVE
233Specifies if the CDDBLOCALDIR has to be searched recursively trying to find a
234match for the CDDB entry. If a match is found and selected, and CDDBCOPYLOCAL
235is selected, it will be copied to the root of the CDDBLOCALDIR if
236CDDBLOCALPOLICY is "modified" or "new".
237.TP
238.B CDDBLOCALPOLICY
239Defines when a CDDB entry should be stored in the defined CDDBLOCALDIR. The
240possible policies are: "net" for a CDDB entry which has been received from the
241net (overwriting any possible local CDDB entry); "new" for a CDDB entry which
242was received from the net, but will request confirmation to overwrite a local
243CDDB entry found in the root of the CDDBLOCALDIR directory; "modified" for a
244CDDB entry found in the local repository but which has been modified by the
245user; and "always" which forces the CDDB entry to be stored back in the root of
246the CDDBLOCALDIR no matter where it was found, and no matter it was not edited.
247This last option will always overwrite the one found in the root of the local
248repository (if any).
249.TP
250.B CDDBCOPYLOCAL
251Store local copies of the CDDB entries under the $CDDBLOCALDIR directory.
252.TP
253.B CDDBUSELOCAL
254Actually use the stored copies of the CDDB entries. Can be overriden using the
255"-L" flag (if is CDDBUSELOCAL in "n"). If an entry is found, we always give
256the choice of retrieving a CDDB entry from the internet.
257.TP
258.B SHOWCDDBFIELDS
259Coma-separated list of fields we want to parse during the CDDB parsing.
260Defaults to "year,genre".
261.TP
262.B OGGENCODERSYNTAX
263Specifies the style of encoder to use for the Ogg/Vorbis encoder. Valid options
264are \'oggenc\' (default for Ogg/Vorbis) and \'vorbize\'.
265This affects the default location of the binary,
266the variable to pick encoder command-line options from, and where the options
267are given.
268.TP
269.B MP3ENCODERSYNTAX
270Specifies the style of encoder to use for the MP3 encoder. Valid options are
271\'lame\' (default for MP3), \'gogo\', \'bladeenc\', \'l3enc\' and \'mp3enc\'.
272Affects the same way as explained above for Ogg/Vorbis.
273.TP
274.B FLACENCODERSYNTAX
275Specifies the style of encoder to use for the FLAC encoder. At this point only
276\'flac\' is available for FLAC encoding.
277.TP
278.B SPEEXENCODERSYNTAX
279Specifies the style of encoder to use for Speex encoder. At this point only
280\'speexenc\' is available for Ogg/Speex encoding.
281.TP
282.B MPPENCODERSYNTAX
283Specifies the style of encoder to use for MPP/MP+ (Musepack) encoder. At this
284point we only have \'mppenc\' available, from corecodecs.org.
285.TP
286.B NORMALIZERSYNTAX
287Specifies the style of normalizer to use. Valid options are \'default\'
288and \'normalize'\ (and both run \'normalize-audio\'), since we only support it,
289ATM.
290.TP
291.B CDROMREADERSYNTAX
292Specifies the style of cdrom reader to use. Valid options are \'cdparanoia\',
293\'debug\' and \'flac\'. It is used for querying the CDROM and obtain a list of
294valid tracks and DATA tracks. The special \'flac\' case is used to "rip" CD
295tracks from a single-track flac file.
296.TP
297.B CUEREADERSYNTAX
298Specifies the syntax of the program we use to read the CD CUE sheet. Right now
299we only support \'mkcue\', but in the future other readers might be used.
300.TP
301.B KEEPWAVS
302It defaults to no, so if you want to keep those wavs ripped from your CD,
303set it to "y". You can use the "-k" switch in the command line. The default
304behaviour with KEEPWAVS set is to keep the temporary directory and the wav
305files even you have requested the "clean" action.
306.TP
307.B PADTRACKS
308If set to "y", it adds 0's to the file numbers to complete a two-number
309holder. Useful when encoding tracks 1-9.
310.TP
311.B INTERACTIVE
312Set to "n" if you want to perform automatic rips, without user intervention.
313.TP
314.B NICE VALUES
315Define the values for priorities (nice values) for the different CPU-hungry
316processes: encoding (ENCNICE), CDROM read (READNICE) and distributed encoder
317with distmp3 (DISTMP3NICE).
318.TP
319.B PATHNAMES
320The following configuration file options specify the pathnames of their
321respective utilities: LAME, TOOLAME, GOGO, BLADEENC, L3ENC, XINGMP3ENC, MP3ENC,
322VORBIZE, OGGENC, FLAC, SPEEXENC, MPPENC, ID3, ID3V2, EYED3, METAFLAC,
323CDPARANOIA, CDDA2WAV, CDDAFS, CDDISCID, CDDBTOOL, EJECT, MD5SUM, DISTMP3,
324VORBISCOMMENT, NORMALIZE, CDSPEED, MP3GAIN, VORBISGAIN, MPPGAIN, MKCUE, MKTOC,
325DIFF and HTTPGET.
326.TP
327.B COMMAND-LINE OPTIONS
328If you wish to specify command-line options to any of the programs abcde uses,
329set the following configuration file options: LAMEOPTS, TOOLAMEOPTS, GOGOOPTS,
330BLADEENCOPTS, L3ENCOPTS, XINGMP3ENCOPTS, MP3ENCOPTS, VORBIZEOPTS, OGGENCOPTS,
331FLACOPTS, SPEEXENCOPTS, MPPENCOPTS, ID3OPTS, ID3V2OPTS, CDPARANOIAOPTS,
332CDDA2WAVOPTS, CDDAFSOPTS, CDDBTOOLOPTS, EJECTOPTS, DISTMP3OPTS, NORMALIZEOPTS,
333CDSPEEDOPTS, MKCUEOPTS, VORBISCOMMMENTOPTS, METAFLACOPTS, DIFFOPTS and
334HTTPGETOPTS.
335.TP
336.B CDSPEEDVALUE
337Set the value of the CDROM speed. The default is to read the disc as fast as
338the reading program and the system permits. The steps are defined as 150kB/s
339(1x).
340.TP
341.B ACTIONS
342The default actions to be performed when reading a disc.
343.TP
344.B CDROM
345If set, it points to the CD-Rom device which has to be used for audio
346extraction. Abcde tries to guess the right device, but it may fail. The special
347\'flac\' option is defined to extract tracks from a single-track flac file.
348.TP
349.B CDPARANOIACDROMBUS
350Defined as "d" when using cdparanoia with an IDE bus and as "g" when using
351cdparanoia with the ide-scsi emulation layer.
352.TP
353.B OUTPUTDIR
354Specifies the directory to place completed tracks/playlists in.
355.TP
356.B WAVOUTPUTDIR
357Specifies the temporary directory to store .wav files in. Abcde may use up
358to 700MB of temporary space for each session (although it is rare to use
359over 100MB for a machine that can encode music as fast as it can read it).
360.TP
361.B OUTPUTTYPE
362Specifies the encoding format to output, as well as the default extension and
363encoder. Defaults to "vorbis". Valid settings are "vorbis" (or "ogg")
364(Ogg/Vorbis), "mp3" (MPEG-1 Audio Layer III), "flac" (Free Lossless Audio
365Codec), "spx" (Ogg/Speex), "mpc" (MPP/MP+ (Musepack)) or "wav" (Microsoft
366Waveform). Values like "vorbis,mp3" encode the tracks in both Ogg/Vorbis and
367MP3 formats.
368.br
369For each value in OUTPUTTYPE, abcde expands a different process for encoding,
370tagging and moving, so you can use the format placeholder, OUTPUT, to create
371different subdirectories to hold the different types. The variable OUTPUT will
372be 'vorbis', 'mp3', 'flac', 'spx' and/or 'mpc', depending on the OUTPUTTYPE you define.
373For example
374.br
375OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}._${TRACKFILE}'
376.TP
377.B OUTPUTFORMAT
378Specifies the format for completed Ogg/Vorbis, MP3, FLAC, Ogg/Speex or MPP/MP+
379(Musepack) filenames.
380Variables are included
381using standard shell syntax. Allowed variables are GENRE, ALBUMFILE, ARTISTFILE,
382TRACKFILE, TRACKNUM, and YEAR. Default is
383\'${ARTISTFILE}-${ALBUMFILE}/${TRACKNUM}-${TRACKFILE}\'.
384Make sure to use single quotes around this variable. TRACKNUM is
385automatically zero-padded, when the number of encoded tracks is higher than
3869. When lower, you can force with '-p' in the command line.
387.TP
388.B VAOUTPUTFORMAT
389Just like OUTPUTFORMAT but for Various Artists discs. Default is whatever
390OUTPUTFORMAT is set to.
391.TP
392.B MAXPROCS
393Defines how many encoders to run at once. This makes for huge speedups
394on SMP systems. You should run one encoder per CPU at once for maximum
395efficiency, although more doesn't hurt very much. Set it "0" when using
396mp3dist to avoid getting encoding processes in the local host.
397.TP
398.B LOWDISK
399If set to y, conserves disk space by encoding tracks immediately after
400reading them. This is substantially slower than normal operation but
401requires several hundred MB less space to complete the encoding of an
402entire CD. Use only if your system is low on space and cannot encode as
403quickly as it can read.
404.TP
405.B BATCHNORM
406If set to y, enables batch mode normalization, which preserves relative
407volume differences between tracks of an album. Also enables nogap encoding
408when using the \'lame\' encoder.
409.TP
410.B NOGAP
411Activate the lame's \-\-nogap option, that allows files found in CDs with no
412silence between songs (such as live concerts) to be encoded without noticeable
413gaps. WARNING: lame's \-\-nogap disables the Xing mp3 tag. This tag is
414required for mp3 players to correctly display track lengths when playing
415variable-bit-rate mp3 files.
416.TP
417.B PLAYLISTFORMAT
418Specifies the format for completed playlist filenames. Works like the
419OUTPUTFORMAT configuration variable. Default is
420\'${ARTISTFILE}_\-_${ALBUMFILE}.m3u\'.
421Make sure to use single quotes around this variable.
422.TP
423.B PLAYLISTDATAPREFIX
424Specifies a prefix for filenames within a playlist. Useful for http
425playlists, etc.
426.TP
427.B DOSPLAYLIST
428If set, the resulting playlist will have CR-LF line endings, needed by some
429hardware-based players.
430.TP
431.B COMMENT
432Specifies a comment to embed in the ID3 or Ogg comment field of each
433finished track. Can be up to 28 characters long. Supports the same
434syntax as OUTPUTFORMAT. Does not currently support ID3v2.
435.TP
436.B REMOTEHOSTS
437Specifies a comma-delimited list of systems to use for remote encoding using
438distmp3. Equivalent to -r.
439.TP
440.B mungefilename
441mungefilename() is an abcde shell function that can be overridden via
442abcde.conf. It takes CDDB data as $1 and outputs the resulting filename on
443stdout. It defaults to eating control characters, apostrophes and
444question marks, translating spaces and forward slashes to underscores, and
445translating colons to an underscore and a hyphen.
446.br
447If you modify this function, it is probably a good idea to keep the forward
448slash munging (UNIX cannot store a file with a '/' char in it) as well as
449the control character munging (NULs can't be in a filename either, and
450newlines and such in filenames are typically not desirable).
451.TP
452.B mungegenre
453mungegenre () is a shell function used to modify the $GENRE variable. As
454a default action, it takes $GENRE as $1 and outputs the resulting value
455to stdout converting all UPPERCASE characters to lowercase.
456.TP
457.B pre_read
458pre_read () is a shell function which is executed before the CDROM is read
459for the first time, during abcde execution. It can be used to close the CDROM
460tray, to set its speed (via "setcd" or via "eject", if available) and other
461preparation actions. The default function is empty.
462.TP
463.B post_read
464post_read () is a shell function which is executed after the CDROM is read
465(and, if applies, before the CDROM is ejected). It can be used to read a TOC
466from the CDROM, or to try to read the DATA areas from the CD (if any exist).
467The default function is empty.
468.TP
469.B EJECTCD
470If set to "y", abcde will call eject(1) to eject the cdrom from the drive
471after all tracks have been read. It has no effect when CDROM is set to a flac
472file.
473.TP
474.B EXTRAVERBOSE
475If set to "y", some operations which are usually now shown to the end user
476are visible, such as CDDB queries. Useful for initial debug and if your
477network/CDDB server is slow.
478.SH EXAMPLES
479Possible ways one can call abcde
480.TP
481.B abcde
482Will work in most systems
483.TP
484.B abcde \-d /dev/cdrom2
485If the CDROM you are reding from is not the standard /dev/cdrom (in GNU/Linux systems)
486.TP
487.B abcde \-o vorbis,flac
488Will create both Ogg/Vorbis and Ogg/FLAC files.
489.TP
490.B abcde \-o vorbis:"-b 192"
491Will pass "-b 192" to the Ogg/Vorbis encoder, without having to modify the
492config file
493.TP
494.B abcde \-W 1
495For double+ CD settings: will create the 1st CD starting with the track number
496101, and will add a comment "CD 1" to the tracks, the second starting with 201
497and so on.
498.TP
499.B abcde \-d singletrack.flac
500Will extract the files contained in singletrack using the embeded cuesheet.
501.SH BACKEND TOOLS
502abcde requires the following backend tools to work:
503.TP
504.B *
505An Ogg/Vorbis, MP3, FLAC, Ogg/Speex or MPP/MP+(Musepack) encoder (oggenc, vorbize, lame, gogo, bladeenc, l3enc, mp3enc, flac, speexenc, mppenc)
506.TP
507.B *
508An audio CD reading utility (cdparanoia, cdda2wav, dagrab)
509.TP
510.B *
511cd-discid, a CDDB DiscID reading program.
512.TP
513.B *
514An HTTP retrieval program: wget, fetch (FreeBSD) or curl (Mac OS X, among others).
515.TP
516.B *
517(for MP3s) id3 or id3v2, id3 v1 and v2 tagging programs.
518.TP
519.B *
520(optional) distmp3, a client/server for distributed mp3 encoding.
521.TP
522.B *
523(optional) normalize-audio, a WAV file volume normalizer.
524.TP
525.B *
526(optional) a replaygain file volume modifier (vorbisgain, metaflac, mp3gain),
527.TP
528.B *
529(optional) mkcue, a CD cuesheet extractor.
530.SH "SEE ALSO"
531.BR cdparanoia (1),
532.BR cdda2wav (1),
533.BR dagrab (1),
534.BR normalize-audio (1),
535.BR oggenc (1),
536.BR vorbize (1),
537.BR flac (1),
538.BR toolame (1),
539.BR speexenc (1),
540.BR mppenc (1),
541.BR id3 (1),
542.BR id3v2 (1),
543.BR wget (1),
544.BR fetch (1),
545.BR cd-discid (1),
546.BR distmp3 (1),
547.BR distmp3host (1),
548.BR curl (1),
549.BR mkcue (1),
550.BR vorbisgain (1),
551.BR mp3gain (1)
552.SH AUTHORS
553Robert Woodcock <rcw@debian.org>,
554Jesus Climent <jesus.climent@hispalinux.es> and contributions from many others.