Emil Miler

Transcoding your music library with acxi

Managing a music library is easy with tools such as Picard from MusicBrainz, but here is how I transcode and sync my FLAC library by using acxi, a powerful audio processing tool.

It works similarly to Rsync by cloning data from one place to another, but acxi can also transcode files to other formats in the process. This is great for, say, converting a FLAC library to Opus, because storing FLAC files in a phone is just insane. Having most of my music in FLAC is perfect because of no loss in quality from transcoding to lossy formats. Audiophiles begone!


Acxi is written in Perl, so a working Perl runtime is needed. Installation can be done either from a repository, if your distribution provides a package, or downloading the script from GitHub directly.

wget -O /usr/local/bin/acxi https://github.com/smxi/acxi/raw/stable/acxi
wget -O /usr/local/share/man/man1/acxi.1 https://github.com/smxi/acxi/raw/stable/acxi.1
chmod +x /usr/local/bin/acxi

The output paths are important, if you later want to use the -U option for self-update, for which you also need curl.

Acxi can also do transcoding in parallel based on the number of threads you have. This functionality needs perl-parallel-forkmanager. If we want to do transcoding from FLAC to Opus, we need opus-tools as well.


I have written a simple PKGBUILD for Pacman. There are some problems with publishing it on AUR. Also bear in mind, the following was written at the time of publishing this article and is now out-of-date.

pkgdesc='Audio conversion tool that helps sync lossless to lossy formats'
optdepends=('perl-parallel-forkmanager: Parallel processing (FORK)'
            'ffmpeg: FLAC resampling'
            'lame: MP3 encoding'
            'flac: MP3 encoding'
            'vorbis-tools: Ogg encoding'
            'opus-tools: Opus encoding'
            'shorten: SHN to FLAC conversion'
            'ffmpeg: SHN to FLAC conversion')

package() {
	cd "$srcdir/acxi-$pkgver"
	install -D -m755 "acxi" "${pkgdir}/usr/bin/acxi"
	install -D -m644 "acxi.1" "${pkgdir}/usr/share/man/man1/acxi.1"


Acxi reads a config file during every execution in this order:

$XDG_CONFIG_HOME/acxi.conf > $HOME/.conf/acxi.conf > $HOME/.acxi.conf

We can create a file ~/.config/acxi.conf and set some basic configuration options.


This tells acxi to convert FLAC to Opus and directly copy all MP3 files. Some obscure albums were never released in FLAC. In my case, the source directory is a NFS mount point from my file-server and transcoded files are stored locally on my laptop. The FORK=12 option creates 12 parallel processes for transcoding, which should ideally match your thread count.

Executing acxi would then transcode and copy all files not present in the destination directory.

Issues with opus-tools

There are some FLAC files which cause problems during transcoding. If that happens to you, try building opus-tools from source. See more at https://github.com/xiph/opus-tools/issues/66


2022-09-27, Emil Miler
Page updates:
  • 2022-12-03 — Updated Pacman PKGBUILD to version 3.5.05