Why Use flac2all
At its core, flac2all is both a wrapper and a scheduling program. It takes a list of FLAC files and uses various codecs to queue and manage the transcoding process. One advantage of this approach is that flac2all does not depend on a single encoder, which means that you can easily adapt the program to any new format you might want to use. For example, you can install the custom Fraunhofer FDK AAC encoder alongside regular AAC. Lastly, flac2all also preserves the folder structure of your FLAC collection, so you do not need to redo the directory of your archive while using this program. These features make flac2all a handy utility if you are looking for a quick and easy way to recreate your FLAC collection in a different format.
Installing flac2all
Before you install flac2all, it’s important to obtain all of its dependencies to ensure that there will be no conflicts after installation: The next thing to do is to download flac2all through pip, a Python-specific package manager that you can use to install additional software. Run the following command to use pip: This will install flac2all to the current user’s “.local” directory. So if you are on a multi-user system, other users will not be able to run the program. In order to run flac2all, include your “.local” directory to your machine’s PATH variable by adding the following line of code to your “.bash_profile” file: Lastly, either restart or log out of your current session to apply the new settings, after which you can run flac2all -h to confirm that you have properly installed the program.
Using flac2all to Transcode Audio
The developer of flac2all designed the program to be as simple as possible. For example, the syntax for transcoding a FLAC directory to a single format looks like this:
The first element after “flac2all” highlights the format that you want to transcode to. I am converting my FLAC folder to MP3 in this example.The second element contains options for the current transcode job. Here, the -o option tells flac2all to send any MP3 files to the “output” folder.Lastly, the third element indicates the source folder for your FLAC files. In my case, it is my “royalty-free” folder.
Transcoding to Multiple Formats
You can also use flac2all to transcode files to multiple formats in parallel, which can be useful if you want to transfer your archive to players with different format requirements. For example, I can run the following command to transcode my “royalty-free” folder to both MP3 and Opus: Note that a multiple-format transcode will take longer than a single-format transcode because flac2all will encode each file in your directory for every format that you specify. In my case, transcoding MP3 and AAC will take twice as long as only transcoding MP3.
Creating Custom Transcode Jobs
Aside from creating simple transcodes, it is possible to tweak how the encoders behave with flac2all, which is especially helpful if you want the copy of your archive to be of a certain audio quality. Look at the following command, for example. This command tells the program to use the LAME MP3 encoder to transcode my “royalty-free” folder at a constant bitrate of 320k. You can also create custom jobs for multi-format transcodes. For example, the following command tells flac2all to create a custom transcode with MP3 and Opus:
Creating a flac2all Transcode Cluster
While you can use flac2all on a single computer, it is also possible to spread the program across multiple systems – a practical solution to speed up the transcoding process. Ensure that you have the following resources ready:
Two or more machines that can directly connect to each otherA NAS that you can access across all machines because the master flac2all process only instructs its worker clients to process existing dataA reliable network connection between the master process and its worker clients
Knowing these factors, this tutorial will focus on creating a small flac2all cluster between two Ubuntu 22.04 machines.
Setting Up a Network Mount
Create a network storage mount to begin. For this, I am going to use SSHFS since it is easy to use and available to almost all Linux distributions. To start, install SSHFS on all of the machines that you want to use: Next, create the folder to which SSHFS will mount. I will create a “royalty-free” folder in the home directory of my worker machine: Now mount the “royalty-free” directory to each of your worker machines with the following command:
Starting the flac2all Cluster
You can now start the transcoding cluster by running the master process and adding both -m and -C flags to flac2all. For example, run this command on your main machine to create a master process: Unlike regular flac2all, creating a master process will not start the transcoding session. In order to transcode files, you also need to connect the workers to the master process by running the following command on your worker machines: Once done, the worker client will create a headless process that connects to the master program. After that, flac2all will start immediately once it finds a handful of workers on standby. Image credit: Unsplash and Wikimedia Commons All alterations and screenshots by Ramces Red For example, running flac2all opus […] without the Opus encoder will result in a “FileNotFound” error. You can fix the issue by installing ffmpeg. This is a catch-all program that will also install most of the common audio encoders. Run sudo apt install ffmpeg to add ffmpeg to your system.