26 May '13 - 09:28 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1] 2 3  All
  Reply  |  Print  
Author Topic: AACplus v2 command line encoding tool available!  (Read 18885 times)
radio42
Posts: 4012


« on: 27 Jun '06 - 15:45 »
Reply with quoteQuote

Hi,

a new verison of the enc_aacPlus command-line encoder is available!

You all know, that "BASSenc" can be used with any external command-line tool to encode sample data, if that tool supports STDIN to receive sample data and STDOUT, to receive back the encoded data.
So far there was no command-line tool available, which supported AACplus V2 encoding like this.
Now there is ;-)

Here is the download link: http://www.un4seen.com/filez/4/enc_aacPlus.zip

The trick is, that this tool uses the AACplus v2 encoder provided with Winamp 5.33 or above!
So if you install Winamp, you get this legally for free.

enc_aacPlus.exe was originally provided by Dmirty Alexandrov.
I just made a few adjustments (see below)...

NOTE!
"enc_aacplus.dll" and "nscrt.dll" must be copied into the directory of enc_aacPlus.exe!
Get these two dll's from your Winamp 5.33 or above plugins directory!

/*
* BIG FAT WARNING:
* this code based on "The Winamp Transcoder" plugin (http://www.srcf.ucam.org/~wdhf2/transcoder/)
*
* Copyright (c) 2005 Dmirty Alexandrov aka dimzon aka dimzon541 (dimzon541@gmail.com)
* Copyright (c) 2004 Will Fisher (will.fisher@gmail.com)
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
*    notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
*    notice, this list of conditions and the following disclaimer in the
*    documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
*    derived from this software without specific prior permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
*
* This version is based on the aacPlusCLI project as published here: http://aacpluscli.codeplex.com/
* AACPlus v2 Encoder (using Winamp 5.33 or above enc_aacplus.dll and nscrt.dll)
* Coding Technologies encoder 8.0.3
* Build (9349): Mar 18 2008 at 09:00 AM
*
* The following enhancements have been made to allow this encoder to be used with BASS (www.un4seen.com):
* 1) "--silent" option added
* 2) "-" for STDOUT added
* 3) corrected wave chunk reading
*
*/

/*
Usage:
        enc_aacPlus.exe <wav_file> <bitstream_file> [options]

Input/Output:
        <wav_file>       : WAV input file (use - to read from STDIN)
                           (must be PCM 8 or 16 bit, 32000, 44100 or 48000 Hz)
        <bitstream_file> : Bitstream output file (use - to write to STDOUT)
                           (mp4box not possible, if STDOUT is selected)

Options:
        --br <bitrate>   : Set bitrate (CBR) in bps. Default is 128000
        --ps             : Enable Parametric Stereo (bitrates up to 56000, only with HE-AAC)
        --is             : Prefer Independed Stereo (disables Joint Stereo M/S coding)
        --mono           : Encode as Mono
        --mpeg2aac       : Force MPEG2 AAC (instead of let the encoder choose)
        --mpeg4aac       : Force MPEG4 AAC (instead of let the encoder choose)
        --lc             : Encode LC-AAC (bitrate up to 320000)
        --he             : Encode HE-AAC (bitrate up to 128000)
        --high           : Encode as HE-AAC+ with hight bitrates (bitrate up to 256000, multichannel not supported)
        --mp4box         : Wrap result into MPEG4 container (MP4BOX.EXE must be in the same directory)
        --mp4mux         : Output MPEG4 ISO compilant file .mp4 instead of raw .aac (MP4MUX.EXE must be in the same directory)
        --silent         : Set silent mode, no progress and other output
        --rawpcm <r c b> : Signal RAW PCM input intead of WAV
                 <r>     : Samplerate in Hz (32000, 44100 or 48000)
                 <c>     : Channels count (1 or 2 or above)
                 <b>     : Bit's per sample (8 or 16, little-endian)

Example:
enc_aacPlus.exe input.wav out.aac --br 56000
enc_aacPlus.exe input.wav out.m4a --br 32000 --he --mp4box
enc_aacPlus.exe - - --br 128000 --high --silent --rawpcm 44100 2 16
*/
« Last Edit: 17 Aug '09 - 12:25 by radio42 » Logged
Sebastian_Mares
Guest
« Reply #1 on: 27 Jun '06 - 20:39 »
Reply with quoteQuote

I have no idea if the Nero encoder supports StdOut, but it certainly supports StdIn which should be enough if one only needs to encode data.
Logged
radio42
Posts: 4012


« Reply #2 on: 27 Jun '06 - 22:33 »
Reply with quoteQuote

Yepp, that's true.
The nero Encoder tool only supports STDIN, which is sufficient for creating AACplus files.
But it does not support STDOUT, which is needed, if you want to get the encoded data back - e.g. if you want to stream the data to a SHOUTcast server ;-)
Logged
Intimidated
Posts: 20


« Reply #3 on: 18 Jan '07 - 19:03 »
Reply with quoteQuote

I would just like to say THANK YOU.

i've just spent hours trying to find an encoder with this functionality, and I should've looked on the BASS forums in the first place.

