View Full Version : qaac - a new command line AAC/ALAC encoder using QuickTime API


b66pak
27th April 2010, 20:19
for who is interested...

http://sites.google.com/site/qaacpage/home

see also https://forum.doom9.org/showthread.php?p=1925401#post1925401

qaac is a command line AAC/ALAC encoder using QuickTime API, strongly influenced by http://tmkk.hp.infoseek.co.jp/qtaacenc/.

* Can read WAV, AIFF, AU, RawPCM, FLAC, Wavpack, ALAC. W64. (see libsndfile (http://www.mega-nerd.com/libsndfile/) [every PCM format supported by libsndfile is also supported by qaac]). Cuesheet(*.cue) is also supported from version 0.05. Support for +4gb .WAV form file/pipe added from version 0.12!
* Encodes as AAC-LC / AAC-HE / ALAC into standard ISO MP4 container.
* As for AAC, ADTS output is also supported from version 0.06.
* As for WAV, AIFF, AU, RawPCM: pipe input is supported.
* As for AIFF, FLAC, Wavpack, ALAC: embedded tags can be automatically pulled (not all).
* Can process multiple input files, wild card can be used.

Download latest version from here (http://sites.google.com/site/qaacpage/cabinet). You only have to download qaac-x.xx.zip, if you don't want to compile/browse source codes at all. Of course, you must install the latest Apple QuickTime to run the app.

qaac uses following libraries.

* Apple QuickTime SDK
* libmp4v2 (modified)
* libsndfile
* FLAC
* wavpack
* libid3tag
* GNU getopt (modified)
* boost


qaac 0.17
Usage: qaac [options] infiles....

"-" as infile means stdin.
In ADTS output mode, "-" as outfile means stdout.

Main options:
-d <dirname> Output directory, default is cwd
-a, --abr <bitrate> AAC ABR mode / bitrate
-V, --tvbr <n> AAC True VBR mode / quality [0-127]
-v, --cvbr <bitrate> AAC Constrained VBR mode / bitrate
-c, --cbr <bitrate> AAC CBR mode / bitrate
--he HE AAC mode (Can't use TVBR)
-A, --alac ALAC encoding mode
-q, --quality <n> AAC encoding Quality [0-2]
-r, --rate <option> Sample rate option (AAC only)
Specify one of the followings:
keep: Try to preserve the original rate
auto: Let QuickTime choose the optimal one
<number>: Literal rate in Hz
-s, --silent Don't be verbose
-n, --nice Give lower process priority
--downmix <mono|stereo> Downmix to mono/stereo
--no-optimize Don't optimize MP4 container file after encoding
--adts ADTS(raw AAC)output, instead of m4a(AAC only)
--ignorelength Assume WAV input and ignore the data chunk length
-R, --raw Raw PCM input
-S, --stat Save bitrate statistics into file

Options for single input mode only:
-o <filename> Output filename

Options for Raw PCM input only:
--raw-channels <n> Number of channels, default 2
--raw-rate <n> Sample rate, default 44100
--raw-format <str> Sample format, default S16L
Sample format spec:
1st char: S(igned) | U(nsigned) | F(loat)
2nd part: Bitwidth
Last part: L(ittle Endian) | B(ig Endian)
Cases are ignored. u8b is OK.

Tagging options(single input only):
--title <string>
--artist <string>
--band <string>
--album <string>
--grouping <string>
--composer <string>
--comment <string>
--genre <string>
--date <string>
--track <number[/total]>
--disk <number[/total]>
--compilation
_

N.B. I am not the developer of this tool!
_

dansrfe
27th April 2010, 22:16
What are the benefits v.s. Nero AAC Encoder?

b66pak
28th April 2010, 17:30
apple aac encoding engine...
_

Midzuki
28th April 2010, 17:44
apple aac encoding engine...

Is it really better than NeroAACEnc ? :confused:

Of course, you must install the latest Apple QuickTime to run the app.

Is the quality-level worth the bloat? :devil: :D

b66pak
10th May 2010, 18:40
new version...

release 0.05
posted May 9, 2010 3:06 PM by n u

Added cue sheet(*.cue) input support(experimental).

qaac foo.cue

will encode each track into separate m4a files.
_

b66pak
11th May 2010, 20:09
new version...

release 0.06
posted 3 hours ago by n u

Added ADTS output mode(AAC only). This can be used for streaming output to stdout, but tagging is not supported here.

this is very interesting...
_

b66pak
12th May 2010, 19:19
fix bug...

release 0.07
posted 12 hours ago by n u

Fixed a bug: -d option didn't work for cuesheet input.
_

b66pak
21st May 2010, 19:42
bug fix...

release 0.08
posted 16 hours ago by n u

Bugfix: Enabled "--rate" option on TVBR mode.

By this fix, on QuickTime 7.6.5, you might get lower quality output than you specified by "--tvbr" option. On 7.6.6, it should work OK. Therefore, I strongly recommend upgrading QuickTime if you are using 7.6.5.

(I've already upgraded to 7.6.6 and I have no working environment with 7.6.5, so I can't reproduce the problem on 7.6.5, sorry. This is why I used the wording... "might".)
_

b66pak
22nd May 2010, 19:15
new bug fix...

release 0.09
posted 15 hours ago by n u

Now I fixed the problematic "--rate" code.

In release 0.08 post, I've written of QT 7.6.5 specific problem, but it was not. Therefore, I think this version will work in QT 7.6.5 (although I can't test it).
_

Blue_MiSfit
23rd May 2010, 20:55
IIRC, QuickTime's CBR mode is very good when compared to Nero's.

Keiyakusha
23rd May 2010, 21:29
So this is basically qtaacenc with wider support of input formats? Thats the only difference?

b66pak
24th May 2010, 17:35
and the aac (mpeg4 adts) output to stdout...
_

Blue_MiSfit
29th May 2010, 12:09
... and it's an awesomely automatable CLI app :)

SeeMoreDigital
29th May 2010, 13:59
What... Nobody has made a GUI yet!

mackworth
30th May 2010, 00:04
Have a question, hoping someone can help.

I am trying to use this for my subsonic server so I can stream via aac instead of mp3 to my mobile device.

[5/29/10 6:51:18 PM EDT] DEBUG TranscodeInputStream Starting transcoder: [c:\subsonic\transcode\ffmpeg] [-i] [G:\Music\iTunes\Arctic Monkeys\Arctic Monkeys EP\03 Fake Tales Of San Francisco.mp3] [-f] [wav] [-]
[5/29/10 6:51:18 PM EDT] DEBUG TranscodeInputStream Starting transcoder: [c:\subsonic\transcode\qaac] [-a] [128] [--adts] [-] [-]
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) initializing QTML...done
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac)
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) QuickTime 7.6.6
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac)
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac)
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) Method: Average Bit Rate
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) Bitrate: 128
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) Quality: Best
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac)
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) 0/0 samples processed
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) 0/0 samples processed
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) Overall bitrate: 2.06719kbps
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac)
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac)
[5/29/10 6:51:19 PM EDT] DEBUG InputStreamReaderThread (c:\subsonic\transcode\qaac) File contains data in an unknown format.

