Log in

View Full Version : AC3 to AAC conversion


zzspectrez
24th March 2010, 03:00
Hello..

I have recently run in to audio conversion problems taking my dvd audio and converting it to aac.

My normal process is as follows:
* anydvd
* dvd decrypter IFO mode
* MeGUI
* dgindex
* avisynth script edit
* encode video x264 PS3 VHQ
* encode audio Nero AAC: NDAAC-LC-Multichannel-192kbps
* mux mp4

This has worked for the majority of my dvds to play on my PS3.

Recently Megui has been erroring out on certain audio tracks. Seems to be limited to the Multichannel Streams.

The two most recent titles I have been have problems with is Inglourious Bastards and The Fourth Kind.

Sample log is:

[Error] Log for job3 (audio, (2009) -- The Fourth Kind (PG-13) -- PS3 T80 3_2ch 448Kbps DELAY 0ms.ac3 -> (2009) -- The Fourth Kind (PG-13) -- PS3 T80 3_2ch 448Kbps DELAY 0ms.mp4)
-[Information] [3/23/2010 7:28:52 AM] Started handling job
-[Information] [3/23/2010 7:28:52 AM] Preprocessing
-[NoImage] Avisynth script
--[NoImage] LoadPlugin("C:\Program Files\MeGUI\tools\avisynth_plugin\NicAudio.dll")
--[NoImage] NicAc3Source("Z:\(2009) -- The Fourth Kind (PG-13)\(2009) -- The Fourth Kind (PG-13) -- PS3 T80 3_2ch 448Kbps DELAY 0ms.ac3")
--[NoImage] Normalize()
--[NoImage] return last
-[NoImage] Commandline used: -ignorelength -lc -br 192000 -if - -of "{0}"
-[Information] [3/23/2010 7:28:52 AM] Encoding started
-[Information] [3/23/2010 7:28:52 AM] Encode thread started
-[Information] [3/23/2010 7:28:52 AM] Avisynth script environment opened
-[Information] [3/23/2010 7:28:52 AM] Script loaded
-[Information] Output Decoder
--[NoImage] Channels: 6
--[NoImage] Bits per sample: 32
--[NoImage] Sample rate: 48000
-[NoImage] Commandline: C:\Apps\neroAacEnc.exe -ignorelength -lc -br 192000 -if - -of "Z:\(2009) -- The Fourth Kind (PG-13)\(2009) -- The Fourth Kind (PG-13) -- PS3 T80 3_2ch 448Kbps DELAY 0ms.mp4"
-[Information] [3/23/2010 7:28:52 AM] Encoder process started
-[Error] An error occurred
--[NoImage] Exception message: The pipe has been ended.
--[NoImage] Stacktrace
---[NoImage] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
---[NoImage] at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
---[NoImage] at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count)
---[NoImage] at MeGUI.AviSynthAudioEncoder.encode()
--[NoImage] Inner exception: null
-[NoImage] Output from encoder via stderr
--[NoImage] *************************************************************
--[NoImage] * *
--[NoImage] * Nero AAC Encoder *
--[NoImage] * Copyright 2009 Nero AG *
--[NoImage] * All Rights Reserved Worldwide *
--[NoImage] * *
--[NoImage] * Package build date: Feb 18 2010 *
--[NoImage] * Package version: 1.5.4.0 *
--[NoImage] * *
--[NoImage] * See -help for a complete list of available parameters. *
--[NoImage] * *
--[NoImage] *************************************************************
-[NoImage] Output from encoder via stdout: ERROR: error while encoding frame
-[Information] [3/23/2010 7:34:39 AM] Job completed

zzspectrez
24th March 2010, 03:04
Further Information:

I have also tried piping eac3to to neroaacencode.

such as:

eac3to "T80 3_2CH 448KBPS DELAY 0ms.ac3" stdout.wav | neroaacenc -lc -if - -of nero_out.m4a

This also ends up truncating partway through the audio.

eac3to v3.18
command line: eac3to "T80 3_2CH 448KBPS DELAY 0ms.ac3" stdout.wav
------------------------------------------------------------------------------
AC3, 5.1 channels, 1:38:00, 448kbps, 48khz, dialnorm: -27dB
Disabling DRC for Nero (E-)AC3 decoding...
Removing AC3 dialog normalization...
Decoding with DirectShow (Nero Audio Decoder 2)...
DirectShow reports 5.1 channels, 24 bits, 48khz
Writing WAV...
Creating file "stdout.wav"...
Writing the destination file failed. <ERROR>
Aborted at file position 329306880. <ERROR>

