Log in

View Full Version : BeSweet / AACMachine - can it work with Nero AAC Command Line Encoder?


elessar
26th September 2003, 20:58
Hello! I hope this is not an already asked question.

As some of you will already know, a guy named darp has coded a nice utility which allows using the Ahead AAC Encoder from the command line. This tool is 'nencode' - you may want to check its release thread on hydrogenaudio

http://www.hydrogenaudio.org/index.php?showtopic=13056

(forget the links given in that thread - you can download this tool from the Rarewares - AAC section of hydrogenaudio )

I'm also giving you the link, don't know if any anti-leeching protection is active:

http://rarewares.hydrogenaudio.org/files/n.zip

Just unzip the file in a folder and add aac.dll , aacenc32.dll , neroipp.dll and six-channels wav.dll (nero wav replacement, if you want 5.1 audio) to that folder. You can find those files in your Nero directory or some subdirectories - just use the search function.

This tool is very simple and effective. As of this, it seems to be only working on WAV input. Its syntax is... plain. Run it with no commands to choose the quality or the preset. Then just type

nencode [wavfile] [mp4file]

to have it encoded.

I think it would be rather easy to implement in besweet/aacmachine so we could get an easy, let's say, AC3 2 AAC 5.1 or DTS 2 AAC 5.1. It seems to work well with 5.1 files as large as two hours and some minutes, while larger files still need splitting - two or three pieces at the worse, by the way.

Any idea? psytel aacenc seems to have quite a different syntax. Sources of nencode are included in the file: couldn't they be modified? (i'm really a bad coder I know nothing about C++)

DSPguru
27th September 2003, 00:12
yeap, someone could modify the syntax to be compatible with aacenc's.
shouldn't be hard.

Dark-Cracker
27th September 2003, 04:53
is there a way to use .aif input (instead of .wav) to avoid problem with besweet's unreadable .wav file > 2.gb ?

