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 6th September 2021, 22:57   #1  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
ffmpeg ac3 vs eac3 - any difference?

Hi.

I've been doing some encodes at different bitrates and ABX tests. My results show no audible improvement using EAC3 at the same bitrate compared to the supposedly less capable AC3.

The difference do exist... but I had to phase invert and check cancellation to find it.

So my question about EAC3 and ffmpeg's EAC3 is...
  1. Is ffmpeg's EAC3 implementation just an AC3 with minor changes?
  2. A bad implementation of EAC3?
  3. Or is there really no quality difference between EAC3 and AC3 for the same bitrate/channels even using professional codecs and comparing between them?
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 02:59   #2  |  Link
junh1024
Registered User
 
Join Date: Mar 2011
Posts: 59
What bitrates did you test?

I'm guessing it shold show some difference for music @ 64-160kps stereo, but I haven't done any tests for DDP myself.

EBU testing https://tech.ebu.ch/docs/tech/tech3324.pdf (p21) has shown DDP 256kps almost matches DD 384kps on surround, but this is on professional encoders.
junh1024 is offline   Reply With Quote
Old 7th September 2021, 06:02   #3  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by junh1024 View Post
What bitrates did you test?

I'm guessing it shold show some difference for music @ 64-160kps stereo, but I haven't done any tests for DDP myself.

EBU testing https://tech.ebu.ch/docs/tech/tech3324.pdf (p21) has shown DDP 256kps almost matches DD 384kps on surround, but this is on professional encoders.
I've tested 192 kbpps - 256kbps - 384kbps

No difference that I can hear at least, after lots of ABX, comparing ffmpeg's AC3 vs. EAC3 at same birate.

This implementation of EAC3 offers nothing like what that EBU test shown in 2007, rendering useless for my needs (5.1 channels).

So I was wondering if someone can confirm my results... if someone here is using ffmpeg and not dolby encoder engine or similar commercial encoders.

Last edited by bokeron2020; 7th September 2021 at 06:05.
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 07:55   #4  |  Link
junh1024
Registered User
 
Join Date: Mar 2011
Posts: 59
Quote:
Originally Posted by bokeron2020 View Post
I've tested 192 kbpps - 256kbps - 384kbps
Too high. You need to go lower.

DD vs DDP is roughly anagulous to AAC & HE-AAC, and like all lossy codecs, comparisons are useless if the bitrate is too high.
junh1024 is offline   Reply With Quote
Old 7th September 2021, 08:47   #5  |  Link
richardpl
Registered User
 
Join Date: Jan 2012
Posts: 272
Isn't this about >6 channel support in EAC3 encoder?
richardpl is offline   Reply With Quote
Old 7th September 2021, 10:31   #6  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by richardpl View Post
Isn't this about >6 channel support in EAC3 encoder?
Nope, is just quality comparation between 5.1 AC3 and EAC3 by ffmpeg.

Seems than ffmpeg only uses eac3 frames type 0 (eac3 independent, for that the bitrate is limited to 6144 Kb/s at 48 KHz, with 256 samples per frame with a max size of 4096 bytes).

It not use dependent frames, for that is limited to 5.1 and others (more bitrate, channels and programs).

And it not use frames type 2 (AC3 encoded) for that it can't be used for BD tracks than need embedded AC3.

The question is if the EAC3 encoder have better quality at same size than AC3 like Dolby claim in their encoder.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 7th September 2021, 12:48   #7  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
Quote:
Originally Posted by tebasuna51 View Post
Nope, is just quality comparation between 5.1 AC3 and EAC3 by ffmpeg.

Seems than ffmpeg only uses eac3 frames type 0 (eac3 independent, for that the bitrate is limited to 6144 Kb/s at 48 KHz, with 256 samples per frame with a max size of 4096 bytes).

It not use dependent frames, for that is limited to 5.1 and others (more bitrate, channels and programs).

And it not use frames type 2 (AC3 encoded) for that it can't be used for BD tracks than need embedded AC3.

The question is if the EAC3 encoder have better quality at same size than AC3 like Dolby claim in their encoder.
Looking at the code, ffmpeg's E-AC-3 encoder has Adaptive Hybrid Transform, Spectral Extension and Transient Pre-noise processing implemented. So I assume it has a benefit over AC-3 but at pretty low bitrates
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 7th September 2021, 15:12   #8  |  Link
Richard1485
Guest
 
Posts: n/a
Yeah, to hear much improvement with E-AC-3, you have to set the bitrate lower. In my view, it's not worth sacrificing AC-3's greater compatibility for a modest reduction in file-size and/or (at sane bitrates) a negligible increase in quality, especially given that ffmpeg's AC-3 encoder is so good these days. If you're interested only in playback via PC, you might as well use AAC instead.
  Reply With Quote
Old 7th September 2021, 18:50   #9  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by junh1024 View Post
Too high. You need to go lower.

DD vs DDP is roughly anagulous to AAC & HE-AAC, and like all lossy codecs, comparisons are useless if the bitrate is too high.
Going lower than 192 with ffmpeg's implementation is downright awful for DD or DDP.
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 19:06   #10  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by Richard1485 View Post
Yeah, to hear much improvement with E-AC-3, you have to set the bitrate lower. In my view, it's not worth sacrificing AC-3's greater compatibility for a modest reduction in file-size and/or (at sane bitrates) a negligible increase in quality, especially given that ffmpeg's AC-3 encoder is so good these days. If you're interested only in playback via PC, you might as well use AAC instead.
According to the lonely EBU test of old, improvements should be noticeable at 256 and higher, too. But apparently not if using ffmpeg's implementation.
I suppose a commercial encoder would fare a lot better at any given bitrate.

AAC isn't well supported for multichannel audio in hardware players/decoders. I'm aiming for such compatibility... and I don't know where the market will go regarding AAC but Dolby/DTS are still dominant and churning out AC3/DTS centered tecghnologies.
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 19:11   #11  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by microchip8 View Post
Looking at the code, ffmpeg's E-AC-3 encoder has Adaptive Hybrid Transform, Spectral Extension and Transient Pre-noise processing implemented. So I assume it has a benefit over AC-3 but at pretty low bitrates
Applying phase cancellation shows some minor differences at any useable bitrate. For 5.1 channels, going lower than 192kbps for anything but voice ends in a poltergeist-like event.
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 19:22   #12  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by richardpl View Post
Isn't this about >6 channel support in EAC3 encoder?
If you mean EAC3 allows more than 5.1 channel... then that may be the only difference with AC3 in ffmpeg.

What I'm experiencing and testing is ffmpeg's EAC3 performing at roughly the same level of quality than AC3... and that should not be the case. EBU 2007 tests show DD+ being superior.

So I'm here trying to find confirmation to my findings so I can be sure I am really hearing what I think I hear, ie, no difference.
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 19:23   #13  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
Quote:
Originally Posted by bokeron2020 View Post
Applying phase cancellation shows some minor differences at any useable bitrate. For 5.1 channels, going lower than 192kbps for anything but voice ends in a poltergeist-like event.
You haven't told us anything about the equipment your using for the test and how well your ears can spot a difference.
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 7th September 2021, 20:25   #14  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by microchip8 View Post
You haven't told us anything about the equipment your using for the test and how well your ears can spot a difference.
Equipment:
- Beyerdynamic DT-1770 Pro headphones
- Sabaj D5 DAC
- foobar2000 ABX plugin
- Audacity for phase cancellation check.
- My ears: 10-16800Hz range @10dB, can ABX FLAC/Stereo MP3 @-V1 or CBR 256 / AC3 5.1 @ 640 from 448 (not easily, I mean, I can but I have to focus heavily on artifacts)

Phase cancellation tests are objective. Subjectively speaking the objective results show no big difference.
So my ABX tests and phase cancellation seem to point the same way.

Last edited by bokeron2020; 7th September 2021 at 21:58.
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 20:29   #15  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
Quote:
Originally Posted by bokeron2020 View Post
Equipment:
- Beyerdynamic DT-1770 Pro headphones
- Sabaj D5 DAC
- foobar2000 ABX plugin
- Audacity for phase cancellation check.
- My ears: 10-16800Hz range @10dB, can ABX FLAC/Stereo MP3 @-V1 or CBR 256 / AC3 5.1 @ 640 from 448

Phase cancellation tests are objective. Subjectively speaking the objective results show no big difference.
OK

IIRC, AC-3 and E-AC-3 are not meant to be used below 192 kbps for 5.1 audio. That's meant for AC-4 according to a few things I read about it.

You can try 224 or 320 kbps for both AC-3 and E-AC-3 @ 5.1. See if you spot something
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 7th September 2021, 20:59   #16  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by bokeron2020 View Post
I've tested 192 kbpps - 256kbps - 384kbps
The old AC3 encoder Sonic Foundry apply by default for 5.1, 48 KHz:

