PDA

View Full Version : Simple AAC Encoder for use in a muxing program


shadowolf64
22nd March 2009, 01:50
First off, hello everyone! This is my first post on doom9 so youll have to excuse me if this is a dumb question or it has already been asked but I couldn't find anything using search so here goes.

I'm currently making a program that would automate the process of remuxing a file into the MP4 container for playback on an Xbox 360. Currently the Xbox 360 can only playback MP4s with AAC audio. So far my program is done with the video side of things but I still have to manually encode the audio to aac before using the program. So I was wondering what would be the simplest way to incorporate an aac encoder into my program. It needs to be a command line program so I can pass arguments to it and it needs to be fairly lightweight so it doesn't significantly affect performance. It also needs to be able to convert from a couple of different formats which seems to be the current problem. It needs to be able to convert mainly from AC3 but also MP3 and WAV if possible. I was thinking of using Nero AAC Encoder but it only supports WAV. I am looking for something similar to how meGUI converts AAC files, as in I don't have to input any extra info besides where the file is. I know this is a very specific request but I'm really hoping someone can help me.

So does anyone have any suggestions? Any help would be greatly appreciated. :D

tebasuna51
22nd March 2009, 02:52
Then you need a encoder (NeroAacEnc) and some decoders.

You can use eac3to with dts/ac3/mp3/wav decoder (libav) support and NeroAacEnc like encoder. Sintax:

eac3to input.xxx output.m4a -quality=0.35

If you want somethink similar to MeGUI (AviSynth method) you can use Bepipe, uNicAudio.dll (dts/ac3/mp3/wav) and NeroAacEnc:

Bepipe --script "UnicAudioSource(^input.xxx^)" | neroAacEnc -q 0.35 -if - -of output.m4a

shadowolf64
22nd March 2009, 03:32
Ok thanks I think Ill use ea3to and neroaacenc but one question: Is there a reason you specified the quality as 0.35?

tebasuna51
22nd March 2009, 12:20
Is only a sample, but is my recommendation to transcode from dts/ac3/mp3.
Below of 0.31 you can get aac-he not fully compatible with all hardware players, and with 0.4 you can obtain higer bitrate/quality than source (then you lose bitrate).
If source is lossless you can use high quality (the default 0.5 is a very good approach).

roozhou
22nd March 2009, 12:28
Here:
http://forum.doom9.org/showthread.php?t=141441

Use the dshow2wav tool to pipe to NeroAacEnc. It is much simpler than Bepipe and other avisynth-based tools.
Or you can directly encode any file with CTAACEncoder.

tebasuna51
22nd March 2009, 16:05
Use the dshow2wav tool to pipe to NeroAacEnc. It is much simpler than Bepipe and other avisynth-based tools.
Or you can directly encode any file with CTAACEncoder.
I like your tool to transcode wma audio in wmv container but I can't recommend always the use of DirectShow decoders because you can't control the decoder options.

With ac3/dts some directshow decoders can use DialogNormalization or DynamicRangeCompression with very bad result.

shadowolf64
22nd March 2009, 21:04
Then you need a encoder (NeroAacEnc) and some decoders.

You can use eac3to with dts/ac3/mp3/wav decoder (libav) support and NeroAacEnc like encoder. Sintax:

eac3to input.xxx output.m4a -quality=0.35

If I use this method do I need to first call eac3to to convert to wav and then NeroAacEnc to encode to AAC? Or can eac3to handle the whole thing if it has NeroAacEnc in the plugins folder?

PS: Is libav decoder included in the latest release of eac3to? If not where can I download it? The only link I saw took me to the MPlayer site.

tebasuna51
23rd March 2009, 00:52
If I use this method do I need to first call eac3to to convert to wav and then NeroAacEnc to encode to AAC? Or can eac3to handle the whole thing if it has NeroAacEnc in the plugins folder?
Eac3to only need NeroAacEnc.exe at same folder than eac3to.exe.
PS: Is libav decoder included in the latest release of eac3to? If not where can I download it? The only link I saw took me to the MPlayer site.
libav is included with eac3to (avcodec.dll + avutil-49.dll)

shadowolf64
23rd March 2009, 01:14
Thanks for all your help. It seems to be working perfectly now. I only have one last question. Is there a reason that in your examples your output was output.m4a instead of output.aac?

tebasuna51
23rd March 2009, 02:36
NeroAacEnc can't output .aac files (with ADTS headers for instance), only output raw aac streams in mp4 container (.m4a = .mp4 file with only audio)