flacser is a Rust CLI tool that converts lossless FLAC, AIFF, and WAV files using ffmpeg.
It supports single-file conversion, directory batch conversion with parallel execution, and a read-only doctor command for readiness checks.
# Homebrew
brew install chrizzlekicks/flacser/flacser
# Cargo
cargo install flacserffmpegffprobe- Rust toolchain (for building from source)
Install the FFmpeg suite:
# Arch
sudo pacman -S ffmpeg
# Ubuntu / Debian
sudo apt install ffmpeg
# macOS (Homebrew)
brew install ffmpegWindows:
- install FFmpeg
- ensure
ffmpeg.exeandffprobe.exeare available onPATH
cargo build --releaseBinary path:
target/release/flacserflacser <COMMAND> [OPTIONS]convert [OPTIONS] <INPUT_PATH>: convert between FLAC, AIFF, and WAVdoctor [OPTIONS] [INPUT_PATH]: check whether the system is ready to run conversions
<INPUT_PATH> for convert can be:
- a single
.flac,.aiff,.aif, or.wavfile - a directory (batch mode)
convert:
--to <FORMAT>: target format (flac,aiff, orwav); required unlessFLACSER_CONVERT_TOis set--output-dir <OUTPUT_DIR>, -o <OUTPUT_DIR>: write outputs into a specific directory--dry-run, -n: plan/execute flow without runningffmpegorffprobe--recursive, -r: recurse into subdirectories in directory mode--flatten, -f: write recursive directory outputs directly into the output directory and fail if flattened output names collide--jobs <JOBS>, -j <JOBS>: set the number of parallel conversion jobs
doctor:
--to <FORMAT>: target format (flac,aiff, orwav) to validate conversion planning; falls back toFLACSER_CONVERT_TO--output-dir <OUTPUT_DIR>, -o <OUTPUT_DIR>: diagnose a specific output directory--jobs <JOBS>, -j <JOBS>: diagnose a specific parallel worker limit
doctor always discovers supported audio files recursively when validating a directory input. When --to is provided, files already in the target format are excluded from conversion planning.
- Converts one supported
.flac,.aiff,.aif, or.wavinput file to the requested target format - Source format is inferred from the file extension case-insensitively
.aifis accepted as AIFF input, but--to aifis not supported- Default output path is next to the input file
- If
--output-diris set, output is written there - Supports all cross-format FLAC/AIFF/WAV conversions; same-format conversion is rejected
- Non-recursive by default (top-level only)
- Recurses into subdirectories when
--recursiveis set - Finds
.flac,.aiff,.aif, and.wavfiles case-insensitively - Excludes files already in the target format
- Preserves relative structure from the input root
- Uses the target format's canonical extension; AIFF outputs use
.aiff - Non-flatten planning checks collisions on exact output paths
- With
--recursive --flatten, writes all outputs directly into the output root and fails if flattened output names collide, including ASCII case-insensitive pairs such asSong.aiffandsong.aiff --flattenhas no effect without--recursivebecause non-recursive discovery only sees top-level files- Skips outputs that already exist
- Runs jobs in parallel using Rayon
- Prints per-job progress during execution as
[completed/total] processed - Default jobs:
max(1, cpu_cores - 1) - Summary reports actual workers used for the run
- Continues processing when individual jobs fail
- Exits
1if any job fails and130when interrupted
- Prints a read-only report with
ok,warn, andfailchecks - Verifies
ffmpegandffprobeavailability and version - Checks detected CPU cores and default worker settings
- Optionally validates an input path, target format, output directory, and configured worker limit
- Requires
--toorFLACSER_CONVERT_TOto validate output planning for an input path - Validates directory inputs with recursive discovery (always scans subdirectories)
- Exits non-zero when any required check fails
Single file:
flacser convert ./music/track.flac --to aiffSingle file with output dir:
flacser convert ./music/track.flac --to wav --output-dir ./outDirectory dry run:
flacser convert ./music --to aiff --dry-runDirectory conversion with two parallel jobs:
flacser convert ./music --to flac --jobs 2Environment fallback target:
FLACSER_CONVERT_TO=aiff flacser convert ./musicFlatten recursive directory output:
flacser convert ./music --recursive --flatten --output-dir ./outSystem readiness check:
flacser doctor ./music --to aiff --output-dir ./out --jobs 2- FLAC output uses the
flacencoder - WAV and AIFF output select PCM codecs from the source bit depth and sample format reported by
ffprobe - WAV output keeps the first audio stream and drops cover art / non-audio / extra streams
- Metadata is best-effort and depends on ffmpeg/container support
Run all tests:
cargo testTest suite includes:
- unit tests for discover/plan/convert/summary/config logic
- integration tests for CLI behavior and exit codes
- cross-platform integration tests with mocked
ffmpeg/ffprobeandPATHportability helpers
CI runs the Rust test suite on Ubuntu, Windows, and macOS.
Interrupt handling is covered by tests; OS signal hookup remains platform-specific.
MIT