Code:
Bitrate Bandwidth
 Kb/s     KHz
------- ---------
  224     9.05
  256    12.42
  320    15.80
  384    18.05
  448    20.30
192 can't be used for 5.1
I can't recommend less than 384 Kb/s for 5.1
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 7th September 2021, 21:40   #17  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by microchip8 View Post
OK

IIRC, AC-3 and E-AC-3 are not meant to be used below 192 kbps for 5.1 audio. That's meant for AC-4 according to a few things I read about it.

You can try 224 or 320 kbps for both AC-3 and E-AC-3 @ 5.1. See if you spot something
I did it.
As tebasuna51 just quoted, I tested 192, 256 and 384 kbps.
My results show that, at every bitrate, EAC3 ≈ AC3 quality-wise.


Quote:
Originally Posted by tebasuna51 View Post
The old AC3 encoder Sonic Foundry apply by default for 5.1, 48 KHz:
Code:
Bitrate Bandwidth
 Kb/s     KHz
------- ---------
  224     9.05
  256    12.42
  320    15.80
  384    18.05
  448    20.30
192 can't be used for 5.1
I can't recommend less than 384 Kb/s for 5.1
From https://developer.dolby.com/technolo...-digital-plus/
Quote:
5.1-ch audio in Dolby Digital Plus is typically encoded at bitrates between 192-256 kbps
In my tests with ffmpeg's encoders 192kbps sounds really bad. Apparently one difference with Dolby licensed encoders is they cut off high frequencies as you've shown, while ffmpeg doesn't do it and/or can be modified with -cutoff.

I tested with and without cutoff, though. Same settings, similar results from AC3 or EAC3.
Therefore I can only conclude that while ffmpeg's AC3 may be close or equal to commercial encoders, their EAC3 is way behind.


I don't have the knowledge to understand ffmpeg's source code so it would be great if someone who can could explain it or disprove it... and, complementary to this, someone who knows what the stance of the developers is about this codec could shed some light on why is apparently subpar yet.

Last edited by bokeron2020; 7th September 2021 at 21:45.
bokeron2020 is offline   Reply With Quote
Old 7th September 2021, 22:25   #18  |  Link
Richard1485
Guest
 
Posts: n/a
Quote:
Originally Posted by bokeron2020 View Post
According to the lonely EBU test of old, improvements should be noticeable at 256 and higher, too. But apparently not if using ffmpeg's implementation.
I suppose a commercial encoder would fare a lot better at any given bitrate.
Yeah, the official Dolby encoder still beats ffmpeg's AC-3 encoder, but the latter has been in development for so long now that the difference in quality isn't worth worrying about, whereas the E-AC-3 encoder still lags behind the commercial equivalent.
Quote:
Originally Posted by bokeron2020 View Post
AAC isn't well supported for multichannel audio in hardware players/decoders. I'm aiming for such compatibility... and I don't know where the market will go regarding AAC but Dolby/DTS are still dominant and churning out AC3/DTS centered technologies.
Exactly, which is why I mentioned AAC only in the context of playback via PC. For compatibility with stand-alone players, AC-3 is the way to go: 5.1@640kbps sounds so good that switching to E-AC3 isn't worth the modest space saving or quality improvement. AFAIK, ffmpeg's E-AC-3 encoder still doesn't produce BD-compatible encodes.
  Reply With Quote
Old 7th September 2021, 22:46   #19  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,340
The main reason E-AC3 was added to FFmpeg was that it allows flexible bitrate values (including a higher maximum), and not just the pre-defined presets AC3 uses. New E-AC3 coding tools are not actually implemented, unless required by the bitstream.
Due to some coding improvements its minimally better then AC3 at any given bitrate, but probably not even measurable.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 8th September 2021, 00:21   #20  |  Link
bokeron2020
Registered User
 
Join Date: Aug 2021
Location: Sea of Doubts
Posts: 28
Quote:
Originally Posted by nevcairiel View Post
The main reason E-AC3 was added to FFmpeg was that it allows flexible bitrate values (including a higher maximum), and not just the pre-defined presets AC3 uses. New E-AC3 coding tools are not actually implemented, unless required by the bitstream.
Due to some coding improvements its minimally better then AC3 at any given bitrate, but probably not even measurable.
I guess that answers the question conclusively. Thank you.

I suppose there are no plans to improve it as developers seem to have other priorities/interests. I'll use what's available then.
bokeron2020 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 09:29.


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