22 May '13 - 16:44 *
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 18768 times)
Mickael
Posts: 60


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


Do you have any idea why?  Huh
Logged
radio42
Posts: 4012


« Reply #21 on: 24 Aug '08 - 10:06 »
Reply with quoteQuote

Yes, you also need to specify the input and output filename as well, that's missing in your command line as far as I can see.
« Last Edit: 24 Aug '08 - 11:09 by radio42 » Logged
hwahrmann
Posts: 116


« Reply #22 on: 26 Aug '08 - 12:20 »
Reply with quoteQuote

Bernd,

i simply can't make it work.
using the program below doesn't produce any output. Also tried without an Encoding Proc and specified the file name, with the same result.
commenting the enc_aacplus line and use lame, i get a perfect rip of the first track of the CD.
it's just that enc_aacplus does nothing. (Of course, i have enc_aacplus.dll and nscrt.dll in my executable folder).

Also, one other question. how does that work with the --mp4box switch? Can this switch be used together with stdout and an encoing proc?

thanks,

Helmut

using System;
using System.Runtime.InteropServices;
using Un4seen.Bass;
using Un4seen.Bass.AddOn.Enc;
using Un4seen.Bass.AddOn.Cd;

namespace EncTest
{
  class Program
  {
    private static ENCODEPROC _encoderProc;
    private static string _outFile;
    private static System.IO.FileStream _fs = null;
    private static byte[] _data = new byte[1048510]; // 1MB buffer

    static void Main(string[] args)
    {
      Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero, null);

      int stream = BassCd.BASS_CD_StreamCreate(0, 0, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_DEFAULT);

      _outFile = "Track1.aac";
      string encoderSettings = "enc_aacplus.exe - - --cbr 128000";
      //string encoderSettings = "lame --preset standard - -";
      _encoderProc = new ENCODEPROC(EncoderSave);
      int encoderHandle = BassEnc.BASS_Encode_Start(stream, encoderSettings, BASSEncode.BASS_ENCODE_DEFAULT, _encoderProc, IntPtr.Zero);

      byte[] encBuffer = new byte[1048510]; // our encoding buffer
      while (Bass.BASS_ChannelIsActive(stream) == BASSActive.BASS_ACTIVE_PLAYING)
      {
        // getting sample data will automatically feed the encoder
        int len = Bass.BASS_ChannelGetData(stream, encBuffer, encBuffer.Length);
      }

      BassEnc.BASS_Encode_Stop(stream);
      Bass.BASS_StreamFree(stream);


      if (_fs != null)
      {
        _fs.Flush();
        _fs.Close();
      }
    }

    private static void EncoderSave(int handle, int channel, IntPtr buffer, int length, IntPtr user)
    {
      if (_fs == null)
      {
        _fs = System.IO.File.OpenWrite(_outFile);
      }
      if (buffer != IntPtr.Zero)
      {
        Marshal.Copy(buffer, _data, 0, length);
        _fs.Write(_data, 0, length);
      }
    }

  }
}
Logged
radio42
Posts: 4012


« Reply #23 on: 26 Aug '08 - 13:40 »
Reply with quoteQuote

Hi,

as you are using BASS.NET, you might try to use the BASS.NET Encoder framework in the Misc namespace.
Use the "EncoderWinampAACplus", set all your AACplus properties...and then you can use the "EncoderCommandLine" property to see what is different between your command-line and the one generated by the BASS.NET class.
Logged
hwahrmann
Posts: 116


« Reply #24 on: 27 Aug '08 - 13:34 »
Reply with quoteQuote

thanks for the quick response.

checked with the EncoderWinampAACplus.
it produced "enc_aacplus.exe - - --cbr 128000 --silent --rawpcm 44100 2 16"

so it was the missing rawpcm spec, which causes the error.

1 things i've noticed though:

 using the command line above with BassEnc results in a file which is exactly 2 times as big as when using it via EncoderWinampAACplus, which shows the same commandline.

any idea?
Logged
radio42
Posts: 4012


« Reply #25 on: 27 Aug '08 - 13:42 »
Reply with quoteQuote

That sounds strange.
Are both files playing out exactly the same result - even if they are so different in size?

Maybe in one case you are using float channels and in the other 16-bit channels?
Logged
hwahrmann
Posts: 116


« Reply #26 on: 27 Aug '08 - 14:19 »
Reply with quoteQuote

yeah it is the BASS_ENCODE_DEFAULT. When setting it to BASS_ENCODE_FP_16BIT, they're the same size.

thanks for your help.
Logged
radio42
Posts: 4012


« Reply #27 on: 17 Aug '09 - 12:25 »
Reply with quoteQuote

Hi,

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

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