bond
28th September 2003, 09:44
there also is a commandline tool which wraps up the quicktime aac codec: Qutibacoas (http://efenstor.stratopoint.com/qutibacoas.htm)

would be great if there could be an option in aacmachine, which let you choose which aac codec to use (qt, nero, psytel or faac)

bobsc
29th September 2003, 12:59
Originally posted by bond
would be great if there could be an option in aacmachine, which let you choose which aac codec to use (qt, nero, psytel or faac)
AacMachine does need an overhaul. Currently if you transcode AC-3 to 5.1 AAC you will get output with the wrong channel order.

bond
29th September 2003, 15:32
for anyone really interested in continuing aacmachine:

Originally posted by DSPguru
if there's any (serious!) vb programmer around willing to update AACMachine to support the two alternative encoders (nero+quicktime), i'll share AACMachine's source-code with him.

Dark-Cracker
29th September 2003, 19:35
Originally posted by bobsc
Currently if you transcode AC-3 to 5.1 AAC you will get output with the wrong channel order.

there is still a problem with .wav file > 2 gb created by besweet ?
else i can't see how made working 5.1 aac file for movie track.

++

bond
29th September 2003, 19:41
Originally posted by bobsc
Currently if you transcode AC-3 to 5.1 AAC you will get output with the wrong channel order.hm, it should be also possible to make azid output a different channel order (one which makes psytel output the right one :D )


hell, where does this doom9 member/moderator thing come from :p

DSPguru
29th September 2003, 21:55
Originally posted by Dark-Cracker
there is still a problem with .wav file > 2 gb created by besweet ?yes, but AacMachine splits the tracks into smaller pieces.

elessar
29th September 2003, 22:17
I'm sorry I can't go on with AACMachine myself because I'm not a good programmer, the only works I did were in VB .

By the way: DSPGuru, could you tell us what's the command-line order of the parameters passed to aacenc.exe in AACMachine? Command-line is not readable in that tool since it performs multiple consecutive actions; but even with my extremely limited C++ knowledge I can tell that, if I know that the source filename is, say, the third parameter, while the output filename is the fifth, I can modify nencode quite easily.

It seems to me that aacenc.exe works something like

aacenc -input [filename] -output [filename] -preset [preset] -otheroption [option]

With a commandline like this, it would be enough to pass the second and fourth parametr to nencode instead of the first and the second that are being passed right now.

bobsc
30th September 2003, 04:41
Originally posted by bond
hm, it should be also possible to make azid output a different channel order (one which makes psytel output the right one :D )
Sure it is possible, but psytel has a multichannel bug anyway. That is why support for alternative encoders is needed.

Dark-Cracker
30th September 2003, 05:28
psytel have also a problem with huge 5.1 file it seems to me.
for the quicktime way u need a pro version (u need buy it).
for nero cmd line u need at last 2Mb of file to made a stand alone version :( .

i think the best solution is to use faac encoder (it don't support HE yet but i think it will be added soon).

i could made a gui for the nero encoder if someone show me faac will not add HE (hight efficiency) function soon.

@dspguru
hum i suppose it encode small piece of wav in .aac and made binary copy of all the .aac to obtain final .aac file i suppose, i am right ?

DSPguru
30th September 2003, 10:37
Originally posted by Dark-Cracker
@dspguru
hum i suppose it encode small piece of wav in .aac and made binary copy of all the .aac to obtain final .aac file i suppose, i am right ? yes, search the forum for some aacmachine's logfiles.

DSPguru
30th September 2003, 10:43
Originally posted by elessar
It seems to me that aacenc.exe works something like

aacenc -input [filename] -output [filename] -preset [preset] -otheroption [option]for adts aac :
aacenc -if [infile] -[preset] -of [outfile]

for raw/adif aac :
aacenc -if [infile] -[preset] -nh/-adif -of [outfile]

for 5.1 aac :
aacenc -if [infile] -[preset] (-nh/-adif) -lfe -of [outfile]


edit : for your refernce :switches:
-h Print help
-br Bit rate in kbits per second (dflt: 128)
-if Input file name
-of Output file name
-qual Encoder quality level (1-9) (dflt: 9)
-production Production (slowest) CBR encoding
-altcbr Alternative CBR mode
-ihsc Improved Human Speech Coding
-is Use Intensity Stereo (debug mode!!!)
-disabletuning Use Intensity Stereo (debug mode!!!)
-pns Enable Perceptual Noise Substitution (PNS) Tool
-disable_ms Disable Joint Stereo Coding
-safems Safe M/S Switching
-nh Disable ADTS header (raw ISO 13818-7 AAC file)
-noshort Disable block switching (debug only!)
-no_temporal Disable temporal masking
-lc MPEG-2 AAC Low Complexity (LC) mode
-profile AAC Profile:
0: LC, 1: Main, 2: LTP (dflt: 0)
-adif Use ADIF header
-vr Variable bit rate (VBR mode, good quality)
-vbrhi Total VBR mode (recommended, high quality)
-qvbr Quality controlled VBR (quality: 0 - 100 %%) (dflt: -1)
-tape Preset: Tape VBR Mode
-radio Preset: Radio VBR Mode
-internet Preset: Internet VBR Mode
-streaming Preset: Streaming VBR Mode
-normal Preset: Normal VBR Mode (recommended)
-extreme Preset: Extreme VBR Mode
-archive Preset: Archive VBR Mode (best quality)
-ultra Preset: Ultra (transcoding) mode (highest bitrate)
-lfe Use LFE channel (only for 4 and 6 channel input)
-c Cut-Off frequency in Hz (lowpass) (dflt: 0)
-ltq Decrease Threshold in Quiet by n dB (dflt: 0)
-raise_smr Increase Signal to Mask Ratio by n dB (dflt: 0)
-low_ath Use highest sensitivity hearing threshold
-no_ath Disable ATH
-no_tns Disable TNS coding
-artist Artist Name
-title Title Name
-album Album
-year Year
-use_tags Use Tags
-resample Resample input to x Hz (dflt: 0)
-fb Cut-Off frequency in Hz (lowpass) (dflt: 0)
- ------------- PSYCHOACOUSTIC OPTIONS ------------
-pft Psych filterbank type - 0: Complex MDCT, 1: Complex FFT (dflt: 0)
-cht Chaos measure type: - 0: Euclidic Distance, 1: Peak Filter, 2: Both (dflt: 0)
-bsw Block switching mode: - 0: Automatic, 1: Only Long, 2: Only Short (dflt: 0)
-rpelev Residual PE Level for short block switching (dflt: 0)
-lpe LPC prediction error for short block switching (dflt: 0)
-grm Short window grouping mode: 0: automatic, 1: 8 groups in one (dflt: 0)
-mcb Upper frequency limit for minimum CB threshold adapt (dflt: 0)
-tss Enable temporal threshold smoothing (CBR) (dflt: 0)
-nls Enable non-linear spreading function (dflt: 0)
-dls Short block temporal masking power coeff. (dflt: 0.1)
-dll Long block temporal masking power coeff. (dflt: 0.1)
-tng TNS Gain (switch criteria) (dflt: 0)
-psf PNS start frequency (dflt: 0)
-ptt PNS tonality switch threshold (PNS will be used if tonality is less than threshold) (dflt: 0)
-ptm PNS chaos estimation mode: 0: minimum tonality of cb that form sfb, 1: mean tonality of cb that form sfb, 2: SFM method on spectrum belogning to sbf (dflt: 1)
-TMN Tone Masking Noise for long blocks (dflt: 0)
-TMN_s Tone Masking Noise for short blocks (dflt: 0)
-NMT Noise Masking Tone for long blocks (dflt: 0)
-NMT_s Noise Masking Tone for short blocks (dflt: 0)
-vtmn Variable TMN/NMT
-sfl Spreading function low masking (dB/Bark): (dflt: 0)
-sfh Spreading function high masking (dB/Bark): (dflt: 0)
-mbs Bitres tuning: Maximum bit spend for long blocks (dflt: 0)
-mbs_s Bitres tuning: Maximum bit spend for short blocks (dflt: 0)
-rst Bitres tuning: Refill start (dflt: 0)
-rss Bitres tuning: Refill stop (dflt: 0)
-mbg Bitres tuning: Minimum refill bits for long blocks (dflt: 0)
-svc Block switching constant (0-500) (dflt: 128.0)
- ------------- JOINT STEREO OPTIONS ------------
-jsm M/S Switching Options (0: automatic, 1: all sfbs, 2: none) (dflt: 1)
-mst M/S Switching Threshold (dflt: 5.0)
-smm Simple M/S Mode (dflt: 1)
-mld Enable BMLD Protection Ratios (dflt: 1)
-bmd Perform M/S imaging (BMLD protection) if L and R energies differ less than n dB (dflt: 2.0)
-rlr Reuse L/R Psychoacoustics for M/S Thresholds (dflt: 1)
-ess Enable side channel starving (dflt: 1)
-isf Intensity Stereo starting frequency (dflt: 1)
-ist IS switch ratio (IS will be used if threshold difference is less than ist) (dflt: 1)
-sis Simple IS mode (no IS analysisis in psychoacoustic module) (dflt: 1)
- ------------- QUANTIZER LOOPS OPTIONS ------------
-ity Iteration type (0: threshold based, 1: bitrate_calc_in_loops (dflt: 1)
-mol Maximum number of quantizer outer loops (dflt: 200)
-mno Minimum number of quantizer outer loops (dflt: 1)
-itm Distorted Sfb Amplification mode (1: Smart, 2: All, 3: Mean, 4: Worst) (dflt: 1)
-aal Number of unsuccessful quant loops for ALL_DISTORTED mode (dflt: 8)
-mdl Number of unsuccessful quant loops for MEAN_DISTORTED mode (dflt: 16)
-wdl Number of unsuccessful quant loops for WORST_DISTORTED mode (dflt: 16)
-thm Enable threshold correction (dflt: 1)
-ect Enable consecutive threshold smoothing in the last outer loop (dflt: 1)
-pfn Perform fine noise shaping after the last outer loop (dflt: 1)
-rtm Real-time loop break mode (dflt: 1)
-edt Enable debug trap for endless quantizer loops (dflt: 1)
-efh Full Huffman search mode (0: last loop, 1: all loops, 3: never (dflt: 0)

bobsc
30th September 2003, 13:13
Originally posted by Dark-Cracker
psytel have also a problem with huge 5.1 file it seems to me.
for the quicktime way u need a pro version (u need buy it).
for nero cmd line u need at last 2Mb of file to made a stand alone version :( .

i think the best solution is to use faac encoder (it don't support HE yet but i think it will be added soon).

i could made a gui for the nero encoder if someone show me faac will not add HE (hight efficiency) function soon.
imho Nero is the best encoder right now, but (u need to buy it too). I do not know if or when FAAC will support HE, but it is improving and it is free.

Wilbert
30th September 2003, 13:14
i think the best solution is to use faac encoder (it don't support HE yet but i think it will be added soon).
1) Latest binaries can decode AAC HE.

2) No, there's no HE encoding support coming soon. This was discussed in the hydrogenaudio forum (don't have the thread at hand). Only the decoding specs/algorithms were given free. Maybe bond has to add something?

bond
30th September 2003, 13:28
nope, absolutely no plans for he-aac encoding in faac i know of (in fact some of the faac guys are working for ahead, so...)

imo if someone wants high quality 5.1 aac audio, there is no way around nero's he-aac codec atm (which will be available for free in ND, in form of a directshow encoder!)

and sorry to say that, but there are much better aac codecs around than faac (although it is getting better and better, knik is doing a great job) and, at least for my side, i dont choose audio codecs because i like the format (in this case aac) but because i want highest quality possible at a given target bitrate...

bobsc
30th September 2003, 14:13
Originally posted by bond
imo if someone wants high quality 5.1 aac audio, there is no way around nero's he-aac codec atm (which will be available for free in ND, in form of a directshow encoder!)
We will have to wait and see.

DSPguru
4th October 2003, 11:26
ntcu-FAAC v1.5RC1 is out (http://psplab.csie.nctu.edu.tw/invboard1_2/index.php?showtopic=774).

Wilbert
4th October 2003, 14:37
Download link (only LC-AAC as I understand, based on faac):
http://dsppc14.csie.nctu.edu.tw/projects/index.pl/nctu-faac.html