Blue_MiSfit
24th March 2010, 03:07
Why pipe? You can just use eac3to direcly!

~MiSfit

zzspectrez
24th March 2010, 03:07
Further information:


If I do the following the audio is converted to full length not truncated. However this encodes in HE not LC which will not play on PS3!!

What do you think is going on?

eac3to "T80 3_2CH 448KBPS DELAY 0ms.ac3" eac3to_out.m4a


<LOGFILE>
eac3to v3.18
command line: eac3to "T80 3_2CH 448KBPS DELAY 0ms.ac3" eac3to_outm4a
------------------------------------------------------------------------------
AC3, 5.1 channels, 1:38:00, 448kbps, 48khz, dialnorm: -27dB
Disabling DRC for Nero (E-)AC3 decoding...
Removing AC3 dialog normalization...
Decoding with DirectShow (Nero Audio Decoder 2)...
DirectShow reports 5.1 channels, 24 bits, 48khz
Encoding AAC <0.50> with NeroAacEnc...
eac3to processing took 9 minutes, 59 seconds.
Done.

zzspectrez
24th March 2010, 03:11
Why pipe? You can just use eac3to direcly!

~MiSfit

Well, if I avoid piping it works. However it is strange because eac3to is just using neroaacenc as well.

Second I need to pass the -lc option to neroaacenc.

Third, its strange it only borks when eac3to pipes to neroaacenc yet both megui and eac3to use neroaacenc. Where is the error comming from?


zzspectrez

tebasuna51
24th March 2010, 04:16
Try with this command line:

eac3to "T80 3_2CH 448KBPS DELAY 0ms.ac3" stdout.wav | neroaacenc -q 0.35 -ignorelength -if - -of nero_out.m4a

if work maybe the problem is the low bitrate fixed for lc encode in some frame.

I always recommend use the Variable BitRate with quality greater than 0.32 (always LC output, less than 0.32 make HE), the default 0.5 is too much for ac3 448 Kb/s

And don't forget the -ignorelength parameter, your audio need:
(98x60 sec) x (48000 samples/s) x (24/8 bytes/sample) x (6 chan) = 5080320000 byes >4GB

With MeGUI you can select also VBR Q=0.35 Automatic profile, CBR 192 Kb/s is very low for LC with 5.1

kypec
25th March 2010, 10:35
I always recommend use the Variable BitRate with quality greater than 0.32 (always LC output, less than 0.32 make HE), the default 0.5 is too much for ac3 448 Kb/s
Recently I followed your advice tebasuna and bumped into weird situation:
source audio: AC3 2.0 448kbps demuxed via DGIndex 1.5.7
(main.ac3 = 247396352 bytes)
intermediate audio: WAV obtained via UsEac3to %.w64 -normalize
(main.24b.w64 1272324224 bytes) 24-bits stereo

Then I encoded this very same WAV file 4 times with different quality parameter value set via NeroAacEnc:
eac3to v3.18
command line: "C:\Program Files\AVTools\eac3to\eac3to.exe" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64.m4a" -quality=0.30 -progressnumbers -log="C:\Program Files\AVTools\UsEac3to\UsEac3To.log"
------------------------------------------------------------------------------
W64, 2.0 channels, 1:13:38, 24 bits, 2304kbps, 48khz
Reading W64...
Encoding AAC <0.30> with NeroAacEnc...
The original audio track has a constant bit depth of 24 bits.
eac3to processing took 2 minutes, 14 seconds.
Done.

eac3to v3.18
command line: "C:\Program Files\AVTools\eac3to\eac3to.exe" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64.m4a" -quality=0.31 -progressnumbers -log="C:\Program Files\AVTools\UsEac3to\UsEac3To.log"
------------------------------------------------------------------------------
W64, 2.0 channels, 1:13:38, 24 bits, 2304kbps, 48khz
Reading W64...
Encoding AAC <0.31> with NeroAacEnc...
The original audio track has a constant bit depth of 24 bits.
eac3to processing took 2 minutes, 12 seconds.
Done.

