PDA

View Full Version : Winamp AAC commandline encoder



Dirkvl
01-13-2006, 10:54 AM
I've written a plugin for dpowerAMP, using a commandline aac+v2 encoder for the winamp dll's, which was posted some while ago on the hydrogenaudio forum.
It's blazing fast, but sadly doesn't have an option to use stdin, which would speed up the process even more.
Has anyone been able to get or produce a version of this commandline encoder with stdin option (correctly) enabled ?
I'd gladly upload my plugin somewhere, but I don't know where I can place it.

Spoon
01-13-2006, 04:06 PM
If you or someone else can host them I can post links (perhaps from codec central), I am not sure though we are able to host these files (do they contain winamps files?)

Dirkvl
01-14-2006, 12:49 PM
There are a few dll's from winamp needed in the compression plugin folder :
enc_aacplus.dll, in_wave.dll
These files can be found in the winamp plugin folder.
You mean this is a patent issue ?
It's also possible to extract the conversion exe to the plugin folder and then copy the needed files from an existing "c:\program files\winamp" folder to accomplish a fully functional plugin.
But then you'd have to have a recent winamp on your machine.

I thought I saw a link to the source code on HA of this conversion exe somewhere too. But I wouldn't have a clue how to compile it. I'm not programming anymore and I've no time to dig myself into recent programming tools.

Not sure, but I think I've got a few free homepages somewhere...(probably not activated)
But now you've got me thinking. I don't even know it's legal to place this stuff online. Please advise.

Spoon
01-14-2006, 03:17 PM
Copyright issue (not Patents), I cannot package Winamps dlls without their permission.

LtData
01-14-2006, 04:45 PM
Mabye require Winamp to be installed and copy the needed DLLs over to the encoder's directory?

Dirkvl
01-15-2006, 07:00 AM
I've uploaded the following exe :
EDIT(Dirk)--- link is obsolete - more recent download is available further in the thread ---
(courtesy to dimzon and the "winamp transcoder")
which does not contain winamp dll's, but will copy them to the right folder after compressing, if winamp is present on your machine (!).
After that, you can always remove winamp again. :smile2:
If anyone has a (working) version of the encoder with stdin support, please respond. It can cut total encoding time considerably.
Could anyone determine the legality of this stuff ? I'd appreciate it. :D

Dirkvl
01-17-2006, 10:38 AM
Yes !!!
I've recently received the last version of the conversion exe from "witt" at HA.
(Thanks a lot)
I've posted a new extractable dbpoweramp plugin at
EDIT(Dirk)--- link is obsolete - more recent download is available further in the thread ---
A recent version of winamp is required for this plugin.
It copies aacplus_enc.dll, which is needed for the plugin to function.
Conversion to mono doesn't seem to work, although the commandline encoder indicates that it should function.
-Dirk-

Dirkvl
01-22-2006, 11:52 AM
I found something strange : when I use the stdin encoder through regular commandline, it gives correct results, but when I use the plugin it adds a small piece of audio (about 0.07 secs) in the beginning and the end of the audio file. Did I forget something in the options file ?

Spoon
01-22-2006, 03:44 PM
Nothing in the options that adds extra length.

Dirkvl
01-23-2006, 06:22 AM
Any idea what causes it ?
Codec ?
DLLs ?

Spoon
01-23-2006, 03:31 PM
You can switch to debug mode (try searching the forum for CLI debug), that gives you the raw wave file and commandline.

Dirkvl
01-24-2006, 05:57 AM
Aha : I've found the problem (in the options file).
I was using [WriteWaveRIFF] instead of [RawWave].
It also required an additional parameter in the commandline.
Anyway, conversion looks very good now. I've adjusted the plugin and posted it on the same place :
EDIT(Dirk)--- link is obsolete - more recent download is available further in the thread ---

Thanks for the advice, Spoon. :komisch9:

gameplaya15143
01-27-2006, 11:41 PM
:thumbup:
great job

but
------------------------------
[CLIString]
--rawpcm 44100 2 16
------------------------------
^ has to go

I'll be making my own options.txt file for this baby (probably later tonight, and im willing to share), I'm just glad it supports piping

i havent had much time to test it.. but does this version of the frontend support the new enc_aacplus.dll thats in the new winamp5.2 beta? (ya know, the one with more options)

gameplaya15143
01-28-2006, 09:16 PM
ok... played around with it a bit...
i was trying to do the same exact thing, but with the newer version of the cli for enc_aacplus.dll, but it was the rewritten version so piping didnt work, this version is better (you wouldnt happen to have the source code would ya?) :smile2:

i answered one of my questions, it will work with the new dll version v1.2, but the extra modes cant be accessed, i hope a new one gets made that can

AFAIK [RawWave] doesnt do anything at all, it isnt needed at all


[Codec]
.m4a
aacenc.exe

[CLIString]
- "

[OutFile]

[CLIString]
"

[Label]
14
4
Bitrate:

[Combo]
49
0
120
128 kbps
--cbr 128000
112 kbps
--cbr 112000
96 kbps
--cbr 96000
80 kbps
--cbr 80000
64 kbps
--cbr 64000
56 kbps
--cbr 56000
48 kbps
--cbr 48000
40 kbps
--cbr 40000
32 kbps
--cbr 32000
28 kbps
--cbr 28000
24 kbps
--cbr 24000
20 kbps
--cbr 20000
16 kbps
--cbr 16000
12 kbps
--cbr 12000
10 kbps
--cbr 10000
8 kbps
--cbr 8000

[Label]
0
29
Channels:

[Combo]
49
25
120
Mono
--chmode 1
Stereo
--chmode 2
Stereo Independent
--chmode 3
Parametric Stereo
--chmode 4
Dual Channel
--chmode 5

[Label]
206
4
MPEG Version:

[Combo]
280
0
32
2

4
--mpeg4aac

[Label]
199
29
aacPlus Version:

[Combo]
280
25
32
2

1
--no-v2

[CLIString]
--rawpcm

[SamplesPerSec]

[CLIString]


[Channels]

[CLIString]


[BitsPerSample]

[CLIString]
--mp4box ^ this is for m4a, but works for aac if ya change the extention back to aac and remove the last part after '[bitspersample]'.. it has all the options available, of course some combinations dont work (like you cant use parametric stereo without aacplus v2 enabled).. its my understanding that it will accept 32khz, 44.1khz, and 48khz input (i couldnt get it to work with lower sample rates)... its too bad that this frontend doesnt let you choose the encoding samplerate... the really old frontend does, but that one doesnt support piping :cry:

Dirkvl
01-30-2006, 10:25 AM
gameplaya,
I tested the options file but the --mp4box parameter gives no result.
I agree that extra parameters would be nice for the interface.
However, allowing combinations to be made that result in an error doesn't appeal to me at all. It's not neat enough to hand out to everyone.
Maybe it's better to list all possible combinations ? Would be a long list though.
The mono option shouldn't be there at all, cause it doesn't work in this conversion exe.
Parametric stereo can't be selected for higher bitrates (56+), so the channel combo can also result into errors sometimes.

For the source code of the coder, you can try asking dimzon at HA.

gameplaya15143
02-02-2006, 10:05 PM
--mp4box does work, you have to have mp4box.exe in there with it :cool:

dimzon made a new frontend for the new enc_aacplus.dll from winamp 5.2 beta, there is an LC option, but seemed to be an upgrade to the rewritten frontend (he lost his hard drive and lost the source to the frontend that you used.. the one that works better)

i agree that it would be hard for n00bies with all the options, I had done the list-of-all-valid-options once, it took a while to get them all (longer options.txt file and a headache :p )

I think the best way to handle the options mess would be to have a real winamp encoder plugin, which calls the dll's config gui and all that...
{heads over to the wishlist}

Dirkvl
02-03-2006, 10:22 AM
--mp4box does work, you have to have mp4box.exe in there with it
Ah, yes. I'd forgotten that. Thanks.


he lost his hard drive and lost the source to the frontend that you used.. the one that works better
Damn. You actually got a mail back from him ?
Can he rewrite the code ? With hypnosis maybe ? ;)

