Skip to content

About output format

nu774 edited this page Jun 7, 2014 · 17 revisions

By default, qaac produces m4a for AAC and ALAC. If you don't specify output filename by -o, output filename is automatically generated from input filename.

When you are encoding into AAC, you can optionally specify --adts to create ADTS file instead of m4a. ADTS is not a convenient format for storing songs since it cannot store tags and seeking is inefficient. However, it is a streamable format, and you can output to stdout in case of ADTS.

When you specify decoding mode with -D, WAV file is created. stdout is also usable for WAV output.

When encoding to m4a, you can optionally specify --no-optimize option. By default (without --no-optimize), qaac works like the following:

foo.wav -----> temporary file ------> foo.m4a
encode optimize

This "optimization" does the same as "Optimize MP4 layout" of foobar2000 context menu command. It re-layout the MP4 container.

Finally, for any of AAC, ALAC, and PCM, you can output to CAF (Core Audio Format) by --caf switch. This can be sometimes useful when used with -D(PCM output), since qaac writes tags to CAF file but does not writes for WAV file. CAF file allows stdout output in case of PCM.

Output bit depth

In case of ALAC or WAV, you can optionally use -b to specify output bit depth. Usually, output bitdepth remains the same as input. However, when some sort of DSP filter is applied, internal format can be converted into floating point. In this case, 32bit float WAV file is written if you don't specify -b.

For ALAC encoding, 16bit, 20bit, 24bit, and 32bit is available. For WAV output, you can specify arbitrary value between 2 and 32. On WAV case, -b 32 means 32bit float.

When bit depth gets lowered down with -b, and final bit depth is lower than 18, qaac will apply TPDF dither by default. If you don't want it, use --no-dither option.

When input or intermediate format is float and you want to decrease bit depth to integer, it's often safer to additionally use --limiter to avoid hard clip. --limiter applies smart limiter that softly clips portions where peak exceeds (near) 0dBFS. Softly means that it applies non-linear filter to surrounding half cycles (nearest zero crossing point to zero crossing point) so that the result fits in under 0dBFS but still is smoothly connected to other parts, resulting in much smaller audible distortion than dumb hard clips.

Although --limiter is mainly useful as a pre-processor for converting float format to integer, it actually convert internal format to float if it is not already float, and it is not restricted to this specific use case./p>