Skip to content

Instantly share code, notes, and snippets.

@josk0
Created November 14, 2025 17:19
Show Gist options
  • Select an option

  • Save josk0/0152b4fc34c5d4a543d1d46e60a2fda3 to your computer and use it in GitHub Desktop.

Select an option

Save josk0/0152b4fc34c5d4a543d1d46e60a2fda3 to your computer and use it in GitHub Desktop.
abcde.conf to make abcde ("A Better CD Encoder") work on macOS in 2025
CDROM=/dev/rdisk4 # on macOS: need to specify raw disc device for cdparanoia to work
# Use `diskutil list` to find right device
OUTPUTTYPE="flac,m4a"
ACTIONS=cddb,read,getalbumart,encode,tag,embedalbumart,move,clean
# === Output location and file naming ===
OUTPUTDIR="$HOME/Music/CDRips"
OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}. ${TRACKFILE}'
VAOUTPUTFORMAT='${OUTPUT}/${ALBUMFILE}/${TRACKNUM}. ${ARTISTFILE} - ${TRACKFILE}'
# Keep the wav files after encoding. Set it to "y" and remove "clean" from
# the list of default actions, since we purge the temp directory as default.
#KEEPWAVS=y
# === CD Reader Options ===
# CD reader program to use - currently recognized options are 'cdparanoia',
# 'libcdio' (cd-paranoia),'icedax', 'cdda2wav', 'dagrab', 'pird',
# 'cddafs' (Mac OS X only) and 'flac'.
CDROMREADERSYNTAX=cdparanoia
CDPARANOIA=cd-paranoia # brew doesn't install default binary name
CDPARANOIAOPTS="--never-skip=40" # up to 40 retries
# === Metadata lookup ===
CDDBMETHOD=cddb # musicbrainz would be preferable, make sure to remove cddb from ACTIONS
CDDBURL="http://gnudb.gnudb.org/~cddb/cddb.cgi"
#CDDISCID=cd-discid # location of the CD identification program
# === Albumart lookup ===
# see: https://github.com/sahib/glyr/wiki/Commandline-arguments
GLYRCOPTS="--parallel 6" # default is 0 where glyr will adjust this value itself
# === Default format settings ===
# FLAC encoder settings (lossless)
FLACENCODERSYNTAX=flac
FLAC=flac
FLACOPTS='-s -e -V -8'
# M4A/AAC with FFMPEG encoder settings (compressed)
# options: fdkaac, ffmpeg, neroAacEnc, faac, qaac, fhgaacenc
AACENCODERSYNTAX=ffmpeg
FFMPEGENCOPTS='-c:a aac -q:a 2' # native ffmpeg codec, highest quality (var bitrate)
#FFMPEGENCOPTS='-c:a libfdk_aac -vbr 4' # Fraunhofer AAC, variable bitrate (quality 4/5)
#FFMPEGENCOPTS='-c:a libfdk_aac -b:a 256k' # Fraunhofer AAC, fixed bitrate
# AAC with AFCONVERT (compressed)
# Works when OUTPUTTYPE is AAC but not for M4A
# Apple's own afconvert is apparently pretty good, but not supported by abcde
# it works unless abcde tries to pass metadata in parameters (which it does for M4A)
#AACENCODERSYNTAX=qaac # Apple's afconvert on macOS should have same syntax as the Win port qaac
#WINE= # but may need to set wine binary to nothing (qaac syntax calls via wine)
#QAAC=afconvert # and point to afconvert as qaac binary
#QAACENCOPTS='-d aac -b 256000 -q 127 -s 3'
# === Filename sanitizing ===
# thanks to: https://notes.enovision.net/linux/rip-cds-with-abcde
mungefilename ()
{
echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]"
}
# === Other settings ===
MAXPROCS=2 # run up to 4 encoder processes in parallel
PADTRACKS=y # makes tracks numbered 01, 02 etc. instead of 1, 2, etc.
#EXTRAVERBOSE=3

abcde on macOS (2025)

A configuration for abcde (A Better CD Encoder) that works on macOS in 2025.

What is abcde?

abcde is a command-line CD ripper that automates the entire process: reading audio from CDs, looking up metadata, encoding to multiple formats, embedding album art, and organizing your music library. This gist provides a working setup for macOS in 2025.

Why not use the macOS Music app?

  1. Quality: This configuration uses cdda paranoia (good error correction), the Fraunhofer FDK AAC encoder for AAC and M4A files, Apple's excellent afconvert for AAC files, and FLAC for lossless compression
  2. Versatility: abcde speaks FLAC, which the Music app doesn't support
  3. Convenience: abcde can encode different formats at the same time, running it from the Terminal

Why rip CDs at all in 2025?

Now that's the question.

Installation

Install the required dependencies via Homebrew:

brew install abcde cd-discid ffmpeg libcdio-paranoia atomicparsley

Optional: High-Quality AAC Encoding

For better AAC/M4A quality using the Fraunhofer FDK-AAC codec, install ffmpeg from the homebrew-ffmpeg tap:

brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-fdk-aac

Then uncomment the FDK-AAC line in .abcde.conf.

Configuration

  1. Download the .abcde.conf file from this gist
  2. Place it in your home directory as ~/.abcde.conf
  3. Important: Edit the CDROM device path to match your system
    • Run diskutil list to find your CD drive
    • Update the CDROM line with your raw disk device (e.g., /dev/rdisk4)

Usage

  1. Insert an audio CD
  2. Open Terminal and run:
    abcde
  3. Follow the prompts to verify CD information
  4. abcde will automatically rip, encode, tag, and organize your music

Ripped files will be saved to ~/Music/CDRips organized by artist and album.

Output Formats

The default configuration encodes to two formats simultaneously:

  • FLAC - Lossless archival format
  • M4A/AAC - Compressed format for everyday listening

You can modify the OUTPUTTYPE variable in .abcde.conf to change this.

Known Issues & Future Development

MusicBrainz Support

The configuration currently uses the CDDB protocol for metadata lookup. MusicBrainz would be preferable but currently has issues with the Homebrew formula (Perl version conflicts or formula problems). If you want to experiment, replace cddb with musicbrainz in the ACTIONS line.

Homebrew Formula Issues

The current abcde Homebrew formula has several problems:

  • Incorrect dependencies
  • MusicBrainz tools don't work properly
  • Uses outdated code

Upstream sources:

CD-discid Deprecation

The Homebrew formula for cd-discid (needed for cddb lookup) is deprecated and needs updating. A potential replacement: https://sourceforge.net/p/discid/code/HEAD/tree/

Credits

Configuration based on various sources and adapted for macOS. Filename sanitization function from https://notes.enovision.net/linux/rip-cds-with-abcde

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment