/transam

Transcoding of Audio Media

Primary LanguageC++GNU General Public License v3.0GPL-3.0

TransAM - Transcoding Audio Media

TransAM is a tool for transcoding between a variety audio formats while tracking or manipulating the audio metadata, ie. id3 tags. Namely the mp3, flac, aac, and Vorbis ogg formats are supported. It makes use of existing (FOSS) audio tools for the decoding and/or encoding of files.



Overview

TransAM wraps various audio tools with sane defaults as well as keeping tags/metadata intact across the transcoding process. It will keep tags intact while transcoding, or manipulate tags as defined by the user via taglib. The tool is intended to operate on directories of audio files and will decode, transcode (decode and encode), or edit tags.

Audio Tools

The audio formats are supported via existing opensource tools:

Additionally, support for the Nero AAC encoder/decoder is provided for legacy purposes as AAC support and quality has historically varied in the underlying libfaac or libavcodec libraries used by ffmpeg, while the Nero implementation still proves to be stable and efficient in providing quality AAC files. Of note, the ffmpeg aac encoder has improved since the project was originally created and is now the default encoder for mp4/aac files. To prefer the use of the Nero Encoder, pass the --no-ffmpeg option.

Build Requirements

TransAM makes use of the tcanetpp library for tree data-structure and various String and File utilities. Both TransAM and tcanetpp make use of the tcamake project for providing the build environment.

The taglib library can installed via the systems package manager as detailed below.



External Codec support / dependencies

The various tools are expected to be available via the system PATH. Nearly all tools (save NeroAAC) are available via distribution package managers. These packages should be installed accordingly.

RHEL (yum) based distributions:

  • flac
  • lame
  • vorbis-tools
  • libvorbis-devel
  • ffmpeg
  • taglib-devel

Debian/Ubuntu (apt) based distributions:

  • flac
  • lame
  • vorbis-tools
  • libvorbis-dev
  • ffmpeg
  • libtag1-dev

NeroAAC

NeroAAC is a proprietary codec that is no longer maintained, but remains a stable and efficient option as an AAC encoder/decoder (and possibly still better than libfaac or ffmpeg). It can still be acquired separately from the following locations:

Nero vs FFMPEG

To prefer NeroAAC over ffmpeg, use the -F or --no-ffmpeg option. ffmpeg is the default encoder/decoder for AAC files. Note that Nero will not encode raw pcm audio.

Codec Versions

TransAm has been tested with the following versions:

  • LAME 64 >=3.100
  • Flac 1.3.3
  • Vorbis Tools 1.4.0
  • FFmpeg 4.4.2
  • NeroAAC v1.5.1

Examples

Transcode the files in the current directory to mp3 with a constant bitrate of 256k, and keepting tags intact.

transam -b 256 -t mp3 .

Set the Artist and Album name for tracks in the current directory only.

transam -A -T "ARTIST:Grateful Dead|ALBUM:Aoxomoxoa" .

Decode the input files to wav pcm and do not re-encode.

transam -d -r .

Transcode the input files to AAC, but leave the decoded WAV files intact. Overwrite any existing files.

transam -t m4a --no-erase --clobber .

Renumber the tracks in a given directory to be sequential (based on sorted filenames).

transam -L
transam -R .
transam -L

Tagging by filename

The script resources/transetTagByName.sh will attempt to tag the media title from the filename. Useful when dealing with raw recordings such as those pulled in by Ardour or other multi-track recording apps. This requires a file-naming convention of name-trackno-title.ext. For example, HeavenlyHana-s1t01-HanaChant.wav, would result in the TITLE tag being set to Hana Chant.