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 15th November 2012, 11:46   #1  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,622
eac3to v3.24 Bugs & Improvements

In this first post I want put a summary of Bugs & Improvements.
Next post can have most extensive descriptions.
Feel free to add comments or other Bugs & Improvements, after discussion I can add to the summary.

Downmix bugs

- When source is 6.1 the -down6 don't work fine. [OK in 3.25]
Workaround: eac3to input6.1 output5.1 -0,1,2,3,5,6,4 -down6

Downmix improvements

- Use not normalized matrix to downmix and let the second pass do the normalize if necessary. [OK in 3.25]

- Accept other channel configuration than 5.1 to -down2 [OK in 3.26]

- Add a new parameter for simple stereo downmix. [OK in 3.25]

Decoder bugs

- Nero AC3 decoder fail sometimes, let libav default for AC3. Sample [OK in 3.25, improved libav in 3.26]

- TrueHD decoder problems. [OK in 3.25]

- AC3 3.0 decode with FR and FC changed (nero and libav) [OK in 3.25]
Workaround: eac3to 3.0chan.ac3 output.wav -0,2,1

- DTS-ES 6.1 -> WAV 5.1 (libav) finish with channel mask of 0x70f (6.1) instead of the expected 0x60f (5.1) [OK in 3.25]

Decoder improvemets

- Actualize libav decoder (maybe solve the TrueHD problems). [OK in 3.25, improved libav in 3.26]

- Maybe add AAC decoder to libav.

Encoder bugs

- NeroAacEnc fail sometimes when piped directly by eac3to, work always when use the OS pipe.
Workaround: eac3to input stdout.wav | NeroAacEnc -q 0.5 -ignorelength -if - -of output.m4a

Encoder improvements

- Support for Aften encode other inputs than 2.0/5.1 [OK in 3.25]
Workaround: eac3to input3-4-5channels stdout.wav | Aften -b 640 -readtoeof 1 - output.ac3

Issues with gaps/overlaps

- See next post. [OK in 3.25]

Info

- Document all the working parameters.

- Support SRT subtitles when using -check [OK in 3.25]

- Remove bit-depth display for lossy tracks [OK in 3.25]

- Assign language "english" to mkv tracks without languaje info (MKV rules). [OK in 3.25]

- Remove the message about 24 fps.

- In -test remove the check of MKVtoolnix (I think is not necessary). [OK in 3.25]

Others

- Bad checking between edit position and duration. [OK in 3.25]

- Defined framerate conversion is ignored in some circumstances.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.

Last edited by tebasuna51; 5th January 2013 at 16:11. Reason: Add info
tebasuna51 is online now   Reply With Quote
Old 15th November 2012, 11:47   #2  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,622
Issues with gaps/overlaps

First explain the gaps/overlaps audio problems based in the different duration of video and audio frames.
Supose 2 m2ts with 25 fps video and one ac3 track (for easy numbers).
And want extract the full ac3 stream.

See the attached image with 3 options:

A) The second m2ts begin with a new audio. For instance a initial credit added before the main movie.
Now we can't recover the perfect sync without recode the audio.

B) The second m2ts begin with the next audio frame (maybe when the delay is low).
Now we preserve the sync only adding the second audio stream to the first.

C) The second m2ts begin with a duplicated frame of the ac3.
Now we need delete the duplicated frame before add the two streams.

