Wiki

Clone wiki

transflac / TransFLAC

TransFLAC This utility is invoked as follows:

transflac $input-flac-dir $output-lossy-dir $lossy-codec $codec-quality
transflac quit     - Immediately exit
transflac exit     - Immediately exit
transflac -h       - Display HELP
transflac --help   - Display HELP
Where:
$input-flac-dir is the location of the base directory which contains the FLAC files which are to be processed
$output-lossy-dir is the location of the output directory where you wish to place the lossy files
$lossy-codec is the desired output lossy codec to be used to convert the FLAC files:
OPUS|OGG|AAC|MP3  
$codec-quality represents the quality preset you wish to use:
LOW|MEDIUM|STANDARD|HIGH|PREMIUM  
OPUS STANDARD quality provides Full bandwidth stereo music, good quality approaching transparency - and is the recommended setting.

CODEC LOW MEDIUM STANDARD HIGH PREMIUM
OPUS 48 kbps 64 kbps 96 kbps 128 kbps 192 kbps
OGG 80 kbps 96 kbps 112 kbps 128 kbps 160 kbps
AAC 40 kbps 80 kbps 96 kbps 128 kbps 224 kbps
MP3 85 kbps 100 kbps 115 kbps 130 kbps 165 kbps

If any input parameters are not provided, you will be prompted.

If you have customized options in $HOME/.transflac.conf those values will be substituted.

The utility scans the $input-flac-dir; recursively walking the structure for FLAC files. When a FLAC file is found, it's name and creation date will be checked against that of any corresponding lossy file of the specified codec in the target directory. If the FLAC file timestamp is older than that of the lossy file, processing will be bypassed. If the timestamp of the FLAC file is newer, or if no lossy file exists, then a new lossy file will be created - preserving all associated tag information.

Normal processing flow is as follows:

  1. src-tf-set-colors.sh is sourced to allow color display of messages.
  2. src-tf-set-variables.sh is sourced to set system defaults. If $HOME/.transflac.conf exists, src-tf-conf-override.sh will be sourced to apply any valid local overrides.
  3. src-tf-ck-input.sh is sourced to validate the $input-flac-dir. If none has been entered, you will be prompted. If no FLAC files exist in the directory structure, you will be requested to enter another directory; since no files exist to be processed. Any symlinks entered will be resolved and the physical path will be displayed.
    transflac_input.png
    transflac_input_syn.png
  4. src-tf-ck-output.sh is sourced to validate the $output-lossy-dir. If none has been entered, you will be prompted. If no directory exists, one will be created. Any symlinks entered will be resolved and the physical path will be displayed.
    transflac_output.png
    transflac_output_syn.png
  5. src-tf-ck-codec.sh is sourced to validate the $lossy-codec. If none has been entered, you will be prompted. Valid codecs accepted are: OPUS|OGG|AAC|MP3. Note: FFMPEG is required to transcode to MP3 or AAC formats. If you do not have FFMPEG installed, only OPUS|OGG will be shown as valid codecs.
    transflac_codec.png
  6. src-tf-ck-quality.sh is sourced to validate the $codec-quality. If none has been entered, you will be prompted. Valid quality presets accepted are: LOW|MEDIUM|STANDARD|HIGH|PREMIUM.
    transflac_quality.png
  7. src-tf-codec.sh is sourced to walk the input directory structure and transcode the FLAC files to the desired lossy codec. transflac_finished.png
  8. rsync is then called to synchronize any supported album art files which may exist in the $input-flac-directory to the $output-lossy-directory.

Updated