Thanks to BASS, I have now created a stream transcoder which has the capability of reading MP3, AAC/HE-AAC, Ogg Vorbis,  WMA and Ogg Flac, and can transcode into MP3 OGG and AAC Plus.

I cant thank you guys enough.
Logged
radio42
Posts: 4012


« Reply #4 on: 19 Jan '07 - 07:18 »
Reply with quoteQuote

You're welcome
Logged
KtoY
Posts: 6


« Reply #5 on: 20 Jan '07 - 20:44 »
Reply with quoteQuote

Hi radio42, i want to know, how use enc_aacplus.dll without enc_aacplus.exe?
Logged
radio42
Posts: 4012


« Reply #6 on: 20 Jan '07 - 23:37 »
Reply with quoteQuote

Since it is a regular Winamp plugin it must use the Winamp PlugIN API as documented by Winamp...

So each encoder implements an interface class called "AudioCoder".
You just need to query for the "CreateAudio3" process address in the dll, create an "AudioCoder" instance of that one and then call the "Encode" method for each chunk of data you are processing...

All the rest is (more or less) documented on the Winamp pages ;-)
Logged
KtoY
Posts: 6


« Reply #7 on: 28 Jan '07 - 18:30 »
Reply with quoteQuote

Thanks
Logged
Mauricio Castro
Guest
« Reply #8 on: 24 Jul '08 - 20:47 »
Reply with quoteQuote

I am using as a basic source of example to mp3 and ogg. Let me a hint to make use of encryption to MP4 (aacp). Does anyone know what I say a command line?

///VEJA >> SEE

  // setup encoder command-line (raw PCM data to avoid length limit)
  if chk_Mp3.Checked then
  begin
    Content := BASS_ENCODE_TYPE_MP3;
    Comline := PChar(Format('lame -r -x -s 44100 -b %d -', [bitrate]));
  end
  else
  begin
 Content := BASS_ENCODE_TYPE_OGG;
     Comline := PChar(Format('oggenc -r -R 44100 -b %d -m %d -', [bitrate, 16]));
      // for better Quality on ogg just use -q (-2.0 - 10.0}

  end;
Logged
Bert
Posts: 159


« Reply #9 on: 24 Jul '08 - 22:26 »
Reply with quoteQuote

Dear Bernd,
i'm sorry, but what is new now?
I evaluate this for a long time now, my problem is that the encoder produces always a loud haerable click at the start of the recording.
Is this better now?

Best, Bert.
Logged
radio42
Posts: 4012


« Reply #10 on: 25 Jul '08 - 07:43 »
Reply with quoteQuote

Hi Bert,

I might not fully understand your question?
a) "What is new now"?
-> To what are you referring - v2.4? enc_aacPlus.exe is there for quite some time and hasn't changed since then! It was just constantly adapted to always work with the latest BASS version.

b) "Lound hearable click"
-> I never noticed something like this - in all my tests there is absolutly no click. So I guess this is not related to enc_aacPlus.exe - but might be related to something else in your environment.
Do you have some code on how you use it?
Logged
Mickael
Posts: 60


« Reply #11 on: 19 Aug '08 - 21:33 »
Reply with quoteQuote

I am using as a basic source of example to mp3 and ogg. Let me a hint to make use of encryption to MP4 (aacp). Does anyone know what I say a command line?

///VEJA >> SEE

  // setup encoder command-line (raw PCM data to avoid length limit)
  if chk_Mp3.Checked then
  begin
    Content := BASS_ENCODE_TYPE_MP3;
    Comline := PChar(Format('lame -r -x -s 44100 -b %d -', [bitrate]));
  end
  else
  begin
 Content := BASS_ENCODE_TYPE_OGG;
     Comline := PChar(Format('oggenc -r -R 44100 -b %d -m %d -', [bitrate, 16]));
      // for better Quality on ogg just use -q (-2.0 - 10.0}

  end;

I tried :

Quote
  else if chk_AACP.Checked then
  begin
    Content := BASS_ENCODE_TYPE_AAC;
    Comline := PChar(Format('enc_aacPlus - - --cbr %d --lc --silent --rawpcm 44100 2 16', [bitrate*1000]));
  end

Result:

---------------------------
Info
---------------------------
The encoder died!
---------------------------
OK   
---------------------------


 Embarrassed Embarrassed Embarrassed
Logged
radio42
Posts: 4012


« Reply #12 on: 19 Aug '08 - 22:51 »
Reply with quoteQuote

Have you copied the required Winamp files as well?
These are: "enc_aacplus.dll" and "nscrt.dll" from a Winamp 5.2 installation.
Logged
Mickael
Posts: 60


« Reply #13 on: 20 Aug '08 - 11:38 »
Reply with quoteQuote

Whooops.. no! It's ok :-)
Thank you!
Logged
Mickael
Posts: 60


« Reply #14 on: 20 Aug '08 - 12:23 »
Reply with quoteQuote

and MP2 ? (Mpeg 1 layer 2)

