Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th August 2006, 15:48   #1  |  Link
sjchmura
Registered User
 
Join Date: Sep 2002
Posts: 352
NicAUDIO bug report: 6Channel Ac3->MP4 under MEGUI

I was asked to post some samples from teh MEGUI forums.

Here is a small ac3 clip that failes. This clip has no errors in ac3filter(well, I cut it out so I hope it does not now) but it encodes FINE in BeSweet/BeHappy/NeroReCode.


http://rapidshare.de/files/30053014/...ELAY-760ms.ac3

So this is the error. Encodes fine in nero or besweet.

Channels=6, BitsPerSample=16, SampleRate=48000Hz
C:\Program Files\Multimedia\Encoding\megui\tools\neroaacenc\neroAacEnc_SSE2.exe -ignorelength -q 0.5 -if - -of "F:\Star.Wars.ep3.DELAY-760ms.mp4"Error:
MeGUI.AviSynthException: m2AudioAC3Source: error in file "F:\Star.Wars.ep3.DELAY-760ms.ac3"
at MeGUI.AviSynthAudioEncoder.encode()
sjchmura is offline   Reply With Quote
Old 20th August 2006, 15:54   #2  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
link is broken

aslo BeHappy use same engine like MeGUI, so BeHappy use same version of NicAudio and simmilar settings. what you settings use in MeGUI
shon3i is offline   Reply With Quote
Old 20th August 2006, 18:22   #3  |  Link
Dark Eiri
Registered User
 
Join Date: May 2006
Posts: 335
I got the exact same error. Help please ._.
Dark Eiri is offline   Reply With Quote
Old 20th August 2006, 19:52   #4  |  Link
squid_80
Registered User
 
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
The link has been posted wrong. Corrected: http://rapidshare.de/files/30053014/...ELAY-760ms.ac3
squid_80 is offline   Reply With Quote
Old 20th August 2006, 19:54   #5  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
The correct link is:

http://rapidshare.de/files/30053014/...ELAY-760ms.ac3

This file start like 5.1 but have a fragment (8 frames) of 2.0. See DelayCut log:
Code:
====== PROCESSING LOG ======================
Time 00:00:04.768; Frame#= 150. Some basic parameters changed between Frame #1 and this frame
Time 00:00:04.992; Frame#= 157. Some basic parameters changed between Frame #150 and this frame
NicAudio crash at this point (also with BeHappy).

Other decoder/player produce an audible cut but continue.
You can use DirectShowSource with MEGUI/BeHappy.

Edit: NicAudio also crash with ac3 44.1 KHz and give the same error message. See a possible solution in this post

Last edited by tebasuna51; 20th August 2006 at 20:33.
tebasuna51 is offline   Reply With Quote
Old 20th August 2006, 20:55   #6  |  Link
squid_80
Registered User
 
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
It's also possible to run the stream through projectx with the "replace all non-3/2 ac3 by 3/2lfe silence" option turned on, if you have suitable silent replacement frames in ac3.bin.
squid_80 is offline   Reply With Quote
Old 22nd August 2006, 05:52   #7  |  Link
sjchmura
Registered User
 
Join Date: Sep 2002
Posts: 352
BeSweet encodes it fine. So how did you find the errors? AC3Fix - on the whole file - shows zero errors. COuld I have induced these errors in the cutting to make it small. I can post the whole clip if you would like.

THe problem wtih directshow is the following - getting it to work right. Nero7 decoder does not work and ac3filter also fails - you just get 2 channel even if set to "AS IS". If you "Force 3/2" you still get 2 channel. RIght now I have ac3filter encoding every NON ac3 file to ac3 so I only need 1 digital audio connection.

When I return to chicago I will try the projectx solution.
sjchmura is offline   Reply With Quote
Old 22nd August 2006, 08:57   #8  |  Link
squid_80
Registered User
 
Join Date: Dec 2004
Location: Melbourne, AU
Posts: 1,963
This sort of thing normally happens with DVB broadcasts, the program has 6 channel sound but the advertisements only have stereo. So unless you cut in exactly the right spot when removing ads, you end up with a few frames of stereo audio which isn't exactly wrong but can confuse some programs.
AC3Filter should be able to handle it, I don't know why it's not working for you.
squid_80 is offline   Reply With Quote
Old 22nd August 2006, 10:39   #9  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by sjchmura
BeSweet encodes it fine. So how did you find the errors? AC3Fix - on the whole file - shows zero errors. COuld I have induced these errors in the cutting to make it small. I can post the whole clip if you would like.
I agree with squid_80 about how this frames are there, and, because are correct frames, AC3Fix don't say nothing.
DelayCut show a 5.1 stream and, trying to fix, show a problem between frame 150 and 157.
If you cut a fragment between 4800 ms (32 ms/frame) and 5000 ms and open after in DelayCut show a 2.0 ac3 stream.