eac3to v3.18
command line: "C:\Program Files\AVTools\eac3to\eac3to.exe" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64.m4a" -quality=0.32 -progressnumbers -log="C:\Program Files\AVTools\UsEac3to\UsEac3To.log"
------------------------------------------------------------------------------
W64, 2.0 channels, 1:13:38, 24 bits, 2304kbps, 48khz
Reading W64...
Encoding AAC <0.32> with NeroAacEnc...
The original audio track has a constant bit depth of 24 bits.
eac3to processing took 2 minutes, 16 seconds.
Done.

eac3to v3.18
command line: "C:\Program Files\AVTools\eac3to\eac3to.exe" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64" "D:\SOURCE\FRANKLIN\poklad\main.24b.w64.m4a" -quality=0.33 -progressnumbers -log="C:\Program Files\AVTools\UsEac3to\UsEac3To.log"
------------------------------------------------------------------------------
W64, 2.0 channels, 1:13:38, 24 bits, 2304kbps, 48khz
Reading W64...
Encoding AAC <0.33> with NeroAacEnc...
The original audio track has a constant bit depth of 24 bits.
eac3to processing took 2 minutes, 16 seconds.
Done.


Here is the MediaInfo report with important details on all 4 encodes:
Complete name : D:\SOURCE\FRANKLIN\poklad\main.q30.m4a
File size : 45.7 MiB
Overall bit rate : 86.8 Kbps
cdec : ndaudio 1.5.3.0 / -q 0.30
Format profile : LC
Format settings, SBR : Yes
Format settings, PS : No
Bit rate : 86.0 Kbps
Maximum bit rate : 121 Kbps
Stream size : 45.3 MiB (99%)

Complete name : D:\SOURCE\FRANKLIN\poklad\main.q31.m4a
File size : 55.1 MiB
Overall bit rate : 105 Kbps
cdec : ndaudio 1.5.3.0 / -q 0.31
Format profile : LC
Format settings, SBR : No
Bit rate : 103 Kbps
Maximum bit rate : 138 Kbps
Stream size : 54.2 MiB (98%)

Complete name : D:\SOURCE\FRANKLIN\poklad\main.q32.m4a
File size : 47.8 MiB
Overall bit rate : 90.7 Kbps
cdec : ndaudio 1.5.3.0 / -q 0.32
Format profile : LC
Format settings, SBR : No
Bit rate : 89.1 Kbps
Maximum bit rate : 119 Kbps
Stream size : 46.9 MiB (98%)

Complete name : D:\SOURCE\FRANKLIN\poklad\main.q33.m4a
File size : 49.5 MiB
Overall bit rate : 94.1 Kbps
cdec : ndaudio 1.5.3.0 / -q 0.33
Format profile : LC
Format settings, SBR : No
Bit rate : 92.5 Kbps
Maximum bit rate : 124 Kbps
Stream size : 48.7 MiB (98%)


q=0.30 produces apparently HE-AAC (LC+SBR) with lowest bitrate which is fine.
q=0.32 & 0.33 produce higher bitrates (pure LC) which is also fine.
How come q=0.31 produces higher bitrate than 0.32 or even 0.33? :confused:
Is there some design flaw in NeroAAC encoder? I believe monotonic quality parameter must produce monotonic bitrates, or not?

tebasuna51
25th March 2010, 12:19
This is the boundary between HE (q=0.30) and LC (q=0.31) automatic encode, and is know there are changes in bitrate.
For Nero developers is OK, assume the difference.

zzspectrez
27th March 2010, 20:45
Try with this command line:

eac3to "T80 3_2CH 448KBPS DELAY 0ms.ac3" stdout.wav | neroaacenc -q 0.35 -ignorelength -if - -of nero_out.m4a

if work maybe the problem is the low bitrate fixed for lc encode in some frame.

I always recommend use the Variable BitRate with quality greater than 0.32 (always LC output, less than 0.32 make HE), the default 0.5 is too much for ac3 448 Kb/s

And don't forget the -ignorelength parameter, your audio need:
(98x60 sec) x (48000 samples/s) x (24/8 bytes/sample) x (6 chan) = 5080320000 byes >4GB

With MeGUI you can select also VBR Q=0.35 Automatic profile, CBR 192 Kb/s is very low for LC with 5.1

AHHH... -ignorelength.

Thanks.. This did the trick! :)