Skip to main content

Topic: QAAC: discussion, questions, feature requests, etc. (Read 360401 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #300
Yeah, *some* part of qaac has been written more or less portability in mind, but others are not.
When qaac moved from QuickTime to CoreAudioToolbox, I dropped gcc(MingW) because I wanted to use DLL delay loading for CoreAudioToolbox.dll. Since then, I stopped to care about portability at all. So, now qaac even lacks cross compiler support on Win32, and I don't think it's a good base for making something useful.
If I find time, I *might* think of writing much simpler implementation for libfdk_aac.

  • usikpa
  • [*]
QAAC: discussion, questions, feature requests, etc.
Reply #301
nu774

Sorry to bother with this, I am a bit confused about multichannel handling by QAAC. I have now an LPCM file (wav or au format) that has the channels, according to MediaInfo, in the following order

Front: LCR
Side: LsRsLFE

Now, when QAAC does its first (Microsoft) reordering, does it re-order channels incorrectly, as the specified above channel mask is not mentioned in the channel input layout table? How does one let QAAC know the input channel layout?

Also, just in case, am I right to assume, when writing a matrix file, the Microsoft layout?

  • LigH
  • [*][*][*]
QAAC: discussion, questions, feature requests, etc.
Reply #302
@ usikpa:

MeGUI uses AviSynth, usually a scriptable video frameserver, but it is also able to serve audio in RAM to the encoder. This technique was first used by BeHappy, specifically an audio converter, alternative to the abandoned BeSweet.
http://forum.gleitz.info - das deutsche doom9/Gleitz-Forum

  • lvqcl
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #303
nu774
Front: LCR
Side: LsRsLFE

Now, when QAAC does its first (Microsoft) reordering, does it re-order channels incorrectly, as the specified above channel mask is not mentioned in the channel input layout table? How does one let QAAC know the input channel layout?


The channel order for WAV format is fixed.

Your layout is equal to "FL FR FC LFE SL SR"

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #304
Use --verbose if you are uncertain of channel layout recognition by qaac. It will show something like the following:
Code: [Select]
Input layout: 5.1 (L R C LFE Lsd Rsd)
Output layout: 5.1 (C L R Ls Rs LFE)

Also, just in case, am I right to assume, when writing a matrix file, the Microsoft layout?

Correct.

  • usikpa
  • [*]
QAAC: discussion, questions, feature requests, etc.
Reply #305
Use --verbose if you are uncertain of channel layout recognition by qaac. It will show something like the following:
Code: [Select]
Input layout: 5.1 (L R C LFE Lsd Rsd)
Output layout: 5.1 (C L R Ls Rs LFE)


Well, I did, and this is what I got:

Code: [Select]
...
audio.m4a
Using default channel layout.
Output layout: 5.1 (C L R Ls Rs LFE)
...


As advised above, will resort to the .wav file format instead of .au

Thank you for your replies

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #306
Speaking of libfdk_aac, it would be really cool if someone could make a portable version of qaac that uses libfdk_aac as the encoder, as neither ffmpeg nor avconv appear to support gapless encoding. I'm only guessing that the only non-portable binary blob code that qaac uses is the CoreAudioToolbox library, and only for AAC encoding. Well, and then I did look into some of the headers when I considered an attempt, and noticed a lot of Win32 header and function usage, so maybe it won't be so easy after all.

Finally written frontend from scratch:
https://github.com/nu774/fdkaac
Very simple program (compared to qaac), only WAV input is available.
Gapless playback is supported at least for LC.
I hope it to be portable (tested on mingw-w64 and Linux).

  • sluggy
  • [*][*]
QAAC: discussion, questions, feature requests, etc.
Reply #307
Excellent, will you be building a version to work with fb2k??

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #308
Excellent, will you be building a version to work with fb2k??

I could distribute binary of my frontend, but will not be able to distribute libfdk-aac anyway.

  • sluggy
  • [*][*]
QAAC: discussion, questions, feature requests, etc.
Reply #309
Finally written frontend from scratch:
https://github.com/nu774/fdkaac
Very simple program (compared to qaac), only WAV input is available.
Gapless playback is supported at least for LC.
I hope it to be portable (tested on mingw-w64 and Linux).



I have no idea how to build this or how to get it to work with fb2k?
  • Last Edit: 04 January, 2013, 12:24:04 PM by sluggy

  • eahm
  • [*][*][*][*][*]
QAAC: discussion, questions, feature requests, etc.
Reply #310
nu774, two quick questions:

1) Why should people use 1.x instead of 2.x? Older OSes?