This new 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
Logged
Bert B.
Posts: 103


« Reply #28 on: 19 Aug '09 - 10:20 »
Reply with quoteQuote

Just a question: Why would you prefer this encoder over Nero's neroAacEnc.exe?
As far as I know this encoder is free, and you need just this executable (no installation of other software).

Bert
Logged
radio42
Posts: 4012


« Reply #29 on: 19 Aug '09 - 12:34 »
Reply with quoteQuote

That is correct.
The only reason to not use neroAacEnc.exe is, if you want to broadcast AACplus content (e.g. use it with BASS_Encode_CastInit) - as neroAacEnc.exe doesn't support STDOUT (which is needed for broadcasting).
And this was the only reason for making enc_aacPlus.exe - to support STDOUT!
Logged
Bert B.
Posts: 103


« Reply #30 on: 19 Aug '09 - 13:57 »
Reply with quoteQuote

Thanks for the explanation.

Regards,
Bert
Logged
3delite
Posts: 623


« Reply #31 on: 19 Aug '09 - 16:24 »
Reply with quoteQuote

Can I use enc_aacPlus.exe bundled with my application?

Best regards
3delite
Logged
radio42
Posts: 4012


« Reply #32 on: 19 Aug '09 - 17:08 »
Reply with quoteQuote

Yes, you can bundle enc_aacPlus.exe with your app...from my point.
But note, that using any AAC decoding or encoding stuff in your app means that your app needs a AAC license from VIA ;-)
Logged
3delite
Posts: 623


« Reply #33 on: 19 Aug '09 - 17:42 »
Reply with quoteQuote

I see...

Thanx!

Best regards
3delite
Logged
fmcoder
Posts: 386


« Reply #34 on: 11 Jun '10 - 09:43 »
Reply with quoteQuote

Hi everyone.

There seems to be a problem with enc_aacplus.exe (or enc_aacplus.dll).

If I use command line:
enc_aacplus.exe - - --lc --silent --br 64000 --rawpcm 44100 2 16

The output stream is in 32000Hz, but I need 44100Hz. Why it resamples and how can I avoid/control it?
Logged
radio42
Posts: 4012


« Reply #35 on: 11 Jun '10 - 10:30 »
Reply with quoteQuote

Yes, you are right.
But it seems, that this is a limitation of the enc_aacPlus.dll being used (Winmap).
You might also try the 'official' enc_aacPlus command-line tool: http://aacpluscli.codeplex.com
This gives the exact same results.
I also figured, that other combinations might even fail totally (the resulting aac file is corrupt).
E.g. using a bitrate of 128000 with --lc fails.
But using a bitrate of 32000 with --lc works fine again.

So I am sure, that this looks definitly like a bug in enc_aacPlus.dll - as the .exe simply invokes the winamp .dll encode method with the appropriate values directly as given from the command-line.
So there is absolutly no extra pre- or post-processing involved with regards to the encoding.

However, when you just want to encode LC-AAC I anyhow would recommend to use the FAAC encoder instead of enc_aacPlus.
enc_aacPlus should to my mind only be used in case of HE+-AAC encodeing (aacPlus) - as this is the only format which is not supported by FAAC.
Logged
fmcoder
Posts: 386


« Reply #36 on: 12 Jun '10 - 08:42 »
Reply with quoteQuote

Thanks for answer! I'll try to play with faac.exe, because of many complains from users about those 32kHz.
Logged
fmcoder
Posts: 386


« Reply #37 on: 12 Jun '10 - 09:21 »
Reply with quoteQuote

Tried to use the faac.exe but no luck.
The command line is:
faac.exe -P -R 44100 -B 16 -C 2 -X -b %d -o - -

But it doesn't produce correct output... does anyone have an example of working with faac?

Also, FAAC seems not support CBR. Is it OK to broadcast in ABR?

Thanks.
Logged
radio42
Posts: 4012


« Reply #38 on: 12 Jun '10 - 15:03 »
Reply with quoteQuote

When you want to stream (broadcast) AAC, then you must use enc_aacPlus.
The reason is, that SHOUTcast only accepts HE-AAC streams and FAAC only supports LC-AAC (as previously said).

So if you want to use enc_aacPlus, you must also use "--high" option, as this is the only codec which is supported by SHOUTcast.
Logged
fmcoder
Posts: 386


« Reply #39 on: 13 Jun '10 - 09:42 »
Reply with quoteQuote

Yes, for HE-AAC (so called AAC+) I use the bass_encaac. I also want to include support for LC-AAC in case some users may need it. So, the problem may be that I use shoutcast, thanks. I didn't know it can't support lc-aac Smiley
Logged
Pages: 1 [2] 3  All
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines