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