So as shown above, I decoding the mp3 with this command ffmpeg -i %s -f wav - where %s is the file name, and decoding to stdin. And then trying to encode to stout with qaac -a %b --adts - - where %b is the bitrate. %s and %b get filled in automatically by subsonic as shown above. Even if I try:

C:\subsonic\transcode>ffmpeg -i "G:\Music\iTunes\Arctic Monkeys\Arctic Monkeys EP\03 Fake Tales Of San Francisco.mp3" -f wav - | qaac -a 128 -o out.mp4 -

FFmpeg veinritsiailiozinng QSTMVL.N..-r21231-Sherpya, Copyright (c) 2000-2010 F
abrice Bellard, et al.
built on Jan 16 2010 05:42:31 with gcc 4.2.5 20080919 (prerelease) [Sherpya]
libavutil 50. 7. 0 / 50. 7. 0
libavcodec 52.47. 0 / 52.47. 0
libavformat 52.47. 0 / 52.47. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.15. 0 / 1.15. 0
libswscale 0. 8. 0 / 0. 8. 0
libpostproc 51. 2. 0 / 51. 2. 0
[mp3 @ 015ebec0]max_analyze_duration reached
[mp3 @ 015ebec0]Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'G:\Music\iTunes\Arctic Monkeys\Arctic Monkeys EP\03 Fake Ta
les Of San Francisco.mp3':
Metadata:
TPE1 : Arctic Monkeys
TALB : Arctic Monkeys EP
TPE2 : Arctic Monkeys
TIT2 : 03 Fake Tales Of San Francisco
TPUB : Domino/Ada
TYER : 2005
TDRC : 2005
Duration: 00:02:58.17, start: 0.000000, bitrate: 128 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, 2 channels, s16, 128 kb/s
Output #0, wav, to 'pipe:':
Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mp3 @ 02b88260]overread, skip -6 enddists: -4 -4
done

QuickTime 7.6.6

<stdin>
Method: Average Bit Rate
Bitrate: 128
Quality: Best
0/0 samples processed
Overall bitrate: 2.06719kbps
av_interleaved_write_frame(): Error while opening file

b66pak
30th May 2010, 16:58
this is working for me:

ffmpeg -i input.mp3 -acodec pcm_f32le -f wav - | sox -t wav --ignore-length - -t wav - | qaac -s -a 128 -o output.mp4 -

