JACK(1)

NAME
Jack - rip and encode audio CDs with one command

SYNOPSIS
jack [options]

DESCRIPTION
Jack transforms your audio CDs to FLAC, MP3 or Ogg Vorbis files. It uses several helper programs in order to achieve things like ripping, encoding and ID3 tagging. Ripping is either done via cdparanoia (in which case the ripping status is displayed by Jack as well) or cdda2wav. Jack works with several encoders, namely: oggenc, flac, lame, gogo, bladeenc, l3enc, mp3enc, and xing. Any time during operation (and even when everything is finished and the original CD has been lost) you can let Jack look up the track names at metadata services like MusicBrainz.org, GnuDB.org or others and rename the tracks accordingly. ID3 tagging of MP3s (or insertion of equivalent comment fields in Ogg Vorbis files) is performed as well.

If no lookup has been performed, Jack drops all files in a directory ~/jack/jack-xxxxxxxx, with xxxxxxxx representing the CD's CDDB/MusicBrainz disc ID. This directory is renamed by Jack when the appropriate information is known.

Most options like ripper, encoder, preferred metadata server, directory and MP3-filename format, etc. can be user-defined by changing the defaults in /etc/jackrc or by saving them to ~/.jack4rc.

While Jack is running, these keyboard commands are available:

    q or Q
        quit

    p or P
        disable ripping (for example, if you need the CD drive)

    p or P (again) or c or C
        resume ripping

    e or E
        pause/continue all encoders

    r or R
        pause/continue all rippers

    ?   toggle the copyright/help box

OPTIONS
Different options need different data-types as arguments:

bool
    can be "yes" or "no", like in --vbr=yes

string
    can be anything, like in --rename-fmt "%n.%t"

int an integer number, like in --bitrate 192 (or --bitrate=192 )

list
    multiple strings, delimited by the final ";". Example: --guess-toc file1.mp3 file2.mp3 ... fileN.mp3;

Jack understands the following options:

--add-disambiguation
    add disambiguation to the album title

--albumart-file <string>
    specific album art file to embed (default: 'None')

--albumart-max-height <int>
    maximum height when considering album art file (default: 1200)

--albumart-max-size <int>
    maximum size when considering album art file (default: 1000000)

--albumart-max-width <int>
    maximum width when considering album art file (default: 1200)

--albumart-min-height <int>
    minimum height when considering album art file (default: 250)

--albumart-min-size <int>
    minimum size when considering album art file (default: 5000)

--albumart-min-width <int>
    minimum width when considering album art file (default: 250)

--albumart-providers <string>
    list of sources for album art, currently 'coverartarchive', 'iTunes' or 'discogs'. The providers are processed in list order. If '|' is appended to a provider, the rest of the list is treated as fallbacks. (default: ['coverartarchive', 'iTunes', 'discogs'])

--albumart-recurse
    recurse into subfolders when searching for local album art

--albumart-save-prefix <string>
    prefix for saving existing embedded album art (default: 'jack.saved.')

--albumart-search <string>
    list of regex patterns for matching local album art files (default: ['.*[Cc]over.*\.(jpg|jpeg|png)$', '.*[Ff]ront.*\.(jpg|jpeg|png)$',
     '^[Ff]older\.(jpg|jpeg|png)$', '^jack\.caa\.front.*\.jpg$',
     '^jack\.itunes.*\.jpg$', '^jack\.discogs.*\.jpg$'])

--append-year <string>
    append this string to the directory name (default: '')

--bitrate, -b <int>
    target bitrate in kbit/s (default: 160)

--caa-albumart-prefix <string>
    prefix for saving fetched album art files from coverartarchive (default: 'jack.caa.')

--caa-albumart-sizes <string>
    list of album art sizes to download from coverartarchive: 'original', 'small',
     'large', '250', '500' or '1200'. (default: ['original', 'large'])

--caa-albumart-types <string>
    download these album arts from coverartarchive ('front' and/or 'back') (default: ['front'])

--char-filter <string>
    convert file names using a Python method (default: '')

--charset <string>
    charset of filenames (defaults to your locale).

--check-toc, -c
    compare TOC-file and CD-TOC, then exit. Jack caches the TOC of a CD in a file ("jack.toc"). If you want to know if the inserted CD matches the TOC-file in the current directory, use this option.

--claim-dir, -C
    rename directories even if they were not created by Jack.

--cont-failed-query
    continue without metadata if query fails.

