Small Rust program for transcoding raw music files to smaller, lossy formats.
- Rust 94.4%
- Just 5.6%
| src |
Changed ffmpeg behaviour to automatically overwrite output files
|
|
| .gitignore | Initial Commit | |
| Cargo.lock |
Ran cargo update
|
|
| Cargo.toml |
Changed ffmpeg behaviour to automatically overwrite output files
|
|
| justfile | Initial Commit | |
| LICENSE | Added README and LICENSE | |
| README.md | Fixed typo in README | |
Transcode Music
Small Rust program for transcoding "raw" (.wav or .flac) music files to other, smaller, lossy formats in parallel.
Requirements
Your system has to have oggenc, fdkaac, or ffmpeg installed, depending on what format you intend to transcode into.
Note: these do not get embedded in the final binary. They are dynamically run during execution.
Building
Run
cargo build --release
Usage
Usage: transcode_music [OPTIONS] <TOML> <OUTPUTDIR>
Arguments:
<TOML>
Path to the TOML file that holds the album and track information.
<OUTPUTDIR>
Path to the output directory for the final transcoded music files.
Options:
-a, --audio-codec <AUDIO_CODEC>
The audio codec to transcode into
[default: fdk-aac]
[possible values: fdk-aac, ogg-vorbis, flac]
-e, --extension <EXTENSION>
The file extension for the final transcoded files.
Defaults to the codec's if not specified.
-i, --include-track-numbering
Prepends the file name with the album's track number.
-t, --number-threads <NUMBER>
Number of threads used.
0 means "number of logical cores".
[default: 0]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
At the moment, only Ogg Vorbis, AAC, and FLAC are supported.
Album.toml structure
The expected structure is easier shown in an example instead of a long explanation.
For specific TOML features like literal strings or allowed datetime formats, consider reading the official documentation.
[album]
title = "Cool Album"
artists = ["Joey"]
genre = "Metal" # optional field. Consider using https://en.wikipedia.org/wiki/List_of_ID3v1_genres strings
date = 2025年02月13日
[[album.tracks]]
file = "path/to/file_01.wav" # paths will be resolved relative to where the program is run from
title = "Banger Track"
artists = ["Joey", "ArtistName"] # optional field. Defaults to album artist(s)
number = 1
disc = 1 # optional field. Defaults to 1
comment = "Collab recording from World Tour" # optional field. Only certain export formats support comments
[[album.tracks]]
file = "path/to/file_02.flac"
title = "Hidden Addition"
number = 2
disc = 2
date = 2025年05月27日 # optional field. Defaults to album date
genre = "Rock 'n' Roll" # optional field. Defaults to album genre
comment = "Extra track only included in the May CD release"