2) Why is 2.09 still available in "Cabinet" and not in "old", is 2.10 a testing build?


Thanks.
  • Last Edit: 04 January, 2013, 03:00:20 PM by eahm

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #311
1) Why should people use 1.x instead of 2.x? Older OSes?

I don't recommend which to use. Although 2.x made improvements in functionality, you can continue to use 1.x if you think 2.x is not stable enough.

2) Why is 2.09 still available in "Cabinet" and not in "old", is 2.10 a testing build?

Just forgot to move it, thanks for pointing out.

  • bat_guano
  • [*]
QAAC: discussion, questions, feature requests, etc.
Reply #312
I could distribute binary of my frontend, but will not be able to distribute libfdk-aac anyway.

Hi
What is the position with fdkaac.exe?
When it's compiled, is it OK to share it on this forum or some file-hosting site?
(Just asking)
 

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #313
What is the position with fdkaac.exe?
When it's compiled, is it OK to share it on this forum or some file-hosting site?
(Just asking)

As for Fraunhofer's FDK AAC library, read here:
https://raw.github.com/mstorsjo/fdk-aac/master/NOTICE

  • Sparktank
  • [*]
QAAC: discussion, questions, feature requests, etc.
Reply #314
Hi!
Thank you for this wonderful program!

I'm very new to AAC formats (AAC/M4A).
So far I've been using just Foobar with NeroAACenc.

But with this getting frequent updates, I've decided to look into this and see how it fairs for my typical usage.
Right now it's just PC playback and a Coby portable media player.
Windows 7 (64bit)/Windows XP SP3 (32bit).
My Coby media player is MP828-8GB.

I've delayed trying this out due to the CoreAudioToolbox conundrum.
Thankfully sneaker created a wonderful batch script to extract all the necessary files and make things easier. :)

It took me several tests to figure out the quality values for TVBR [127=highest] and for the -q [0-2] quality modes [0=highest], as their values are not listed in the help and I'm completely new to the AAC field. ^__^"

Thank you all for your contribution and I look forward to using this more frequently and checking out more updates in the future.
I like to use "HD audio" in PaulStretch. "HD audio", lol.

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #315
Document is at https://github.com/nu774/qaac/wiki
-q controls quality/speed trade off, and 2 is highest in quality, slowest in speed.

  • Sparktank
  • [*]
QAAC: discussion, questions, feature requests, etc.
Reply #316
Document is at https://github.com/nu774/qaac/wiki
-q controls quality/speed trade off, and 2 is highest in quality, slowest in speed.


  Bookmarked, thanks!
I like to use "HD audio" in PaulStretch. "HD audio", lol.

  • Anakunda
  • [*][*][*][*][*]
QAAC: discussion, questions, feature requests, etc.
Reply #317
it's 2.11 now 

Quote
[qaac] release 2.11 (refalac 1.11)
posted 47 minutes ago by nu 774

    Changed --tag option behavior to be strict. Formerly, when fourcc passed by --tag is unknown, qaac accepted it and wrote it as UTF8 string tag. Now --tag accepts only known tags. This is considered to be more foolproof, since iTunes is known to refuse editing tags when a file contains unknown tag atoms.
    Read vorbis comment "WAVEFORMATEXTENSIBLE_CHANNEL_MASK" of FLAC and treat as channel layout.
    Fixed a bug: mono AIFF/CAF file with kAudioChannelLabel_Mono in chan chunk could not be read.


https://sites.google.com/site/qaacpage/cabinet

QAAC: discussion, questions, feature requests, etc.
Reply #318
Why does qaac seem to be slightly changing the duration of my audio file?

This is the command I am running:
Quote
qaac.exe --tvbr 90 --quality 2 --rate keep --ignorelength S01E01.wav -o S01E01.aac


I am using "--ignorelength" because usually I run this command with piped WAV input from eac3to.

The result I get with MediaInfo (showing milliseconds with Debug>Advanced Mode):
S01E01.wav - Duration: 1h 26mn 25s 664ms
S01E01.aac - Duration: 1h 26mn 25s 728ms