--create-dirs, --no-create-dirs, -D <bool>
    tells Jack to create sub-directories in which Jack puts all the files for the current CD. If no metadata is available, i.e. when not using -Q , these directories will be named "jack-xxxxxxxx" where "xxxxxxxx" stands for the CD's ID. Otherwise dir_template (see above) will be used. (default: on)

--debug
    show debug information.

--debug-write
    write debug information to a file.

--device <string>
    The device name of your CD-ROM drive. (default: /dev/cdrom)

--dir-multi-cd-template <string>
    dir_template, if album consists of multiple discs (default: '%a/%l (CD %d)')

--dir-multi-cd-unknown-number-template <string>
    dir_template, if album consists of multiple discs, and the number of discs is unknown (default: '%a/%l (CD %d)')

--dir-template <string>
    if directories are renamed, this is the format used (default: '%a/%l')

--dir-titled-cd-template <string>
    dir_template, if album consists of multiple discs, and the current disc has a title (default: '%a/%l (CD %d: %t)')

--dir-titled-cd-unknown-number-template <string>
    dir_template, if album consists of an unknown number of multiple discs, and the current disc has a title (default: '%a/%l (CD %d: %t)')

--discogs-albumart-prefix <string>
    prefix for saving fetched discogs album art files (default: 'jack.discogs.')

--discogs-albumart-token <string>
    discogs personal authentication token

--discogs-albumart-types <string>
    download these album arts from discogs ('primary' and/or 'secondary') (default: ['primary'])

--dont-work, -d <bool>
    do not perform DAE, encoding, tagging or renaming. This may be useful if you only want to do a metadata query, e.g. while another Jack is running.

--download-progress-interval <int>
    interval in seconds for showing progress of slow downloads, zero is no progress (default: 5)

--edit-metadata <bool>
    open an editor to change the CDDB information which has been obtained previously (only useful with -Q).

--embed-albumart <bool>
    embed album art

--encoder-name, -E <string>
    use which encoder (default: 'oggenc')

-e, --encoders <int>
    encode how many files in parallel. If you have a SMP machine or simply want to stress your system, you can have Jack encode several files at once. (default: 1)

--exec, -x <string>
    run predefined command when finished.

--extt-is-artist <bool>
    the artist is contained in the EXTT fields. The EXTT fields are lines in the metadata file which contain additional data for each track. As it is the submitting user's choice what to use them for, Jack cannot determine by itself what they were intended for. You have to provide this information.

--extt-is-comment
    a track comment is contained in the EXTT fields.

--extt-is-title
    the track title is contained in the EXTT fields.

--fetch-albumart <bool>
    download album art while querying

--file-artist <string>
    which metadata artist name to use for filenames (default: 'as-in-mb')

--force <bool>
    do not ask. Like when deleting incomplete files.

--from-image, -F <string>
    read audio data from an image file. Like --from-tocfile, but the image itself is specified instead of the TOC-file. If you do not have a TOC-file (or do not specify a TOC-file), the TOC is read from the CD itself.

--from-tocfile, -f <string>
    rip from a CD image created by cdrdao on harddisk. The specified TOC-file contains the name of the image file. Use --from-image if Jack cannot find the image file.

--genre, -G <string>
    overrule genre from metadata.

--get <string>
    show value of a config option

--guess-toc, -g <list>
    make up a TOC from the MP3 file given in mp3_files. Format is track_01.mp3 ... track_nn.mp3 ; Note that the trailing " ; " is only necessary if you want to append more options to your command line. You can use it to do a metadata query based on MP3s alone - no need for the CD. Very useful if you have no idea which CD the MP3s are from. The MP3s must be given in the same order as they were on their CD. The generated TOC file is similar, but not identical to the TOC of the CD - do not submit these!

--help, -h
    show summary of options.

--itunes-albumart-country <string>
    two letter country code of iTunes store to query (default: 'us')

--itunes-albumart-limit <int>
    limit number of matches when querying for iTunes album art, zero is no limit (default: 1)

--itunes-albumart-prefix <string>
    prefix for saving fetched iTunes album art files (default: 'jack.itunes.')

--itunes-albumart-sizes <string>
    list of album art sizes to download from iTunes: 'thumb', 'standard' or 'high' (default: ['standard', 'high'])

--keep-wavs, -k <bool>
    do not delete WAVs after encoding them.

--longhelp (<string>)
    all commandline switches, some have additional information.

--lookup <bool>
    start a browser and look up the CD.

--max-load <float>
    only start new encoders if your system's load is below the specified value. /proc/loadavg must be readable by you for this to work. (default: 10.0)

--multi-mode <bool>
    try to query metadata servers for all directories in searchdirs which have no metadata.

--nice, -n <int>
    nice-level with which the encoders are started. (default: 12)

--no-albumart-ignorecase
    do not ignore case when searching for local album art.

--no-usage-win
    do not show the help screen while running.

--only-dae, -O
    only produce WAVs, implies --keep-wavs (default: off)

--otf <bool>
    on-the-fly operation. Only on some encoders/rippers. Do not create WAVs, pipe ripper output through the encoder. (default: no)

--overwrite, -o <bool>
    overwrite existing files, i.e. do not check if already ripped WAVs or an already encoded file seem to be OK. Use this if you know something went wrong last time. (default: off)

--overwrite-albumart <string>
    whether to overwrite existing album art files, 'always', 'never' or 'conditional' (default: 'conditional')

--pregap-name <string>
    WAV file name stub to save the track 1 pregap to if it is at least 10 seconds. There could be a hidden track. Currently only works when reading from a disc image file (default: 'None')

--quality <float>
    VBR encoding quality. -1 is lowest, 10 highest (default: 6). You can also specify a float.

--query, -q <string>
    do metadata query when all is done. This is useful if Jack was previously run without a metadata query. If all tracks are done you do not even have to have a CD inserted as the TOC is cached by Jack. After having finished ripping and encoding, Jack will rename the files and tag them.

--query-if-needed <bool>
    like --query-now, but only if metadata has not been successfully queried before.

--query-now, -Q
    do metadata query when starting. Use this if you are connected to the Internet when starting Jack. Note that the query may need user-interaction. After having finished ripping and encoding, Jack will rename the files and tag them.

--read-ahead, -a <int>
    read how many WAVs in advance. At most read_ahead + num_encoders WAVs are ripped before a track has completely been encoded. (default: 99)

--readme
    export README.md to given file.

--refresh-metadata
    forget about choices made in previous queries.

--remove-files
    have Jack remove its temp "jack.*-files". Be careful - do not delete them too early!

--rename, -R
    rename and tag files according to metadata file. On startup, Jack creates a blank metadata entry file (except if --query-now is used, then the file is queried from your metadata server). If you have changed its contents (e.g. because the CD was unknown to the metadata service) and want to rename and tag your MP3s accordingly, use this option. Give all other needed options too, like --tracks, --encoder-name, etc.

--rename-dir, --no-rename-dir <bool>
    rename directory as well. (default: rename).

--rename-fmt <string>
    format of normal files. (default: '%a - %l - %n - %t')

--rename-fmt-va <string>
    format of Various Artists files. (default: '%l - %n - %a - %t')

--rename-num <string>
    format of the track number (%n, printf() style) used to rename the files (default: '%02d')

--reorder, -r <bool>
    optimize track-order for disk space. This can save you some peak disk space during the encoding process; this may make it possible to do a CD which would otherwise fail to be encoded.

--replacement-chars <list>
    unusable chars are replaced by the corresponding list item (default: ['%', ''])

--ripper <string>
    which program to use for extracting the audio data (default: 'cdparanoia').

--save
    save options to ~/.jack4rc file and exit.

--scan-dirs <int>
    Scan this many levels from the current working directory for a matching TOC-file (0 to disable, default: 2).

--search <list>
    add these directories to the list of directories searched when looking for the workdir (default: '.').

--server <string>
    which metadata service to use. Do not forget to set your HTTP proxy. Currently either "gnudb" or "musicbrainz" (default: musicbrainz).

--set-dae-tag
    set DAE info tags.

--show-albumart
    show the album art that has been embedded in an external viewer.

--silent-mode <bool>
    be quiet (no screen output).

--space, -s <int>
    forcibly set usable disk space, in bytes. This option lets you limit the disk space Jack uses, maybe you need it for something else? Be careful: if set too high or too low, ripping and encoding will probably fail. The default is to look how much is free and to use this value.

--swab, --no-swab, -S <bool>
    swap byte order from image file. As cdrdao momentarily only outputs "raw" .cdr files, you quite likely want to swap the byte order. Try this option if your WAVs and encoded files contain only noise. This is on by default as cdrdao currently generates .cdr files that are "wrong".

--todo
    print what would be done and exit.

--tracks, -t <string>
    limit ripping and encoding to the specified tracks, use comma to separate tracks. Ranges are also possible; 5-9 is equivalent to 5,6,7,8,9; 12- is like specifying track 12,...,last_track. The default is to process the whole CD.

--undo-rename, -u <bool>
    undo file renaming and exit. If you do not like how Jack renamed your files, use this option to restore the previous state. Several levels of undo are possible. Note that ID3 tags are not restored.

--unusable-chars <list>
    characters which cannot be used in filenames (default: '/').

--upd-progress
    have Jack re-create its temp files. Use this if you deleted them too early.

--update-metadata, -U
    update the metadata info and exit.

--usage-win <bool>
    show the help screen while running.

--various <bool>
    when parsing metadata, Jack assumes that if the disc artist is set to "Various" the track titles have the format "[artist] - [title]". If the disc title is set to something else and you still want the above behaviour, use --various.

--various-swap
    exchange artist and title, many metadata entries have them wrong.

--vbr, --no-vbr, -v <bool>
    generate variable bitrate files, only on encoders which support this. (default: no).

--wait <bool>
    wait for key press before quitting.

--workdir, -w <string>
    where to create directories and put the files.

--write-m3u
    create a playlist in .m3u format. This feature is experimental.

--year, -Y <int>
    overrule year from metadata (0=do not set)

EXAMPLES
Insert a CD, fire up Jack:
    jack

Now watch it work. After having finished, you have the following files on your HD: track_01.mp3, track_02.mp3, ..., track_nn.mp3 plus jack.toc, jack.freedb, jack.progress. The last three are used to store the state Jack is in so it can resume work when interrupted.

Jack will create a directory called jack-xxxxxxxx for you, there it stores all the files for the CD whose id is xxxxxxxx. After a metadata query this directory is renamed to something human-readable, like "Artist - Title".

When Jack is interrupted, call it again using the same command line as before to resume work, in this case
    jack

Now let us try a metadata query:
    jack -q
If the query is successful the files will be renamed to something more readable and will be tagged accordingly using ID3 or Vorbis tags. The file jack.freedb will contain the queried metadata entry, and the original file will be backed up as jack.freedb.bak.

You can use the --rename-fmt option in order to specify the format of the name which will be given to your audio tracks. A list of valid options can be found below. You may also want to specify a set of characters which are not usable and should be replaced. For example, on Unix systems the slash (/) should most certainly be replaced with something else. The VFAT filesystem also does not support double quotes ("). In order to replace such characters, you can specify the options unusable_chars together with replacement_chars. For example,
    jack -Q --rename-fmt "%n-%t" --unusable-chars A I ; --replacement-chars a i ;
will query the metadata server, rip and encode all tracks of the CD and save the files in a format which will contain the track number and the title. All occurrences of the letters A and I will be replaced with their lower-case versions. These options can also be put in one's configuration file using the following format:
    unusable_chars:[' ', '/']
    replacement_chars:['_', '_']
This will replace whitespace and slashes with underscores. If you want to convert all characters to lower-case, you do not have to manually specify all of them but can use the following option instead:
    char_filter:.lower()

All in one: query, rip, encode, cleanup:
    jack -Q --remove-files

Editing / normalizing / stripping the WAV files before encoding:
    jack -O --remove-files ; gnoise *wav ; jack -g *wav ; jack
Just replace gnoise by the operation you'd like to perform.

ENVIRONMENT VARIABLES
There are several environment variables which can be used in Jack's exec hooks:

JACK_BASE_DIR
    lists Jack's base directory in which files are stored.

JACK_CUR_DIR
    lists the current directory of Jack in which files of the current album are put.

JACK_JUST_ENCODED
    lists all track names which have just been encoded.

JACK_JUST_RIPPED
    lists all track names which have just been ripped.

FORMAT STRINGS

%n  Track number

%a  Artist

%t  Track title

%l  Album title

%y  Album release year

%g  Album genre

%d  Disc number

FILES

/etc/jackrc
    Site-wide configuration file.

~/.jack4rc
    User-specific configuration file. Use the --save option to save your configuration to this file.

AUTHOR
Arne Zellentin <zarne@users.sf.net> is the author of Jack.

SEE ALSO
cdparanoia(1), cdda2wav(1), flac(1), oggenc(1) and lame(1)