Go with a real sample, extract the english ac3 track from Brave BD.
(I'm using the spanish angle but is the same for this track).
There are 9 .m2ts and I extract (eac3to) the ac3 for each file (t01.ac3 to t09.ac3).

I analyze video and audio durations and check if there are ac3 frames duplicated (numbers in ms.):
Code:
 Audio   Dur_Aud  Dur_Vid  Dif_A-V  Acu_Aud  Acu_Vid  Acu_A-V
------- -------- -------- -------- -------- -------- --------
t01.ac3    44608    44586       22    44608    44586       22
t02.ac3    28288    28278       10    72896    72864       32 Initial frame duplicated
t03.ac3   182496   182474       22   255392   255338       54
t04.ac3    58048    58016       32   313440   313355       85 Initial frame duplicated
t05.ac3  4888320  4888300       20  5201760  5201655      105 Initial frame duplicated
t06.ac3    46272    46255       17  5248032  5247909      123
t07.ac3   324288   324282        6  5572320  5572192      128 Initial frame duplicated
t08.ac3    34912    34910        2  5607232  5607102      130
t09.ac3    45152    45128       24  5652384  5652230      154
Then the full audio is 154 ms longer than video.

I delete the duplicated frames and repeat the check:
Code:
 Audio   Dur_Aud  Dur_Vid  Dif_A-V  Acu_Aud  Acu_Vid  Acu_A-V
------- -------- -------- -------- -------- -------- --------
t01.ac3    44608    44586       22    44608    44586       22
t02.ac3    28256    28278      -22    72864    72864        0
t03.ac3   182496   182474       22   255360   255338       22
t04.ac3    58016    58016        0   313376   313355       21
t05.ac3  4888288  4888300      -12  5201664  5201655        9
t06.ac3    46272    46255       17  5247936  5247909       27
t07.ac3   324256   324282      -26  5572192  5572192        0
t08.ac3    34912    34910        2  5607104  5607102        2
t09.ac3    45152    45128       24  5652256  5652230       26
Now the audio finish with only 26 ms. of difference.
And always the difference is less than 32 ms. (ac3 frame duration)
If we join the ac3 files we have a perfect stream in sync with the video.

If I use eac3to to extract the full stream from the .mpls I have the WARNINGS:
Code:
[a03] Audio overlaps for 22ms at playtime 0:00:45.  <WARNING>
[a03] Audio overlaps for 10ms at playtime 0:01:13.  <WARNING>
[a03] Audio overlaps for 22ms at playtime 0:04:15.  <WARNING>
[a03] Audio overlaps for 31ms at playtime 0:05:13.  <WARNING>
[a03] Audio overlaps for 20ms at playtime 1:26:42.  <WARNING>
[a03] Audio overlaps for 18ms at playtime 1:27:28.  <WARNING>
[a03] Audio overlaps for  6ms at playtime 1:32:52.  <WARNING>
And after realize the gaps/overlaps finish with a ac3 with the same length than first method.
But aren't identical.
Seems eac3to delete initial frame in t02.ac3 (correct) but also in t03.ac3 (incorrect).

Delete a correct frame, or preserve duplicated frames, most the times is unnoticeable, but sometimes can be detected like here.
Also for a perfect decode of the audio, a frame need a correct initialization from the previous frame and, if isn't the correct one can produce glitches, like was detected here.

For this BD you can obtain the correct english ac3 stream with a .bat file like this:
Code:
@echo off
"YourPathTo\eac3to.exe" 00952.m2ts 2: t01.ac3
"YourPathTo\eac3to.exe" 00960.m2ts 2: t02.ac3 -32ms
"YourPathTo\eac3to.exe" 00954.m2ts 2: t03.ac3
"YourPathTo\eac3to.exe" 00961.m2ts 2: t04.ac3 -32ms
"YourPathTo\eac3to.exe" 00956.m2ts 2: t05.ac3 -32ms
"YourPathTo\eac3to.exe" 01042.m2ts 2: t06.ac3
"YourPathTo\eac3to.exe" 00958.m2ts 2: t07.ac3 -32ms
"YourPathTo\eac3to.exe" 00968.m2ts 2: t08.ac3
"YourPathTo\eac3to.exe" 00959.m2ts 2: t09.ac3
copy /B t01.ac3 + t02.ac3 + t03.ac3 + t04.ac3 + t05.ac3 + t06.ac3 + t07.ac3 + t08.ac3 + t09.ac3 english.ac3
pause
I test the same procedure with DTS and DTS-HD and seems work fine.

BTW, not always delete the duplicated frames can be enough to mantain the sync, because can have type A join, then I suggest:
- First check if there are a duplicate frame and delete.
- If the accumulated delay is greater than the audio frame duration (not than half duration like seems work now eac3to) then delete a frame.
Attached Images
 
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.

Last edited by tebasuna51; 17th November 2012 at 11:44. Reason: Add info
tebasuna51 is online now   Reply With Quote
Old 15th November 2012, 11:47   #3  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,622
Downmix -down2 and simple stereo for all standard channel configuration.

If exist the parameter -mixlfe add:
FL' = ... + 0.7071 x LFE
FR' = ... + 0.7071 x LFE

Code:
2.1
    Stereo
        FL' = FL
        FR' = FR

2/1 or 2/1.1
    Stereo
        FL' = FL + 0.7071 x BC
        FR' = FR + 0.7071 x BC
    Dpl
        FL' = FL + 0.7071 x BC
        FR' = FR - 0.7071 x BC

2/2 or 2/2.1
    Stereo
        FL' = FL + BL
        FR' = FR + BR
    Dpl
        FL' = FL + 0.8660 x BL + 0.5000 x BR
        FR' = FR - 0.5000 x BL - 0.8660 x BR

3/0 or 3/0.1
    Stereo
        FL' = FL + 0.7071 x FC
        FR' = FR + 0.7071 x FC

3/1 or 3/1.1
    Stereo
        FL' = FL + 0.7071 x FC + 0.7071 x BC
        FR' = FR + 0.7071 x FC + 0.7071 x BC
    Dpl
        FL' = FL + 0.7071 x FC + 0.7071 x BC
        FR' = FR + 0.7071 x FC - 0.7071 x BC

3/2 or 3/2.1
    Stereo
        FL' = FL + 0.7071 x FC + BL
        FR' = FR + 0.7071 x FC + BR
    Dpl
        FL' = FL + 0.7071 x FC + 0.8660 x BL + 0.5000 x BR
        FR' = FR + 0.7071 x FC - 0.5000 x BL - 0.8660 x BR

3/2/1 or 3/2/1.1
    Stereo
        FL' = FL + 0.7071 x FC + BL + 0.7071 x BC
        FR' = FR + 0.7071 x FC + BR + 0.7071 x BC
    Dpl
        FL' = FL + 0.7071 x FC + 0.8660 x BL + 0.5000 x BR + 0.7071 x BC
        FR' = FR + 0.7071 x FC - 0.5000 x BL - 0.8660 x BR - 0.7071 x BC

3/2/2 or 3/2/2.1
    Stereo
        FL' = FL + 0.7071 x FC + BL + SL
        FR' = FR + 0.7071 x FC + BR + SR
    Dpl
        FL' = FL + 0.7071 x FC + 0.8660 x (BL + SL) + 0.5000 x (BR + SR)
        FR' = FR + 0.7071 x FC - 0.5000 x (BL + SL) - 0.8660 x (BR + SR)
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.

Last edited by tebasuna51; 17th November 2012 at 23:36.
tebasuna51 is online now   Reply With Quote
Old 15th November 2012, 13:50   #4  |  Link
nixo
Registered User
 
nixo's Avatar
 
Join Date: Dec 2002
Location: EUR
Posts: 159
Regular stereo downmix was discussed some time ago:
http://forum.doom9.org/showthread.php?p=1386125#post1386125

If it's not too much hassle, I'd still like to see it implemented.

--
Nikolaj
nixo is offline   Reply With Quote
Old 15th November 2012, 14:27   #5  |  Link
nautilus7
Registered User
 
nautilus7's Avatar
 
Join Date: Jan 2006
Location: Athens, Greece
Posts: 1,518
A very good adition would be the header patching for dts-hd "strange setup" files, so the arcsoft decoder can decode them properly. User xkodi, has made a lot of posts regarding this.
nautilus7 is offline   Reply With Quote
Old 15th November 2012, 14:39   #6  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,622
Quote:
Originally Posted by nixo View Post
Regular stereo downmix was discussed some time ago:
I can put all the options in Downmix post.

Quote:
Originally Posted by nautilus7 View Post
A very good adition would be the header patching for dts-hd "strange setup" files, so the arcsoft decoder can decode them properly. User xkodi, has made a lot of posts regarding this.
In my opinion ArcSoft decode properly the dts-hd "strange setup" now.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.

Last edited by tebasuna51; 15th November 2012 at 14:45.
tebasuna51 is online now   Reply With Quote
Old 15th November 2012, 14:51   #7  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
Quote:
Originally Posted by tebasuna51 View Post
- NeroAacEnc fail sometimes when piped directly by eac3to, work always when use the OS pipe.
Is there a way to reliably reproduce this?

Quote:
Originally Posted by tebasuna51 View Post
In my opinion ArcSoft decode properly the dts-hd "strange setup" now.
You mean there's a new decoder dll version from ArcSoft which fixes the problem? Which version number does that have?
madshi is offline   Reply With Quote
Old 15th November 2012, 15:14   #8  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 646
Quote:
Originally Posted by madshi View Post
You mean there's a new decoder dll version from ArcSoft which fixes the problem? Which version number does that have?
Maybe, Tebasuna51 is referring to 1.1.0.8 version.
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Nvidia GTX750 2GB DDR5 + SSD Vertex 4 256 GB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 15th November 2012, 15:35   #9  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 923
Suggested improvements:

--- use dcaenc besides Surcode

--- use fhgaacenc and qaac besides Nero AAC Encoder

--- look for MKVtoolnix files in the PATH environment-variable, not only in the Windows Registry

--- NO "undocumented" options anymore
filler56789 is offline   Reply With Quote
Old 15th November 2012, 16:15   #10  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 646
Suggested improvements:

- Sonic just doesn´t exist therefore it delevelop is discontinued. Maybe Roxio encoder is alternative, isnt?
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Nvidia GTX750 2GB DDR5 + SSD Vertex 4 256 GB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite
Overdrive80 is offline   Reply With Quote
Old 15th November 2012, 17:06   #11  |  Link
Snowknight26
Registered User
 
Join Date: Aug 2007
Posts: 1,394
Suggestion:
- Use ffmpeg/libavformat for MKV muxing
- Being able to output to NUL in Windows
- Support SRT subtitles when using -check
- Remove bit-depth display for lossy tracks

Bug fixes:
- Incorrect container frame rate for seamlessly-branched M2TS files

Last edited by Snowknight26; 15th November 2012 at 19:40.
Snowknight26 is offline   Reply With Quote
Old 15th November 2012, 17:19   #12  |  Link
nautilus7
Registered User
 
nautilus7's Avatar
 
Join Date: Jan 2006
Location: Athens, Greece
Posts: 1,518
Quote:
Originally Posted by Snowknight26 View Post
Suggestion:
Use ffmpeg/libavformat for MKV muxing.
+1

Nobody uses haali anymore.
nautilus7 is offline   Reply With Quote
Old 15th November 2012, 17:29   #13  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,479
- support AAC ADTS and MP4 input and output
- support input from pipe
- support timestretching and pitch change
sneaker_ger is offline   Reply With Quote
Old 15th November 2012, 17:34   #14  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,137
Guys, as I said in the eac3to thread, bugfixes and *SMALL* improvements, only. Some of what you're suggesting would be major changes.
madshi is offline   Reply With Quote
Old 15th November 2012, 18:02   #15  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,095
madshi don't forget about my two improvements

1) switch for custom block size for flac encoder (required by lossywav)

