Author Topic: BASS_Encode_ServerInit() with AAC  (Read 1250 times)

3delite

  • Posts: 907
BASS_Encode_ServerInit() with AAC
« on: 16 Jun '13 - 17:40 »
Hi!

All is working fine with MP3, Ogg Vorbis and Opus, but fails with AAC.
The encoder and server is initialized fine but when I try to connect to the server app. the client app. freezes, both with QAAC and FAAC encoder.
I get a display though that a client connected in the server app.

Any help would be appreciated!

Thank you!
« Last Edit: 16 Jun '13 - 19:12 by 3delite »

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: BASS_Encode_ServerInit() with AAC
« Reply #1 on: 17 Jun '13 - 17:01 »
I haven't tried QAAC, but in the case of FAAC, you are probably running into a bug affecting its "stdout" output on Windows. Here's a previous thread on the subject, including a link to the code changes required to fix the bug...

   www.un4seen.com/forum/?topic=14363

3delite

  • Posts: 907
Re: BASS_Encode_ServerInit() with AAC
« Reply #2 on: 17 Jun '13 - 20:11 »
Hmmm... Could not make Cygwin to compile the sources. :'(
But thank you! But frankly I am not sure it would help, because QAAC seems to have the same problem. I am thinking that (another?) problem is that AAC is not a headerless format, but not sure about this.

If anybody could make this couple of lines modification for faac.exe that would be cool. Probably would be usefull to others as well.


3delite

  • Posts: 907
Re: BASS_Encode_ServerInit() with AAC
« Reply #3 on: 18 Jun '13 - 13:26 »
I successfully contacted ryanckim and he sent me the modified faac.exe which now works. Thank you ryanckim!
But I made a mistake also "-" is not enough for stdout it must be "-o -", I discovered this when found a "-.aac" named file in the progdir. :)
So this works. Thank you!

Here is the modifed FAAC: http://www.3delite.hu/Misc/faac2.zip

But I have a little question: I specify raw PCM input, and in the help it says:

Code: [Select]
  -B            Raw PCM input sample size (default: 16, also possible 8, 24, 32
                bit fixed or float input).

Now how to specify 32bit float? Tried "-B 32F" bot that resulted noise. Anybody has some experience with this?

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: BASS_Encode_ServerInit() with AAC
« Reply #4 on: 18 Jun '13 - 14:54 »
But thank you! But frankly I am not sure it would help, because QAAC seems to have the same problem. I am thinking that (another?) problem is that AAC is not a headerless format, but not sure about this.

In order to use an AAC encoder for streaming purposes, its output will need to be in ADTS form. Looking at QAAC's command-line options, it looks like the "--adts" option should enable that.

I successfully contacted ryanckim and he sent me the modified faac.exe which now works. Thank you ryanckim!

Nice :)

But I have a little question: I specify raw PCM input, and in the help it says:

Code: [Select]
  -B            Raw PCM input sample size (default: 16, also possible 8, 24, 32
                bit fixed or float input).

Now how to specify 32bit float? Tried "-B 32F" bot that resulted noise. Anybody has some experience with this?

As far as I can see, in the FAAC source code, floating-point isn't currently supported with raw input (only with WAV input). To get around that, you can use the BASS_ENCODE_FP_32BIT flag in your BASS_Encode_Start call to have BASSenc convert 32-bit floating-point sample data to 32-bit integer for the encoder.

3delite

  • Posts: 907
Re: BASS_Encode_ServerInit() with AAC
« Reply #5 on: 18 Jun '13 - 16:15 »
You are right. ADTS flag works. :)

Ok about 32 bit float mode, made it to only, up to 32bit integer sample data format is selectable. I just always try to make the software to support everything maximally.

Everything works fine now, thank you!