A hard way to find the errors is analyze the frame headers with WinHex after 4.6 sec. (crash point of NicAudio).
Quote:
Originally Posted by sjchmura
THe problem wtih directshow is the following - getting it to work right. Nero7 decoder does not work and ac3filter also fails - you just get 2 channel even if set to "AS IS". If you "Force 3/2" you still get 2 channel. RIght now I have ac3filter encoding every NON ac3 file to ac3 so I only need 1 digital audio connection.
Yes, DirectShow is problematic because each user have a different configuration. With ffdshow properly configured work fine for me.
tebasuna51 is offline   Reply With Quote
Old 23rd August 2006, 18:08   #10  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
I'm looking into the issue. On that clip NicAudio.dll is throwing an exception to AviSynth to tell it that there was a problem reading a frame. This causes the crash strangely.
The main problem is there is an issue with that AC3 file. How I mask that is another question.

I'll keep working on it.

-Nic

ps
The exception is thrown because the "Flags" from the frame differ to what they should be.

pps
Does anyone have a small nice 44100khz AC3 file that breaks NicAudio too? That would help with my testing greatly.
(I tried making a 44.1khz file in ffmpeg but that doesn't seem to have the alternating ac3 frame size, at least not on my test, so I do need an example file)

ppps
So I/you can find it easily, the thread where tebasuna51 talks of the 44.1 issue is here http://forum.doom9.org/showthread.ph...537#post860537

Last edited by Nic; 23rd August 2006 at 18:45.
Nic is offline   Reply With Quote
Old 23rd August 2006, 21:28   #11  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
Try this: http://nic.dnsalias.com/NicAudio_alpha.zip
Might be worse, could be better. Don't have enough bad AC3/44.1k files to test on. I'm away tomorrow till Monday so thought I may as well post this, so I've got feedback on my return.

-Nic
Nic is offline   Reply With Quote
Old 24th August 2006, 17:23   #12  |  Link
sjchmura
Registered User
 
Join Date: Sep 2002
Posts: 352
I will be back from San Fran to home Friday and will test it nic. I about 50% of what I captured (through 1394) from NCB-Unviersal HD have these issues. I will also try the projectX fix.

So is nero and besweet just "reading past" the errors???

Thanks for looking into this. When this is fixed I will post it in the MEGUI thread about this issue.

Best

Steve
sjchmura is offline   Reply With Quote
Old 24th August 2006, 18:29   #13  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
Yup, as is azid. It's definitely an error and all decoders I had glitched on it slightly.

With the original NicAudio, any problems would cause it to throw an exception back to AviSynth. This new version should handle it better, but I need more test streams to make it bulletproof.

-Nic
Nic is offline   Reply With Quote
Old 25th August 2006, 01:03   #14  |  Link
sjchmura
Registered User
 
Join Date: Sep 2002
Posts: 352
Sure - let me cut come after I get home. How long do you need them? Do you want the entire length or should I make it as small as possible (and still get the error)??

Thanks

STeve
sjchmura is offline   Reply With Quote
Old 25th August 2006, 03:04   #15  |  Link
Dark Eiri
Registered User
 
Join Date: May 2006
Posts: 335
Thanks Nic! This alpha solved the problem! You're awesome!
Dark Eiri is offline   Reply With Quote
Old 25th August 2006, 03:45   #16  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
Is this alpha stable enough to put it in the megui autoupdate server or should i wait for a beta or maybe a stable version?
Sharktooth is offline   Reply With Quote
Old 25th August 2006, 08:40   #17  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Nic
Try this: http://nic.dnsalias.com/NicAudio_alpha.zip
Might be worse, could be better. Don't have enough bad AC3/44.1k files to test on. I'm away tomorrow till Monday so thought I may as well post this, so I've got feedback on my return.

-Nic
Does this alpha based on my last sources (incl DRC control and 5-channel bugfix). If not please provide Your source.
dimzon is offline   Reply With Quote
Old 25th August 2006, 10:55   #18  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by dimzon
Does this alpha based on my last sources (incl DRC control and 5-channel bugfix). If not please provide Your source.
This alpha works fine replacing with silence wrong frames (like Azid). I think is better this solution than stop decoding.
Include DRC control and 5-channel bugfix, but don't support NicMPG123Source then is based in sources previous to 1.5 NicAudio_25_dll_20060314.

Based in last sources I know (20060314), I make a new m2audio_ac3.cpp modified. I think solve this thread bug and the 44.1 KHz bug.

There are still a problem related with this Nic's comment:
"The length of the stream is calculated by the filesize/framelength, if the framelength can be variable this can't work."
In fact I make a mod with:
Code:
FrameCount = int((StreamLength - StreamOffset) / FrameLength);

If (Samplerate == 44100)
   FrameCount = int(0.5 + 147 * (StreamLength - StreamOffset) / (640 * Bitrate)));