i am using sox (http://sox.sourceforge.net/) v14.3.0...
_

mackworth
30th May 2010, 17:59
Interesting, because this fails for me:

c:\subsonic\transcode\ffmpeg -i "G:\Music\iTunes\Ace Of Base\The Bridge\01 Beautiful Life.mp3" -acodec pcm_f32le -f wav - | c:\subsonic\transcode\sox -t wav --ignore-length - -t wav - | qaac -s -a 128 --adts E:\tempACC.aac -

Duration: 00:03:39.27, start: 0.000000, bitrate: 217 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, 2 channels, s16, 32 kb/s
c:\subsonic\transcode\sox WARN wav: wave header missing FmtExt chunk
c:\subsonic\transcode\sox WARN wav: Length in output .wav header will be wrong s
ince can't seek to fix it
Output #0, wav, to 'pipe:':
Stream #0.0: Audio: pcm_f32le, 44100 Hz, 2 channels, flt, 2822 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mp3 @ 02c48260]Header missing
Error while decoding stream #0.0
E:\tempACC.aac: The system cannot find the file specified.
c:\subsonic\transcode\sox FAIL sox: `-' error writing output file: Broken pipe
av_interleaved_write_frame(): Error while opening file


but this works:

C:\subsonic\transcode>c:\subsonic\transcode\ffmpeg -i "G:\Music\iTunes\Ace Of Ba
se\The Bridge\01 Beautiful Life.mp3" -acodec pcm_f32le -f wav - | c:\subsonic\tr
anscode\sox -t wav --ignore-length - -t wav - | qaac -s -a 128 -o E:\tempAAC.m4a -

Duration: 00:03:39.27, start: 0.000000, bitrate: 217 kb/s
Stream #0.0: Audio: mp3, 44100 Hz, 2 channels, s16, 32 kb/s
Output #0, wav, to 'pipe:':
c:\subsonic\transcode\sox WARN Stream #0.0wav: : Audio: pcm_f32le, 44100 Hz,
2 channels, flt, 2822 kb/swave header missing FmtExt chunk

Sc:\subsonic\transcode\sox WARN twav: rLength in output .wav header will be wron
g since can't seek to fix ite
am mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
[mp3 @ 01478260]Header missing
Error while decoding stream #0.0
Error while decoding stream #0.0ate=2822.4kbits/s
size= 75474kB time=219.06 bitrate=2822.4kbits/s
video:0kB audio:75474kB global headers:0kB muxing overhead 0.000088%

So maybe its the --adts mode thats not working for me?

b66pak
30th May 2010, 18:18
you forgot "-o"...line should be:

c:\subsonic\transcode\ffmpeg -i "G:\Music\iTunes\Ace Of Base\The Bridge\01 Beautiful Life.mp3" -acodec pcm_f32le -f wav - | c:\subsonic\transcode\sox -t wav --ignore-length - -t wav - | qaac -s -a 128 --adts -o E:\tempACC.aac -
_

mackworth
30th May 2010, 20:04
You are right, this seems to work:

c:\subsonic\transcode\ffmpeg -i "G:\Music\iTunes\Ace Of Base\
The Bridge\01 Beautiful Life.mp3" -acodec pcm_f32le -f wav - | c:\subsonic\trans
code\sox -t wav --ignore-length - -t wav - | c:\subsonic\transcode\qaac -s -a 12
8 --adts -o - -

It works on the command line, but no subsonic, but atleast I know qaac is working. Thanks a lot :)

b66pak
4th June 2010, 18:39
new version...

release 0.10
posted 6 hours ago by n u

Removed junk MP4 box(trak.udta.name) from the MP4 output, which was produced by libmp4v2.

By this fix, now aacgain can open qaac's MP4 output (Programs like foobar2000, QuickTime and mp4box could open MP4 files produced by qaac with no problem, but I found aacgain couldn't open it).
_

b66pak
29th June 2010, 16:19
new version...

release 0.11
posted 7 hours ago by n u

* Added --nice option for setting lower process priority. In fact, qaac ran at the lowest(idle) priority up to this version. From now on, normal priority is the default, and you can specify --nice if you want qaac run at idle priority.
* Added --ignorelength option. This is for PCM wav source only, and ignore the "data" chunk size. Sometimes you may have to set this if you want to feed qaac from pipeline.
_

SeeMoreDigital
29th June 2010, 16:27
Hi b66pak ,

Are you able to provide a sample please. So I can test in a hardware player?

b66pak
29th June 2010, 17:04
*------*
|sample (http://www.mediafire.com/?nwmn000qmqq)|
*------*

encoding line and log:

qaac --tvbr 127 --quality 2 --rate keep sample.wav -o sample.q127.m4a
initializing QTML...done

QuickTime 7.6.5

sample.wav
Method: Variable Bit Rate
TVBR Quality: 127
Quality: Best
547248/547248 samples processed
Overall bitrate: 249.391kbps

qaac --tvbr 127 --quality 2 --rate keep --adts sample.wav -o sample.q127.aac
initializing QTML...done

QuickTime 7.6.5

sample.wav
Method: Variable Bit Rate
TVBR Quality: 127
Quality: Best
547248/547248 samples processed
Overall bitrate: 249.391kbps
_

SeeMoreDigital
30th June 2010, 22:34
Thanks b66pak.... The samples play fine :)

b66pak
1st July 2010, 18:12
important bug fix...

release 0.12
posted 47 minutes ago by n u

Fixed a bug in the wav parser for --ignorelength option.
_

b66pak
28th July 2010, 18:32
new version...
release 0.13
posted 15 hours ago by n u

Adopted qtaacenc's new feature -- Encoder configs are embedded into metadata.
_

SeeMoreDigital
28th July 2010, 21:06
Does anybody know if there has been any listening tests comparing this AAC encoder with other AAC encoders yet?

b66pak
9th August 2010, 19:16
new feature:
release 0.14
posted 16 hours ago by n u [ updated 16 hours ago ]

Added --downmix option for downmixing multichannel source into mono/stereo.
_

shon3i
9th August 2010, 20:26
@SeeMoreDigital, i think that IgorC preparing some test on HA.org forum, but i don't know is test started yet.

@b66pak, what is general difference between your cli and other from here http://tmkk.hp.infoseek.co.jp/qtaacenc/?

b66pak
10th August 2010, 18:40
I am not the developer of this tool! I edited the first post to reflect this!

qaac support input from various formats, cuesheets and multiple input files (wild card can be used)...can encode to alac and raw aac...can downmix multichannel audio (using qt mixer)...can output aac (mpeg4 adts)
to stdout...
_

b66pak
11th August 2010, 18:28
important bug fix...
release 0.15
posted 2 hours ago by n u

Important bug fix release.

libmp4v2's MP4 optimize function was using temporary file in an inadequate manner by default, and causing problems below:

* Same temporary filename was used between multiple instances of qaac, which resulted in a failure at the end of the encoding stage.
* Tempfile's directory was fixed to "..", which means you might have failed encoding if ".." was not writable.
_

kidjan
7th October 2010, 17:05
I see you're using modified mp4v2 binaries--I'm a developer on that project. If you can give me patches, I can try to integrate them into trunk. In particular I'd be curious if you've made any changes for the trak.udta.name issue, and your changes for the MP4Optimize call would be interesting to see.

let me know over on http://code.google.com/p/mp4v2/

b66pak
7th October 2010, 18:52
I am not the developer of this tool! I edited the first post to reflect this!

you can mail the dev...it is very friendly...(details and sources here: http://sites.google.com/site/qaacpage/home)
_

O.T. when do you plan a new release for mp4v2?
_

kidjan
8th October 2010, 08:40
Thanks--sorry, I missed that!

Re: mp4v2 release, good question. I'd recommend people use r355, as there's some pretty serious issues with 1.9.1 that make using it risky (in particular, see here (http://groups.google.com/group/mp4v2/browse_thread/thread/c19e8203ac2a27f0/1192d9fac9ffcd87?lnk=gst&q=noring#1192d9fac9ffcd87)), and at this point trunk has quite a few bug fixes and enhancements in it. I'd like to release 2.0 in the next month or two if I can whittle down the bug/enhancement list a bit more.

b66pak
8th October 2010, 18:01
new version v0.17...
release 0.17
posted 13 hours ago by n u

I'm sorry, I've written but forgot to open the change log for the previous release (0.16).

New release 0.17 fixed a bug in 0.16 --adts mode:

0.16, with --adts option specified, generated a file named like foo.aac.tmp, not foo.aac

release 0.16
posted Aug 29, 2010 6:14 AM by n u

* Added --no-optimize option. By default, qaac optimizes the MP4 container after encoding has finished. "optimize" means arranging MP4 box in a better order for playing and eliminating unneeded free areas. However, when you run qaac from foobar2000(or something), it will rewrite the MP4 container afterward. In this case, optimizing with qaac will be useless and just a time consuming process.
* Fixed a problem:
When running from dbPoweramp, qaac produced 8.3 DOS-like filename.

It seems that dbPoweramp uses some trick to pass the outfilename to the CLI encoder.

dbPoweramp first creates 0 bytes file with usual long file name, then pass 8.3 DOS format short file name to CLI encoder as a command line. This is maybe in order to avoid the trouble around unicode filenames, which many CLI encoder can't handle correctly.

Therefore, CLI encoder tries to open the file using the 8.3 DOS file name. In Windows file system, this is considered to be identical with the original long file name, therefore original file -- which dbPoweramp has created -- is opened for writing. This is what dbPoweramp expects.

As for qaac, qaac uses a temporary file to optimize the MP4 container file after encoding. Therefore, qaac finally "renames" to the file name passed as a command line (which is a 8.3 DOS-like short file name). And, this result in the 8.3 filename problem, which you don't expect.
_

b66pak
11th October 2010, 19:59
new version...
release 0.18
posted 3 hours ago by n u

Updated libmp4v2 to svn trunk r399. I have rewritten some modules due to the libmp4v2's interface change.

Thanks to Jeremy Noring -- libmp4v2's developer, some of my patches were merged into libmp4v2's trunk.

r399 needs a slight modification to work with qaac, therefore qaac 0.18 still depends on my custom build of libmp4v2. However, I hope I will soon be able to use vanilla libmp4v2.
_

Anakunda
27th October 2011, 23:59
Hello which is highest -q quality, 0 or 2 ?

the_weirdo
28th October 2011, 09:17
Hello which is highest -q quality, 0 or 2 ?

q=2 is highest quality. It's also default value.

Asmodian
29th October 2011, 00:13
I noticed that when pipeing from eac3to to qaac I couldn't get it to work unless I use 16bit audio. Has anyone been sucessful piping 24 or 32 bit audio to qaac?

edit:
I don't know what my issue was, testing again to be sure of the command line and this worked:
eac3to.exe in.mp2 stdout.pcm -24 | qaac.exe -o out.m4a --tvbr 127 --raw --raw-channels 2 --raw-rate 48000 --raw-format S24B -

b66pak
29th October 2011, 03:45
post your command line please...
_

Asmodian
29th October 2011, 04:44
Sorry I took a long time editing my above post to add command line and didn't see your request, I wouldn't have edited if there had been a reply. :(

Any ideas for 32 bit audio? I think I just don't know how to get raw 32 bit out of eac3to. Sorry I think my issue is with the wrong tool for this thread.

tebasuna51
29th October 2011, 13:02
Maybe with:
eac3to.exe in.mp2 stdout.wav | qaac.exe -o out.m4a --tvbr 127 --ignorelength -

24 bits (default for eac3to) is enough for a mp2 source.

Asmodian
29th October 2011, 21:41
Thanks.

Yes, I have learned that for this source (and many other sources) I will not get anything by going above 24 bit. eac3to is smart enough to not give me extra useless bit depth.

kypec
26th March 2013, 21:11
Can anyone explain to me what is the difference between --abr and --cvbr modes when encoding at the same target bitrate, 80kbps for instance?:confused:
I know that both output files will have ~80kbps variable bitrate so what would be the reason to pick one in favor of the other mode?
Does ABR allow bigger fluctuations of actual bitrate throughout the file?
Does CVBR mode apply narrow bitrate limits in which the average (desired) bitrate can fluctuate?

==EDIT==
Found this Technical Note TN2237 (http://developer.apple.com/library/mac/#technotes/tn2237/_index.html) where different encoding strategies are explained in detail:
Encoding Strategy

These encoding strategies (a.k.a bit rate control modes) are used with the -s parameter in afconvert and the kAudioCodecPropertyBitRateControlMode (AudioUnit/AudioCodec.h) property.

Constant Bit Rate (CBR) kAudioCodecBitRateControlMode_Constant - Recommended for live streaming.

This mode achieves a constant target bit rate and is completely compliant to the CBR mode specified in the MPEG-4 standard. This mode is suitable for constant-bit-rate network transmission when decoding in real-time with a fixed end-to-end audio delay. However, due to the strict constant bit rate constraint, this mode offers the lowest audio quality and highest complexity among all the encoding modes offered.

Average Bit Rate (ABR) kAudioCodecBitRateControlMode_LongTermAverage - Default Mode, recommended for controlling file size.

A target bit rate is achieved over a long term average (typically after the first few seconds of encoding). Unlike the CBR mode, this mode does not provide constant delay when using constant bit rate transmission, but provides best overall quality while still being able to strictly control the resulting file size with less complexity than the CBR mode.

Variable Bit Rate (VBR) kAudioCodecBitRateControlMode_Variable - Recommended for controlling audio quality.

The audio signal is encoded with constant (and settable) quality and virtually no bit rate constraints. This is the best mode to achieve consistent audio quality across many files and the smallest file size to achieve that quality. It also has the lowest complexity of all the encoding modes.

Variable Bit Rate But Constrained (VBR Constrained) kAudioCodecBitRateControlMode_VariableConstrained - Recommended as a compromise between VBR and ABR.

This mode is similar to VBR but limits the average bit rate variation. The lower limit is the user-selected bit rate. Higher bit rate is adapted for difficult tracks and can generate larger files than the ABR mode.

I seem to go with ABR then when more predictable bitrate/filesize is required for my purposes.

kotuwa
8th September 2014, 10:37
q=2 is highest quality. It's also default value.
Why is 2 the highest quality?
Usually Other encoders use lower values for high quality and higher value for lower quality neh!
Like Lame, x264, x265, Xvid etc...
If I did not see this, without knowing I was going to use -q 0
:sly:

detmek
8th September 2014, 11:31
Because Apple set it that way. Qaac only follows what Apple Coreaudio uses. And you shouldn't really change default values if you don't know what those values mean or you didn't read manual, right?

BTW, with x264/5, Xvid ect... only CRF/QP scale uses lower values for higher quality. Every other setting uses higher value for higher quality (me, subme).

kotuwa
8th September 2014, 22:14
BTW, with x264/5, Xvid ect... only CRF/QP scale uses lower values for higher quality. Every other setting uses higher value for higher quality (me, subme).
More close related with LAME vbr quality and encoding quality as it is audio...
in x264 etc most of those things u mention related to number or number range, not quality, so it is being literal... :D

kotuwa
8th September 2014, 22:19
hey BTW...
After converting AC3 5.1 into AAC 5.1 M4A using QAAC
it shows
Channel count : 2 channels
Original Channel count : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Why it show 2 channels :confused:

SeeMoreDigital
8th September 2014, 22:21
hey BTW...
After converting AC3 5.1 into AAC 5.1 M4A using QAAC
it shows
Channel count : 2 channels
Original Channel count : 6 channels
Channel positions : Front: L C R, Side: L R, LFEWhy it show 2 channels :confused:
What application gave you that information?

sneaker_ger
8th September 2014, 22:25
MediaInfo, probably. We had a discussion about that recently:
http://www.hydrogenaud.io/forums/index.php?showtopic=85135&view=findpost&p=867076

kotuwa
12th September 2014, 19:02
Thanks... :)
another question, how to swap Left and Right Channels when encoding?
what are the switches?
Is there any way or any tool that can do this in AAC tracks without reencoding?

sneaker_ger
12th September 2014, 19:12
another question, how to swap Left and Right Channels when encoding?
what are the switches?
This is specifically mentioned in the documentation (https://github.com/nu774/qaac/wiki/Command-Line-Options), read it!
--chanmap 2,1

asarian
13th September 2014, 03:11
What are the benefits v.s. Nero AAC Encoder?

Well, for one, that it doesn't depend on a 10-year-old Nero 7 package that I just never been able to get working in Windows 7. :p

kotuwa
13th September 2014, 09:31
Well, for one, that it doesn't depend on a 10-year-old Nero 7 package that I just never been able to get working in Windows 7. :p
What!? :angry:
As I know last NeroAACEncoder is released in 2009.
And no need of a nero package... unlike QAAC, single EXE can be downloaded and no extra setup is needed in NeroAACEnc. Nero used to give that exe, but not anymore I think... But easily downloadable from many other websites...
QAAC would be better, but not fro the reasons you mentioned :D

tebasuna51
13th September 2014, 10:30
QAAC is better than NeroAacEnc at low bitrates (there are test until ~ 96 Kb/s for stereo), with more bitrate the difference can be negligible.

kotuwa
16th October 2014, 14:21
Did a QAAC encode using MeGUI. HE-AAC CVBR.
mediainfo shows this
Writing application : qaac 2.44, CoreAudioToolbox 7.9.8.3, AAC-HE Encoder, CVBR 40kbps, Quality 96
What us the Quality 96 part?
What are the other values of this quality?
I know that there is a --quality switch that has 0,1,2 values..
Is this related to it?... probably not...
any switch related to this quality?
:confused:

IgorC
22nd May 2015, 17:13
Reminder: Apple was a winner (highest audible quality) amongst AAC encoders according to blind tests. http://listening-tests.hydrogenaud.io/igorc/aac-96-a/index.htm

qaac 2.49

Changelog:
[qaac] release 2.49
posted 2 hours ago by nu 774
Fixed issues on MP4Source:
Fixed handling of Nero style chapters starting from non-zero timestamp (typically inserted by fb2k and old neroaacenc).
Fixed handling of reading MP4 files with multiple elst entries.


[qaac] release 2.48 (refalac 1.48)
posted 10 hours ago by nu 774
Fixed an issue on MP4Source: trailing samples were discarded under certain conditions.


[qaac] release 2.47 (refalac 1.47)
posted 58 minutes ago by nu 774
Large file (>= 4GB) output is now supported. Very long duration (beyond 32bit limit) is also supported, but the latter is not compatible with QuickTime 7.
On very large files, container optimization can take several minutes. You can disable it by --no-optimize.


[qaac] release 2.46 (refalac 1.46)
posted an hour ago by nu 774
Fixed an issue on DLL loading: when a DLL qaac tries to load depends on other missing DLLs, OS was showing a modal dialog which effectively stopped the process until it is closed.
Allow -A option for refalac to be compatible with qaac.


[qaac] release 2.45 (refalac 1.45)
posted 40 minutes ago by nu 774
Added qaac64.exe that works with iTunes 64bit (ver 12.1).
Switched to static C runtime linking. Now you don't need msvcr120.dll and msvcp120.dll anymore.
Minor bug fixes.

Asmodian
22nd May 2015, 21:08
:thanks:

Great to see qaac updated, it is an excellent tool and I use it regularly. :)

Brazil2
23rd May 2015, 10:02
Reminder: Apple was a winner (highest audible quality) amongst AAC encoders according to blind tests.
At 96 kbps.

foxyshadis
24th May 2015, 11:46
Reminder: Apple was a winner (highest audible quality) amongst AAC encoders according to blind tests. http://listening-tests.hydrogenaud.io/igorc/aac-96-a/index.htm

FDK is considered higher quality now. Still, Apple AAC is extremely close, no harm using it, especially at 128 and up.

manolito
24th May 2015, 12:07
FDK is considered higher quality now. Still, Apple AAC is extremely close, no harm using it, especially at 128 and up.

Can you back this up with some test results?

I am using libfdk-aac from within ffmpeg, it does sound pretty good, but VBR modes seem to be problematic.


Cheers
manolito

SeeMoreDigital
24th May 2015, 14:58
FDK is considered higher quality now. Still, Apple AAC is extremely close, no harm using it, especially at 128 and up.I wonder if LoRd_MuldeR has thought about incorporating this (Fraunhofer FDK) 'open source' version of the AAC encoder into his LameXP audio encoding application?

LoRd_MuldeR
24th May 2015, 15:55
I wonder if LoRd_MuldeR has thought about incorporating this (Fraunhofer FDK) 'open source' version of the AAC encoder into his LameXP audio encoding application?
See here:
https://forum.doom9.org/showthread.php?p=1721930#post1721930

;)

SeeMoreDigital
24th May 2015, 16:21
Thanks

IgorC
24th May 2015, 19:29
FDK is considered higher quality now. Still, Apple AAC is extremely close, no harm using it, especially at 128 and up.
Hehe. That's simply not the case.

Fraunhofer developer (on hydrogenaudio board) has said that their FhG AAC encoder from Winamp still provides better quality than FDK.
Some personal tests also indicates the same.
So it's still Apple > FhG Winamp > FDK.

manolito
24th May 2015, 21:05
Thanks for setting this straight...

Cheers
manolito

stax76
6th August 2015, 19:31
In StaxRip currently only wav and flac are defined as possible input formats, are there any other formats supported?

hello_hello
7th August 2015, 05:11
Fraunhofer developer (on hydrogenaudio board) has said that their FhG AAC encoder from Winamp still provides better quality than FDK.
Some personal tests also indicates the same.
So it's still Apple > FhG Winamp > FDK.

I can't say I've compared them as I tend to use bitrates (or VBR quality settings) that are transparent enough for me not to be able to tell the difference, and I use QAAC for encoding "soundtrack" audio mainly due to it having the --no-delay option, but I'll say one thing for FhG/Winamp, it's very fast. VBR encoding is probbly around twice the speed of the other encoders.

My main dislike when it comes to FDKAAC is the huge bitrate difference between the VBR quality settings, especially the higher -m 4 and -m 5 quality settings. -m 4 seems a bit low while -m 5 is too high. Although I found the gap can be closed somewhat by specifying a low pass filter in the command line. I settled on -w 18500 for both as it increases the low pass frequency for -m 4 and lowers it for -m 5 and seems to produce more sensible bitrates.
http://wiki.hydrogenaud.io/index.php?title=Fraunhofer_FDK_AAC#Bandwidth

LigH
20th September 2015, 10:38
There are new dummies for the icudt55.dll (https://www.hydrogenaud.io/forums/index.php?showtopic=85135&view=findpost&p=907418) as addition to makeportable for qaac.

tebasuna51
2nd October 2016, 11:11
WARNING with last qaac 2.60 version:
http://forum.doom9.org/showthread.php?p=1782018#post1782018

sneaker_ger
2nd October 2016, 16:46
tebasuna5, which 7.1 configuration would you recommend for e.g. BluRay rips? The new one from qaac >=2.61 or the old one from <=2.59?

tebasuna51
3rd October 2016, 03:05
For 5.1 all seems work fine.

I never use 7.1, my audio system is only 5.1 and can't test with a real player the differences but I don't like the patch applied.
For 7.1 use qaac 2.59 and always output as .m4a, never like .aac (without --adts parameter).

chros
20th January 2018, 19:41
I wanted to transcode my 320kbps cbr mp3 radio captured files into something meaningful today, so I found qaac with the default preset (-V91 -q2). So I searched for a small but powerful GUI for it, hence I found BatchEncoder (https://github.com/wieslawsoltes/BatchEncoder) on GitHub yesterday: it reminds me MeGui and BeHappy, but can do batch processing with threading, supports loads of codecs and presets, it can download the only used latest utils (x32 or x64 version). Previously I've been written small batch scripts for this type of audio transcoding: no more :)

Do I have to install AppleApplicationSupport64 to be able to use qaac? Isn't the CoreAudioToolbox.dll file enough itself?
That's what I did: downloaded iTunes x64 and extracted AppleApplicationSupport and AppleApplicationSupport64 with 7zip, then installed x64 version.

There are new dummies for the icudt55.dll (https://www.hydrogenaud.io/forums/index.php?showtopic=85135&view=findpost&p=907418) as addition to makeportable for qaac.
What's this file for?

For 7.1 use qaac 2.59 and always output as .m4a, never like .aac (without --adts parameter).
Why is that?
I've been wondering which output "container" to use for stereo music files, but since most of the players support raw aac streams, I don't care about tagging and mp3directcut (http://mpesch3.de1.cc/mp3dc.html) only supports raw aac streams I don't see why m4a is better. Am I missing something?

LigH
20th January 2018, 19:51
Do I have to install AppleApplicationSupport64 to be able to use qaac? Isn't the CoreAudioToolbox.dll file enough itself?
That's what I did: downloaded iTunes x64 and extracted AppleApplicationSupport and AppleApplicationSupport64 with 7zip, then installed x64.

No. If you executed the "makeportable" batch file, it would extract all the required DLL's for you into subdirectories (QTFiles + QTFiles64) which only need to exist with qaac.exe or qaac64.exe in the same directory.

32 bit:

qaac.exe
QTFiles\*.*


64 bit:

qaac64.exe
QTFiles64\*.*


What's this file for?

The "makeportable" batch file extracted all the DLL's from the iTunes64 installer which belong to iTunes' whole feature set; qaac needs only the encoder core. For encoding only, most of the content in the icudt55.dll is not required. But the file icudt55.dll can't be deleted, the encoder would refuse to work if it is not present. But you can replace the original files of several MB size with the tiny dummy DLL's, and the encoder still works.

Why is that?

M4A is a subset of the MP4 container which contains useful information about the structure of the AAC audio in its header, which a "raw" AAC audio stream with only ADTS headers partially lacks of. Most of all, the ADTS header is not able to store the channel layout of audio with more than 5.1 channels.

chros
20th January 2018, 22:04
No. If you executed the "makeportable" batch file, it would extract all the required DLL's for you into subdirectories (QTFiles + QTFiles64) which only need to exist with qaac.exe or qaac64.exe in the same directory.

Thanks LigH for the detailed instructions! Although it still took me 10 minutes to find where the script is: this post (https://hydrogenaud.io/index.php/topic,85135.msg878848.html#msg878848). :)

For encoding only, most of the content in the icudt55.dll is not required. But the file icudt55.dll can't be deleted, the encoder would refuse to work if it is not present. But you can replace the original files of several MB size with the tiny dummy DLL's, and the encoder still works.
It worked liked a charm, thanks!

M4A is a subset of the MP4 container which contains useful information about the structure of the AAC audio in its header, which a "raw" AAC audio stream with only ADTS headers partially lacks of. Most of all, the ADTS header is not able to store the channel layout of audio with more than 5.1 channels.
Thanks, OK, then I'll use m4a container.

LigH
21st January 2018, 15:29
Although it still took me 10 minutes to find where the script is...

Or the qaac download (cabinet) page (https://sites.google.com/site/qaacpage/cabinet). Or MeGUI\tools\qaac.

chros
29th January 2018, 16:47
Or the qaac download (cabinet) page (https://sites.google.com/site/qaacpage/cabinet).
Yes, that's where I found it in the end, thanks.
And I just noticed that the above mentioned BatchEncoder has a thread (https://forum.doom9.org/showthread.php?t=174242) here on doom9. :)

Bigjackaal48
12th September 2023, 10:33
I must be the few where --Quality 1 helps a few samples since I use "192kbps VBR, -q 1". Oddly even found Damaged & Destroyed by Emil Beaulieau needs --quality 0 to stop ringing/clicks?.

Barough
24th September 2023, 09:42
QAAC v2.80
https://github.com/nu774/qaac/releases/tag/v2.80

kentafilo
28th December 2023, 18:10
Hello everyone.
I would need your opinion regarding an audio encoding.
In your opinion, starting from a DTS Master Audio file, if I wanted to transcode it, would I get a better quality file with qaac encoding at vbr 127 kbit/s or with AC3 at CBR 192 kbit/s?
In other words, is it better to encode an audio file with qaac or with AC3?
Thank you.

SeeMoreDigital
28th December 2023, 18:22
Hello everyone.
I would need your opinion regarding an audio encoding.
In your opinion, starting from a DTS Master Audio file, if I wanted to transcode it, would I get a better quality file with qaac encoding at vbr 127 kbit/s or with AC3 at CBR 192 kbit/s?
I think you mean 're-encode' not "transcode"... Also, is your DTS-HD MA source stereo or multi-channel?

kentafilo
28th December 2023, 18:54
Yes exactly, I meant "re-encode"
The source file is a DTS -HD MA stereo

SeeMoreDigital
28th December 2023, 20:04
Yes exactly, I meant "re-encode"
The source file is a DTS -HD MA stereoPersonally, I would re-encode any 'lossless' stereo source to flac.

But much will depend on your given audio playback device(s). Is there any particular reason why you want to encode 'lossless' audio to 'lossy' audio?

kentafilo
28th December 2023, 20:23
"I have carried out a personal project and re-encoded the DTS-HD MA audio into an MP4 using the qaac encoder (version 2.80). An acquaintance criticized my choice, stating that in such cases, it is better to re-encode in AC3 and that the audio quality of AC3 (192 kbps) is superior to that of AAC (qaac VBR 127 kbps). I would like to point out that the original audio file, even though in DTS-HD, is of poor quality. Given this, is it true that AC3 is better than AAC?"

https://i.postimg.cc/pdwLq9CS/Screenshot-2023-12-28-201827.png

microchip8
28th December 2023, 21:13
No. AC3 is not better than AAC, especially at lower bitrates

SeeMoreDigital
28th December 2023, 21:19
2-channel 'lossy' Dolby Digital is not as good (efficient) as lossy LC-AAC or HE-AAC. However it is useful if you are bit-streaming such audio to an external decoder amplifier!

But like I said earlier... Is there any particular reason why you want to encode 'lossless' audio to 'lossy' audio? What playback device(s) are you using?

tebasuna51
29th December 2023, 15:17
Of course if the sound track have good quality (not only lossless but high frequencies without noise) recode stereo DTS-MA to flac can save space with the same quality.

But if the sound track is from a old movie most the times a lossy encode is enough, I recommend use qaac -V 90 or 100 much better than AC3 192 CBR.
A make a test over the movie "Daddy Long Legs", even with many music included, and I obtain:

VBR min./avg./max. : 6 / 118 / 383 Kb/s (for -V 90)
VBR min./avg./max. : 6 / 132 / 406 Kb/s (for -V 100)

Like you can see when qaac need more quality use high bitrates much better than 192 CBR, but with silences and dialogs don't need so much and the bitrate average is less than 192 CBR

Using CVBR -v 128 I obtain VBR min./avg./max. : 6 / 115 / 376 Kb/s
I recommend TVBR -V instead -v CVBR because we don't know the bitrate needed, it is better, for me, fix the quality.