2) support for stdin ( eac3to.exe input.stdin ... )
Atak_Snajpera is offline   Reply With Quote
Old 15th November 2012, 18:05   #16  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,479
Quote:
Originally Posted by madshi View Post
Guys, as I said in the eac3to thread, bugfixes and *SMALL* improvements, only. Some of what you're suggesting would be major changes.
I've read that, but I thought we'd let tebasuna and you evaluate what's minor and what's not.

Quote:
Originally Posted by tebasuna51 View Post
Feel free to add comments or other Bugs & Improvements, after discussion I can add to the summary.

Last edited by sneaker_ger; 15th November 2012 at 18:11.
sneaker_ger is offline   Reply With Quote
Old 15th November 2012, 21:17   #17  |  Link
sshd
Registered User
 
Join Date: Mar 2008
Posts: 11
4-channel FLAC is identified as FLAC 3/1, but the FLAC format specifies it to be 2/2.

This messes up channel mapping for 4 channel surround.

An option to convert it to FLAC 3/2 would be nice.
sshd is offline   Reply With Quote
Old 16th November 2012, 00:28   #18  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,622
- "NeroAacEnc fail sometimes when piped directly by eac3to" - Is there a way to reliably reproduce this?
I don't know.

- You mean there's a new decoder dll version from ArcSoft which fixes the problem?
Nope, I use 1.1.0.0. We can decode to WAV Lss,Rss,Lsr,Rsr -> SL,SR,BL,BR, but decode Ls,Rs,Lsr,Rsr to WAV is not possible because don't exist the equivalent channels for Ls,Lr. Then the mix what ArcSoft put in SL,SR,BL,BR is correct for me.