The audio file duration grew by 64 milliseconds - now I understand that this isn't very much --- but it is very slightly noticable out-of-sync when people are talking in my remuxed video file. Why should qaac be changing the duration of a source wav file? How can I get qaac to give me an AAC file with the exact same number of milliseconds as my source WAV file?
  • Last Edit: 15 January, 2013, 08:03:30 AM by robertcollier4

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #319
Read this:
http://lame.sourceforge.net/tech-FAQ.txt
This is the FAQ of LAME, but mostly the same for ALL MDCT based lossy codec.
For allowing gapless playback, iTunes introduced a special tag (metadata) named "iTunSMPB" to declare amount of encoder delay, valid number of samples, and padding.
Some players supporting it (such as fb2k or Rockbox) can playback resulting m4a files gaplessly (without any amount of delay or padding).

In short, that is a not problem of qaac.

QAAC: discussion, questions, feature requests, etc.
Reply #320
Read this:
http://lame.sourceforge.net/tech-FAQ.txt

Okay, thank you for the info and the great app. Since the documentation indicated that these encoders usually add the delay at the beginning of the file, I added delay of "-64" to mkvmerge to compensate and the resultant video seems to be in perfect sync again.

  • nu774
  • [*][*][*][*][*]
  • Developer
QAAC: discussion, questions, feature requests, etc.
Reply #321
FYI, the amount of delay of Apple LC-AAC encoder is 2112 samples (= 44ms for 48000Hz).

  • sneaker
  • [*]
QAAC: discussion, questions, feature requests, etc.
Reply #322
Read this:
http://lame.sourceforge.net/tech-FAQ.txt

Okay, thank you for the info and the great app. Since the documentation indicated that these encoders usually add the delay at the beginning of the file, I added delay of "-64" to mkvmerge to compensate and the resultant video seems to be in perfect sync again.


Just as a note: mkvmerge should be able to automatically read and apply the delay from aforementioned iTunSMPB tag. You have output to m4a insteads of adts aac, though. (There have been some changes to mkvmerge's mp4 handling recently, so I suggest you test the result once to see if it still works reliably. Get the newest pre from here.)

@nu774

Maybe you could add a "--nodelay" parameter to qaac. Since you already have implemented a delay switch, I guess it's trivial for you to implement and it could be useful for video encoding where gap-less playback does not matter.
  • Last Edit: 15 January, 2013, 12:03:53 PM by sneaker

QAAC: discussion, questions, feature requests, etc.
Reply #323
Just as a note: mkvmerge should be able to automatically read and apply the delay from aforementioned iTunSMPB tag. You have output to m4a insteads of adts aac, though. (There have been some changes to mkvmerge's mp4 handling recently, so I suggest you test the result once to see if it still works reliably. Get the newest pre from here.)


Okay, great. I found the file created by qaac did have a iTunSMPB tag which is explained how to decipher here.
tool   qaac 2.11, CoreAudioToolbox 7.9.7.9, AAC-LC Encoder, TVBR q91, Quality 96
iTunSMPB    00000000 00000840 000003C0 000000000ED61800 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

Encoder Delay = 0x00000840 = 2112 samples = 44ms
Padding = 0x000003C0 = 960 samples = 20 ms
Original Sample Count = 0x000000000ED61800 = 248911872 samples = 5185664 ms

So the m4a file produced by qaac does contain all the perfectly encoded information. And the original sample count matches the original wav file. The 64 ms extra is accounted for by the "Encoder Delay" and "Padding".

I tried latest mkvtoolnix-unicode-5.9.0-build20130108-490. When adding the m4a file with this iTunSMPB tag into mmg.exe (mkvmerge GUI) - it does not auto populate the "Delay (in ms)" field in the "Format specific options" tab. The "Delay (in ms)" field remains blank even when loading a m4a file with the above iTunSMPB tag. I have to manually type in "-64" to have it compensate for the 44ms+20ms delays introduced.

It would be nice if mkvmerge would automatically add a negative delay corresponding to "Encoder Delay" + "Padding".
  • Last Edit: 15 January, 2013, 02:21:48 PM by robertcollier4

  • sneaker
  • [*]
QAAC: discussion, questions, feature requests, etc.
Reply #324
1. Neither mkvmerge nor mkvmerge GUI display any information about applying the delay, but they still do it in the background. Also note that mkvmerge applies negative delays by dropping all packets that would start before 0 and delays the first packet that does not get dropped if necessary, so tools like MediaInfo might show a small ( smaller than the length of a packet) positive delay.
2. You must not add the padding to the delay value. Padding is at the end of the file.
3. the iTunSMPB tag info is only correct for LC.
  • Last Edit: 15 January, 2013, 02:45:06 PM by sneaker