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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 7th January 2016, 10:46   #13781  |  Link
mariner
Registered User
 
Join Date: Nov 2005
Posts: 583
Thanks for the kind reply, tebasuna51.

1.
Quote:
Originally Posted by tebasuna51 View Post
This is the default behaviour for ALL ac3 encoders.
BTW, with Aften, you can avoid the insertion of 5 ms of silence with, for instance:

eac3to INPUT stdout.wav | Aften -b 192 -pad 0 -readtoeof 1 - OUTPUT.ac3
So, this would work for IN.aac -> OUT.ac3?
Code:
eac3to IN.aac stdout.wav | Aften -b 192 -pad 0 -readtoeof 1 - OUT.ac3
Would you also kindly provide a CLI for IN.mkv -> OUT.ac3, perhaps using ffmpeg if not possible with eac3to?

2.
Quote:
"The directshow Nero 7 decoder, used by eac3to to decode .aac, cut the first 1024 samples (21,333 ms in 48 KHz) in 2.0"
Then, always cut 21 ms, and (without -pad 0) finish with 16 ms shorter.
As I'd explained, Audacity here would indicate 42ms cut, not 21ms. And only if there's silence at the beginning. Otherwise, everything is preserved by the Nero DS decoder.

So if the following command is run, the output delay is either -37ms or +5ms depending on the content.

What might be causing such unusual behavior?

Code:
eac3to  IN.mkv  2: OUT.ac3
3.
Quote:
eac3to only can decode aac with the directshow Nero 7 decoder.
That's interesting, given Eac3to uses libAften for decoding aac when converting aac to ac3.
Any reason?

Many thanks and best regards.
mariner is offline  
Old 7th January 2016, 11:19   #13782  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by Nico8583 View Post
...but I don't understand why do you say "talking about free soft" for ffmpeg, dcadec and Aften are commercial softwares ?
The DTS decoder dcadec (inside ffmpeg and eac3to) is also free soft.

The AC3 encoder inside ffmpeg is better than Aften encoder, both free soft, but maybe there are better certified Dolby Digital commercial encoders.

I say "maybe" because I don't know test about that.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline  
Old 7th January 2016, 15:06   #13783  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by mariner View Post
1.1
So, this would work for IN.aac -> OUT.ac3?
eac3to IN.aac stdout.wav | Aften -b 192 -pad 0 -readtoeof 1 - OUT.ac3
3.
That's interesting, given Eac3to uses libAften for decoding aac when converting aac to ac3.
Don't mistake decoder and encoder.
libAften is only a AC3 encoder, can't decode aac, that only work if you have installed the directshow Nero 7 decoder.

Recommended command line:
eac3to IN.aac -192 OUT.ac3
or
eac3to IN.mkv 2: -192 OUT.ac3

Both produce an AC3 with firts 21 ms cutted and 5 ms delayed (16 ms shorter).
You can add the parameter +16ms to both command lines to obtain the first 21 ms replaced by silence.
Quote:
1.2
Would you also kindly provide a CLI for IN.mkv -> OUT.ac3, perhaps using ffmpeg if not possible with eac3to?
ffmpeg -i IN.aac -c:a ac3 -b:a 192k OUT.ac3
ffmpeg -i IN.mkv -map 0:1 -c:a ac3 -b:a 192k OUT.ac3
ffmpeg -i IN.mp4 -map 0:1 -c:a ac3 -b:a 192k OUT.ac3

All AC3 with the standard ac3 5 ms delay of silence.

Quote:
2. As I'd explained, Audacity here would indicate 42ms cut, not 21ms. And only if there's silence at the beginning. Otherwise, everything is preserved by the Nero DS decoder.

So if the following command is run, the output delay is either -37ms or +5ms depending on the content.

What might be causing such unusual behavior?
Audacity don't use the Nero DS decoder to decode AAC, it use ffmpeg.

And in all my test opening IN.aac or IN.mkv or IN.mp4 the decoded aac is perfect, without any cut or delay.

I don't know how you obtain these data. Please explain your workflow.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 7th January 2016 at 15:18. Reason: typo
tebasuna51 is offline  
Old 9th January 2016, 00:03   #13784  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
madshi, could we please get an update for dcadec? it has reached v0.2. I know we could do it ourselves but as others have reported for some reason the .dll we produce seems to work slower than yours.
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack)

Last edited by Thunderbolt8; 9th January 2016 at 19:45.
Thunderbolt8 is offline  
Old 9th January 2016, 08:50   #13785  |  Link
mariner
Registered User
 
Join Date: Nov 2005
Posts: 583
Thanks for the kind reply,

1.
Quote:
Originally Posted by tebasuna51 View Post

Recommended command line:
eac3to IN.aac -192 OUT.ac3
or
eac3to IN.mkv 2: -192 OUT.ac3

Both produce an AC3 with firts 21 ms cutted and 5 ms delayed (16 ms shorter).
You can add the parameter +16ms to both command lines to obtain the first 21 ms replaced by silence.

ffmpeg -i IN.aac -c:a ac3 -b:a 192k OUT.ac3
ffmpeg -i IN.mkv -map 0:1 -c:a ac3 -b:a 192k OUT.ac3
ffmpeg -i IN.mp4 -map 0:1 -c:a ac3 -b:a 192k OUT.ac3

All AC3 with the standard ac3 5 ms delay of silence.
Is there a way to use -pad 0 with ffmpeg?

2.
Quote:
Audacity don't use the Nero DS decoder to decode AAC, it use ffmpeg.

And in all my test opening IN.aac or IN.mkv or IN.mp4 the decoded aac is perfect, without any cut or delay.

I don't know how you obtain these data. Please explain your workflow.
The workflow is quite straight forward:
Code:
eac3to IN.mkv 2:  OUT.ac3
Audacity is only used to display the waveforms. Assuming the absence of idiosyncrasy of any kind, it's a simple matter to read off the relative delays between the aac and ac3.

I have uploaded two 10sec samples for your testing pleasure. The first has the remarkable ability to survive Nero's molestation, while the other has a sampling frequency of 48000/24000, which may explain the 42ms truncation instead of 21ms. Perhaps a spectrum analyzer would tell if it is indeed band limited.

Many thanks and best regards.
Attached Files
File Type: zip 1.zip (157.0 KB, 42 views)
File Type: zip 2.zip (133.2 KB, 45 views)
mariner is offline  
Old 9th January 2016, 11:34   #13786  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Quote:
Originally Posted by tebasuna51 View Post
The DTS decoder dcadec (inside ffmpeg and eac3to) is also free soft.

The AC3 encoder inside ffmpeg is better than Aften encoder, both free soft, but maybe there are better certified Dolby Digital commercial encoders.

I say "maybe" because I don't know test about that.
Thank you, I'll look at this.
A last question, why do you use "-center_mixlev 0.707 -surround_mixlev 0.707" with ffmpeg ?
Nico8583 is offline  
Old 9th January 2016, 13:49   #13787  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by mariner View Post
Is there a way to use -pad 0 with ffmpeg?
At least is not ducumented that option:
https://ffmpeg.org/ffmpeg-all.html#a...-ac3_005ffixed

Quote:
I have uploaded two 10sec samples...
You are right, using your samples I obtain cuts of 0 and 32 ms.
Even with other samples until 54 ms cut.

Then I edited my post http://forum.doom9.org/showthread.ph...12#post1747412 and now must be:

- The directshow Nero 7 decoder, used by eac3to to decode .aac, make unpredictables cuts (from 0 to 54 ms at least) in 2.0 and is broken for 5.1.

But this is still valid:

- eac3to works fine extracting AAC from MKV/TS/M2TS containers, I obtain the same aac than I muxed previously.
Then, to avoid problems, you can use eac3to to extract and Qaac or ffmpeg to decode (or LWLibavAudioSource inside AviSynth).
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline  
Old 9th January 2016, 14:05   #13788  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by Nico8583 View Post
... why do you use "-center_mixlev 0.707 -surround_mixlev 0.707" with ffmpeg ?
By default ( https://ffmpeg.org/ffmpeg-all.html#a...-ac3_005ffixed ) ffmpeg put -center_mixlev 0.595 -surround_mixlev 0.500:

Quote:
8.2.1.2 Downmix Levels
----------------------
-center_mixlev level

Center Mix Level. The amount of gain the decoder should apply to the center channel when downmixing to stereo. This field will only be written to the bitstream if a center channel is present. The value is specified as a scale factor. There are 3 valid values:

0.707 Apply -3dB gain
0.595 Apply -4.5dB gain (default)
0.500 Apply -6dB gain

-surround_mixlev level

Surround Mix Level. The amount of gain the decoder should apply to the surround channel(s) when downmixing to stereo. This field will only be written to the bitstream if one or more surround channels are present. The value is specified as a scale factor. There are 3 valid values:

0.707 Apply -3dB gain
0.500 Apply -6dB gain (default)
0.000 Silence Surround Channel(s)
-center_mixlev 0.707 -surround_mixlev 0.707 is the Aften default.

I recommend use -center_mixlev 0.707 to avoid the low dialog volume when is downmixing to stereo. You can let the default -surround_mixlev or even 0.000 at your preference.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 9th January 2016 at 14:10.
tebasuna51 is offline  
Old 9th January 2016, 14:26   #13789  |  Link
Nico8583
Registered User
 
Join Date: Jan 2010
Location: France
Posts: 851
Ok thank you, perhaps it could solved dynamic range I can find on DTS track
Nico8583 is offline  
Old 11th January 2016, 11:10   #13790  |  Link
mariner
Registered User
 
Join Date: Nov 2005
Posts: 583
Thanks for the kind reply, tebasuna51.

1.
Quote:
Originally Posted by tebasuna51 View Post
At least is not ducumented that option:
https://ffmpeg.org/ffmpeg-all.html#a...-ac3_005ffixed
Thanks for the link. Can ffmpeg add +/- delay like eac3to?

2.
Quote:
- The directshow Nero 7 decoder, used by eac3to to decode .aac, make unpredictables cuts (from 0 to 54 ms at least) in 2.0 and is broken for 5.1.
Perhaps madshi can be persuaded to consider other candidates for aac decoding?

Many thanks and best regards.
mariner is offline  
Old 11th January 2016, 18:37   #13791  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by mariner View Post
Thanks for the link. Can ffmpeg add +/- delay like eac3to?
You can search at same doc page.
For add +delay: https://ffmpeg.org/ffmpeg-all.html#toc-adelay
To add 500 ms delay to a 6 channel audio add this to command line:

-af adelay=500|500|500|500|500|500

For add -delay: https://ffmpeg.org/ffmpeg-all.html#toc-atrim
To cut fisrt 50 ms to an audio add this to command line:

-af atrim=0.05

Quote:
Perhaps madshi can be persuaded to consider other candidates for aac decoding?
He don't want add libav aac decoder because license copyright problems.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline  
Old 12th January 2016, 19:24   #13792  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
Quote:
Originally Posted by Thunderbolt8 View Post
madshi, could we please get an update for dcadec?
Just out of curiosity, can you try and test here ?
I've change some compiler options, to make a build, theoricaly, more efficient.
The Intel version is compiled with Intel compiler, and needs a CPU with AVX2 instructions.
jpsdr is offline  
Old 15th January 2016, 05:57   #13793  |  Link
-TiLT-
Registered User
 
Join Date: Mar 2003
Location: Germany
Posts: 43
Is edit limited to one socond precision? -edit=h:mm:ss,+-delayms
Or is there any way to work with a higher precision? Sth. like -edit:=h:mm:ss:msm,+-delayms?

In several scenaerios, I just want to cut out one or two AC3 frames at a very precise position or insert some silent frames (looping is actually not always an option), but there seem to be no tools out there for such tasks.
-TiLT- is offline  
Old 15th January 2016, 11:59   #13794  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Quote:
Originally Posted by -TiLT- View Post
In several scenaerios, I just want to cut out one or two AC3 frames at a very precise position or insert some silent frames (looping is actually not always an option), but there seem to be no tools out there for such tasks.
Maybe Delaycut.
Music Fan is offline  
Old 15th January 2016, 12:34   #13795  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Or HeadAC3he; but it's rather old, hard to find nowadays.

Oh, look, a signature!
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 15th January 2016, 13:03   #13796  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by -TiLT- View Post
Is edit limited to one socond precision? -edit=h:mm:ss,+-delayms
Or is there any way to work with a higher precision? Sth. like -edit:=h:mm:ss:msm,+-delayms?
You can use -edit:=h:mm:ss.msm,+-delayms

But remember than eac3to (or DelayCut) only work adding/deleting frames (32 ms for samplerate 48 KHz).
Then the edit point, and delay value, are rounded to near value (precision +- 16 ms)

Is not possible better precision without recode.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 15th January 2016 at 13:08.
tebasuna51 is offline  
Old 20th January 2016, 00:59   #13797  |  Link
Yoshi
Registered User
 
Join Date: Apr 2014
Posts: 32
Due to the circumstances, I encountered yet another movie example where I wonder if the decoding is correctly done by eac3to/ffmpeg or not.

"Everest" comes with a 7.1 TrueHD Atmos track which is, decoded to 7.1 FLAC full of clipping in certain scenes.

For the sake of comparison, I extracted the AC3 core and let that one decode to 5.1 PCM. While eac3to suggests a gain of -6.2dB after encountering clipping and recognizing it as such, the result looks just as bad as the "lossless" one (as I learned, this seems to be a relative term when it comes to multichannel audio in conjunction with TrueHD and DTS-HD MA), only more quiet of course.

Here is twice the left channel of the soundtrack.



Now I wonder: is that particular clipping already contained in the mix (and maybe even intended) or is it screwed up during decoding? In other words: how can I be sure which type of clipping I'm dealing with - the immanent one or the artificial one introduced by bugs or difficulty of the decoding itself thanks to the floating point vs. integer dilemma?
Yoshi is offline  
Old 20th January 2016, 08:56   #13798  |  Link
torturesauce
Registered User
 
Join Date: Jul 2011
Posts: 19
The foobar2000 developer for the DTS plugin had abandoned support of dcadec and reverted back to the old DTS codec because dca was too slow and buggy at the time. Can somebody please make a fork or something with the latest dcadec so I can run some tests with it?
torturesauce is offline  
Old 20th January 2016, 12:43   #13799  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by torturesauce View Post
The foobar2000 developer for the DTS plugin had abandoned support of dcadec and reverted back to the old DTS codec because dca was too slow and buggy at the time. Can somebody please make a fork or something with the latest dcadec so I can run some tests with it?
Buggy for what? Is this the problem?
Quote:
Problems almost entirely resulting from the switch to an incomplete implementation such as dcadec, which not only did not have any implementation for the common 14 bits data / 2 bits padding per 16 bit word format of most older DTS streams, it also fails to recognize some DTS CDs outright. It's also significantly slower at decoding.
That's don't affect at all to DTS movie trakcs, and the problem can be solved with a data parser to restore the standard 16 bits/word DTS format.
The old BeSplit can do the job without problems.

Maybe this is important for Foobar2000 but not here, and the old DTS decoder foobar plugin don't support DTS-HD at all, at least in my test.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline  
Old 20th January 2016, 13:05   #13800  |  Link
torturesauce
Registered User
 
Join Date: Jul 2011
Posts: 19
Quote:
Originally Posted by tebasuna51 View Post
Buggy for what? Is this the problem?


That's don't affect at all to DTS movie trakcs, and the problem can be solved with a data parser to restore the standard 16 bits/word DTS format.
The old BeSplit can do the job without problems.

Maybe this is important for Foobar2000 but not here, and the old DTS decoder foobar plugin don't support DTS-HD at all, at least in my test.


Yes, that's it. It had serious issues with DTS CDs. And there is an old foobar plugin for DTS-HD. Okay, I guess I'll ask about it on Hydrogenaudio instead of here. Thanks!
torturesauce is offline  
Closed Thread

Tags
eac3to

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 14:13.


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