Quote

  else if chk_MP2.Checked then
  begin
    Content := BASS_ENCODE_TYPE_MP3;
    Comline := PChar(Format('twolame -r -x -s 44100 -b %d -', [bitrate]));
  end


---------------------------
Info
---------------------------
The encoder died!
---------------------------
OK   
---------------------------

towlame.exe config it's ok  ?

Quote
TwoLAME version TwoLame 0.3.12b (http://www.twolame.org)
MPEG Audio Layer II (MP2) encoder
Usage:
        twolame [options] <infile> [outfile]

Both input and output filenames can be set to - to use stdin/stdout.
  <infile>       input sound file (any format supported by libsndfile)
  <outfile>      output bit stream of encoded audio

Input Options
        -r, --raw-input          input is raw signed PCM audio
        -x, --byte-swap          force byte-swapping of input
        -s, --samplerate srate   sampling frequency of raw input (Hz)
            --samplesize bits    size of raw input samples in bits (default 16-b
it)
            --samplefloat        32-bit float raw input
        -N, --channels nch       number of channels in raw input
        -g, --swap-channels      swap channels of input file
            --scale value        scale input (multiply PCM data)
            --scale-l value      scale channel 0 (left) input
            --scale-r value      scale channel 1 (right) input

Output Options
        -m, --mode mode          (s)tereo, (j)oint, (d)ual, (m)ono or (a)uto
        -a, --downmix            downmix from stereo to mono file for mono encod
ing
        -b, --bitrate br         total bitrate in kbps (default 192 for 44.1kHz)

        -P, --psyc-mode psyc     psychoacoustic model -1 to 4 (default 3)
        -v, --vbr                enable VBR mode
        -V, --vbr-level lev      enable VBR and set VBR level -50 to 50 (default
 5)
        -B, --max-bitrate rate   set the upper bitrate when in VBR mode
        -l, --ath lev            ATH level (default 0.0)
        -q, --quick num          only calculate psy model every num frames
        -S, --single-frame       only encode a single frame of MPEG Audio

Miscellaneous Options
        -c, --copyright          mark as copyright
        -o, --non-original       mark as non-original
            --original           mark as original (default)
        -p, --protect            enable CRC error protection
        -d, --padding            force padding bit/frame on
        -R, --reserve-bits num   set number of reserved bits in each frame
        -e, --deemphasis emp     de-emphasis n/5/c (default: (n)one)
        -E, --energy             turn on energy level extensions

Verbosity Options
        -t, --talkativity num    talkativity 0-10 (default is 2)
            --quiet              same as --talkativity=0
            --brief              same as --talkativity=1
            --verbose            same as --talkativity=4


Allowable bitrates for 32, 44.1 and 48kHz sample input (MPEG-1)
  32,  48,  56,  64,  80,  96, 112, 128, 160, 192, 224, 256, 320, 384

Allowable bitrates for 16, 22.05 and 24kHz sample input (MPEG-2)
   8,  16,  24,  32,  40,  48,  56,  64,  80,  96, 112, 128, 144, 160

Logged
radio42
Posts: 4012


« Reply #15 on: 20 Aug '08 - 13:14 »
Reply with quoteQuote

You should ommit the "-x" flag, as twolame already uses little-endian.
Also you need to either specify the "--samplesize" or the "--samplefloat" flag depending on your input format as well as the "-N" flag.
E.g.:
"'twolame -r -s 44100 --samplesize 16 -N 2 -b..."
Logged
Mickael
Posts: 60


« Reply #16 on: 20 Aug '08 - 13:57 »
Reply with quoteQuote

Hello radio42,

Quote
  else if chk_MP2.Checked then
  begin
    Content := BASS_ENCODE_TYPE_MP3;
    Comline := PChar(Format('twolame -r -s 44100 --samplesize 16 -N 2 -b %d -', [bitrate]));
  end

---------------------------
Info
---------------------------
The encoder died!
---------------------------
OK   
---------------------------


 Embarrassed
Logged
Mickael
Posts: 60


« Reply #17 on: 20 Aug '08 - 14:24 »
Reply with quoteQuote

I'm tested the config on command line:


Quote
C:\>twolame -r -s 44100 --samplesize 16 -N 2 -b 128 -
Missing output filename.
TwoLAME version TwoLame 0.3.12b (http://www.twolame.org)
MPEG Audio Layer II (MP2) encoder

Usage: twolame [options] <infile> [outfile]

Try "twolame --help" for more information.


Missing output filename ?
Logged
radio42
Posts: 4012


« Reply #18 on: 20 Aug '08 - 15:03 »
Reply with quoteQuote

Yes sure, that's why I placed the "..." in my above comment, as I thought you know the rest of the command-line, as it it listed in the twolame help ;-)
Logged
Mickael
Posts: 60


« Reply #19 on: 20 Aug '08 - 15:06 »
Reply with quoteQuote

   
Hello radio42.
Sorry I did not understand very well your answer. (I'm French)

This line does not work:

Quote
Comline := PChar(Format('twolame -r -s 44100 --samplesize 16 -N 2 -b %d -', [bitrate]));

Do you have any idea why?
Thank you
Logged
Pages: [1] 2 3  All
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines