Transcode files from FLAC/WAVE to Opus/AAC/FLAC/WAVE while preserving the folder structure.
For optimal operation you need a console with good support for Unicode.
Note: On Microsoft Windows is is recommended that you use
powershell.exe
instead ofcmd.exe
.
This program is written for Python 3.7.0 and above.
Note: Your can check the version of Python with
python --version
.$ python --version Python 3.7.0
The following programs must be present in order to use audio-transcoder
.
Program name | Recommended version | Link | Available for |
---|---|---|---|
flac | 1.4.2 | xiph.org | Windows, GNU/Linux, macOS |
metaflac | 1.4.2 | xiph.org | Windows, GNU/Linux, macOS |
opusenc | 0.2-opus-1.3.1 | opus-codec.org | Windows, GNU/Linux, macOS |
neroAacEnc | 1.5.4.0 | nero.com | Windows |
neroAacTag | 1.5.1.0 | nero.com | Windows |
Note: Please read the section on installing to learn how to easily get these programs.
-
Download transcode.py
-
Make the file executable and move it to
/usr/local/bin
$ chmod u+x ./transcode.py $ mv ./transcode.py /usr/local/bin
Note: If you get permission errors you might have to use
sudo
. -
Install
flac
andopus-tools
with a packet manager$ apt install flac opus-tools # Debian, Ubuntu, etc. with APT $ yum install flac opus-tools # Fedora, RHEL, CentOS, etc. with yum $ zypper install flac opus-tools # openSUSE, SLES, etc. with ZYpp $ brew install flac opus-tools # MacOS with Homebrew (https://brew.sh/)
Note: If you get permission errors you might have to use
sudo
. -
Done
-
Download transcode.py
-
Download download_binaries.py and place it in
./bin
-
Navigate to
./bin
and execute the file download_binaries.py -
Done
Invoke transcode.py from the command line and use the following arguments.
positional arguments:
inpath file or folder to transcode
optional arguments:
-h, --help show this help message and exit
-o OUTFOLDER, --outfolder OUTFOLDER
target folder for the transcoded files
-q {0-100}, --encoding_quality {0-100}
quality setting for the encoder
-r, --recursive convert files from subfolders
-f, --force_overwrite
force overwrite of existing files
-i, --copy_image copy the embeded (cover) image file
-s {flac,wave}, --source_format {flac,wave}
filename extension of the source file
-t {opus,aac,flac,wave}, --target_format {opus,aac,flac,wave}
filename extension of the target file
--max_threads {1-64} maximum number of threads
--silent suppress output
--verbose output detailed information
--version show program's version number and exit
$ .\transcode.py C:\Users\Phil\Music\Lossless -o C:\Users\Phil\Music\Lossy -s flac -t opus -r
Note: This transcodes all FLAC files from C:\Users\Phil\Music\Lossless (including files from subfolders) to opus files, placing them in C:\Users\Phil\Music\Lossy while replicating the original folder structure.
We use Semantic Versioning 2.0.0 for versioning. For the versions available, see the tags on this repository.
- Philipp Kranz - Programming and testing
- Dominik Kranz - Testing
This project is licensed under the GNU General Public License, Version 3. See the LICENSE file for details.