But this work only with ac3 Aften generated. Let me explain this a little bit more:

I detect the 44.1 KHz bug testing Aften with the wav sample provided by jruggle.
I encoded the sample with Aften and also with SoftEncode at 192 Kb/s. NicAudio crash with Aften encoded just at the begining (frame 4) but with SoftEncoded crash at frame 118.
Here is the ac3 samples.

To maintain 192 Kb/s we need Framesize = 192 * 640 / 147 = 835,918... bytes, then we need a 4% of frames with 834 bytes and a 96% of frames with 836 bytes.
The encoder must maintain the proportion between short and long frames in order to preview the FrameCount with the StreamLength in:
FrameCount = (147 * StreamLength) / (640 * Bitrate)

I make some 44.1 KHz test with this results:
Code:
              Nominal    Theoretic                Real       Real      Calculated
ac3           Bitrate    FrameSize  FileLength   Bitrate   FrameCount  FrameCount  Error
-----------   --------   ---------  ----------  ---------  ----------  ----------  -----
0030_aften    192 kbps    835.918       720560   191.999        862       861.998     0
0030_aften    224 kbps    975.238       840654   223.999        862       861.998     0
0030_aften    448 kbps   1950.476      1681310   447.999        862       861.999     0
0242_aften    224 kbps    975.238      6776930   224.000       6949      6949.000     0
4409_aften    192 kbps    835.918    105933426   191.999     126727    126726.998     0

0030_soften   192 kbps    835.918       719696   191.769        862       860.964     1
0030_soften   224 kbps    975.238       840388   223.928        862       861.725     0
0030_soften   448 kbps   1950.476      1681726   448.110        862       862.213     0
0242_soften   224 kbps    975.238      6775224   223.943       6949      6947.251     2
4409_soften   192 kbps    835.918    105816846   191.788     126727    126587.535   139
Seems the samples encoded with aften maintain the % between FrameSizes to reach the bitrate, but SoftEncode make 50% short/long Frames and need other method to calculate FrameCount.

For SoftEncode the average FrameSize is = 1 + 2 * int(Bitrate * 320 / 147), 835 bytes for 192 Kb/s, and now:
FrameCount = StreamLength / (1 + 2 * int(Bitrate * 320 / 147))

What is the correct method? I don't find anything in specs.

What do others encoders? Please provide ac3 44.1 KHz samples with others encoders than SoftEncode, Aften or free encoders.
tebasuna51 is offline   Reply With Quote
Old 31st August 2006, 17:11   #19  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
At Swedish Radio there are some free samples ddwav 44.1 KHz 5.1 640 Kb/s.
I don't know the encoder but must be a commercial one because DRC is present.

The test:
Code:
              Nominal                Real      Real      Calculated
ac3           Bitrate   FileLength  Bitrate  FrameCount  FrameCount  Error
-----------   --------  ----------  -------  ----------  ----------  -----
SURROUNDTEST  640 Kb/s   10128544   639,999     3635      3634,999     0
BILJAKTEN_LOW 640 Kb/s   11719576   640,000     4206      4206,000     0
FIREBIRD 1    640 Kb/s   23815314   639,999     8547      8546,999     0
DEMO2_DD      640 Kb/s   26052790   640,000     9350      9350,000     0
Work like Aften, preserving the bitrate and we can apply:
FrameCount = int(0.5 + (147 * StreamLength) / (640 * Bitrate))

Any new version to test (Nic/Dimzon)?
tebasuna51 is offline   Reply With Quote
Old 31st August 2006, 17:52   #20  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
@tebasuna51: Thanks for finding samples. Have a cold at present, so can't get the motivation to look into them. But that should change this weekend.
Nic is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.