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