- use dcaenc besides Surcode, use fhgaacenc and qaac besides Nero AAC Encoder.
You can use this encoders with 'pipe'.

- look for MKVtoolnix files in the PATH environment-variable, not only in the Windows Registry
I don't know for what eac3to need MKVtoolnix.

- NO "undocumented" options anymore.
OK.

- Sonic just doesn´t exist therefore it delevelop is discontinued. Maybe Roxio encoder is alternative, isnt?
I don't know, but maybe we can use only free soft.

- Use ffmpeg/libavformat for MKV muxing
Maybe. I don't know if is possible and the benefits, please explain.

- Being able to output to NUL in Windows
Please explain for what.

- Support SRT subtitles when using -check
OK. Maybe is little info bug.

- Remove bit-depth display for lossy tracks
OK. I have the same opinion.

- support AAC ADTS and MP4 input and output
OK with input (already in my first post). ADTS output is now possible with qaac and fhgaacenc 'pipe'.

- support input from pipe/support for stdin ( eac3to.exe input.stdin ... )
I don't know if is easy to implement. Please explain the usage.

- support timestretching and pitch change
Is interesting but maybe not easy. I don't know a good free soft to do this with audio multichannel. Pending.

- switch for custom block size for flac encoder (required by lossywav)
Encoders have many parameters and eac3to can't manage all. When I need a special parameter for AC3 I use the 'pipe' method. BTW, madshi have the last decission.

- 4-channel FLAC is identified as FLAC 3/1, but the FLAC format specifies it to be 2/2.
I can't reproduce this. A 2/2 wav encoded to FLAC is recognized, and decoded, with eac3to like 2/2.

- An option to convert it to FLAC 3/2 would be nice.
Please suggest generic improvements, eac3to can't do all audio jobs.
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is online now   Reply With Quote
Old 16th November 2012, 07:03   #19  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 903
Suggestion:

Extract chapters to a text file in IfoEdit/OGG|FrameCount/TimeCode format.
__________________
Win10 (x64) build 18362| GPU Caps Viewer 1.42.4.0
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
Intel Xeon X5660 @2.80GHz
Sparktank is offline   Reply With Quote
Old 16th November 2012, 11:19   #20  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,095
@tebasuna51
eac3to.exe input.flac output.stdout I lossywav.exe - -- I eac3to.exe input.stdin output.lossy.flac

regarding -B 512/1024/... switch this should probably be the easiest thing to implement on madshi's list since eac3to uses libflac. he just have to expose that to user.

Last edited by Atak_Snajpera; 16th November 2012 at 11:22.
Atak_Snajpera 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 11:50.


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