gameplaya15143
02-04-2006, 09:09 PM
Ah, yes. I'd forgotten that. Thanks.


Damn. You actually got a mail back from him ?
Can he rewrite the code ? With hypnosis maybe ? ;)
no... he mentioned it on hydrogenaudio or doom9... or both

Dirkvl
02-07-2006, 06:56 AM
Dimzon recently published an enc_aacplus.exe in the Behappy workspace :
http://www.gotdotnet.com/workspaces/workspace.aspx?id=1bb59ddf-901b-43a5-bd54-b0999e8e223e
but the conversion gets stuck when I try encoding a wav file.
I think he included some code (enc_aacplus.cpp) for making the exe.

gameplaya15143
02-07-2006, 09:45 PM
Dimzon recently published an enc_aacplus.exe in the Behappy workspace :
http://www.gotdotnet.com/workspaces/workspace.aspx?id=1bb59ddf-901b-43a5-bd54-b0999e8e223e
but the conversion gets stuck when I try encoding a wav file.
I think he included some code (enc_aacplus.cpp) for making the exe.
unless he updated it in the last week, then its the one i was playing with earlier... which is based off the rewrite, which doesnt work with piping :(

dimzon
02-13-2006, 09:29 AM
unless he updated it in the last week, then its the one i was playing with earlier... which is based off the rewrite, which doesnt work with piping :(
enc_aacplus.exe is designed to work with pipeline (it reques Riff WAV header to be sent in stdin too)

Dirkvl
02-14-2006, 06:00 AM
The compilemaster himself has joined us.
I'm honoured but still stuck with my encoding test.
I've used a regular small wave file to encode in this fashion :
enc_aacplus - test1.aac --cbr 48000 --chmode 4 <test1.wav
The wav file is saved with goldwave as a "signed" stereo wav file.
Does this mean the "Riff WAV header" isn't included in the file ?

dimzon
02-15-2006, 11:34 AM
The compilemaster himself has joined us.
I'm honoured but still stuck with my encoding test.
I've used a regular small wave file to encode in this fashion :
enc_aacplus - test1.aac --cbr 48000 --chmode 4 <test1.wav
The wav file is saved with goldwave as a "signed" stereo wav file.
Does this mean the "Riff WAV header" isn't included in the file ?
Can you provide minimalistic wav (less than 1MB) for testing?
You must provide 16 bit stereo PCM wav file!

Dirkvl
02-16-2006, 04:37 AM
I have 3 wave files for basic testing :
http://home.versateladsl.be/dirkvl143/test1.wav
http://home.versateladsl.be/dirkvl143/test2.wav
http://home.versateladsl.be/dirkvl143/test3.wav

All are below 1 MB.
Commandline used is
enc_aacplus - test1.aac --cbr 48000 --chmode 4 <test1.wav

Thanx for having a look.

dimzon
02-17-2006, 05:44 AM
I have 3 wave files for basic testing :
http://home.versateladsl.be/dirkvl143/test1.wav
http://home.versateladsl.be/dirkvl143/test2.wav
http://home.versateladsl.be/dirkvl143/test3.wav

All are below 1 MB.
Commandline used is
enc_aacplus - test1.aac --cbr 48000 --chmode 4 <test1.wav

Thanx for having a look.

I will take look @ weekend

dimzon
02-17-2006, 06:46 AM
I have 3 wave files for basic testing :
http://home.versateladsl.be/dirkvl143/test1.wav
http://home.versateladsl.be/dirkvl143/test2.wav
http://home.versateladsl.be/dirkvl143/test3.wav

All are below 1 MB.
Commandline used is
enc_aacplus - test1.aac --cbr 48000 --chmode 4 <test1.wav

Thanx for having a look.
get fresh build http://www.gotdotnet.com/workspaces/workspace.aspx?id=1bb59ddf-901b-43a5-bd54-b0999e8e223e

Dirkvl
02-18-2006, 04:42 PM
And this one works !
And it's beautiful. Now you can select --lc for higher bitrates too.
Commandline bliss...

But making a plugin is driving me crazy.
Every dll I use seems to produce a specific header (or maybe even none).
The previous aacenc.exe could handle it with the --rawpcm option,
but this encoder takes only neat waves with header, so just copying it in the conversion folder isn't going to cut it.
I tried [ForceCDQuality] in the options file, but no luck.
Anyone got an idea ?

dimzon
02-19-2006, 10:38 AM
i'm planning to add rawpcm and other options a bit later

Spoon
02-20-2006, 03:09 PM
If you can, don't add the header (is using the stdout version of the generic CLI, as the FAAC mp4 encoder does), and specify the bits, channels, etc on command line with

[SamplesPerSec]

[BitsPerSample]

[Channels]

gameplaya15143
02-21-2006, 08:37 PM
[WriteWaveRIFF]
doesn't work with this one either :(
untill --rawpcm is back, it prolly wont work with piping.. at least as far as DMC is concerned.

@dimzon
you rule! keep up the great work :thumbup:
the LC option is nice... but what about an option to use the 'high bitrate' encoder? and how about adding the resample option to set the encoder samplerate, instead of forcing it to use the same samplerate as the input?

dimzon
02-26-2006, 06:11 AM
but what about an option to use the 'high bitrate' encoder?
--high :D


and how about adding the resample option to set the encoder samplerate, instead of forcing it to use the same samplerate as the input?
built-in resampler is not planned at all, use external resampler

dimzon
02-26-2006, 09:02 AM
my commad-line frontend (new version):
http://forum.doom9.org/showthread.php?p=791123*post791123

gameplaya15143
02-27-2006, 01:44 PM
--high :D

built-in resampler is not planned at all, use external resampler
:headbang: i saw --high yesterday.. i really need to learn how to read

.... but doesn't enc_aacplus.dll have a resampler of its own built in?
I'm just hoping to get access to it so I can input a 48khz file and encode it to 24khz (i would never actually do this...). I have an old frontend for enc_aacplus.dll that does provide access to the samplerate, so I know it exists..

dimzon
02-28-2006, 11:33 AM
.... but doesn't enc_aacplus.dll have a resampler of its own built in?
enc_aacplus have its own built in resampler (at least 2:1) bcz it requed to AAC+ algorytm itself (AAC+ produce AAC-LC stream at half samplerate). But I can't invoke it (there are no way how to do it) for my own puposes


I have an old frontend for enc_aacplus.dll that does provide access to the samplerate, so I know it exists..
Actually this is not resampler but actual source samplerate. When I wrote my first version of frontend I does not know how to obtain samplerate from WAV header (sic!) In current version samplerate obtained automatically...

gameplaya15143
03-02-2006, 09:42 PM
this your first one? http://www.crapshack.com/aacenc.zip

cause what ive done here... http://www.geocities.com/gameplaya_15143/howto/aacplus4dmc/index.html
lets me input at 44.1khz and resample to 32khz

p.s.: maybe you could put comments in your source code? so n00bs like me have a fighting chance at understanding/learning what is going on :lustig1:

dimzon
03-03-2006, 01:24 PM
this your first one? http://www.crapshack.com/aacenc.zip
Wow, i lost this source with my HDD many month ago!


cause what ive done here... http://www.geocities.com/gameplaya_15143/howto/aacplus4dmc/index.html
lets me input at 44.1khz and resample to 32khz
Ok, maybe You are right, take look @ it @ monday



p.s.: maybe you could put comments in your source code? so n00bs like me have a fighting chance at understanding/learning what is going on :lustig1:
No comments :blush:
If it was hard to write it must be hard to read :teufel8:

Dirkvl
03-17-2006, 06:06 AM
Dimzon has uploaded a new enc_aacplus.exe and it looks good !
I've created a new aac plugin with options file adapted for using LC-AAC or HE-AAC.
Winamp 5.2 is required (the exe I've made copies the needed enc-aacplus.dll to the plugin folder).
Here it is : http://home.versateladsl.be/dirkvl143/dbp-aac-winamp-AAC-CLI-20060317.exe