View Single Post
Old 7th January 2004, 22:49   #6  |  Link
KpeX
Registered User
 
KpeX's Avatar
 
Join Date: Jun 2003
Location: Great Lakes, USA
Posts: 1,433
Dolby Digital/AC3 FAQ [And DD+/EAC3]


General AC3 Procedures Questions

1. What is AC3? Dolby Digital?

AC3, Dolby Digital, Dolby Surround AC3, A/52, and Audio Coding version 3 are all names for the same general purpose lossy encoded audio format developed by Dolby Laboratories. AC3 is most commonly used in 5.1 channel form and is the successor of Dolby Pro Logic, the difference being that AC3 carries 6 discrete channels whereas Pro Logic had matrixed surround channels. AC3 has great popularity, and is used in LaserDisc and DVD formats at 384-448 kbps and also quite commonly in cinema, usually at 640 kbps.

[Dolby Digital Plus is a improvement for more quality, bitrate, channels, programs and also the Atmos system to obtain surround 3D with specifics AVR's.]

2. How can I transcode/encode AC3? Are there any freeware encoders?

Sonic Foundry Soft Encode, one of the most popular AC3 encoders, is no longer developed, the AC3 encoder is now available as a plugin for Sonic Foundry's Acid.

Surcode also sells several good AC3 and DTS encoding softwares.

Of the several commercial encoders available, all known commercial encoders are based on the Dolby software encoder. SonicFoundry SoftEncode and other older AC3 encoders use Dolby v 6.6.2, newer encoders such as the SonicFoundry Acid plugin use Dolby v 7.

The only free encoder is part of the ffmpeg project and is generally considered to be not as high quality as a commercial encoder using the Dolby libraries. However, incompatibilities with AC3 specs should be solved now, and using BeSweet 1.5b26 or later is a good choice for free, multichannel AC3 encoding.

It’s not recommended to transcode a 5.1 AC3 file below 224kbps due to quality degradation.

[Now ffmpeg AC3 encoder have enough quality to be used without troubles, but like EAC3 have still some limitations, of course without Atmos improvement]

2b. What about AC3 encoding under linux/*nix?

FFmpeg, a native linux application, supports AC3 encoding via libavcodec, as does mplayer, vlc, and other libavcodec-based apps. An AC3 transcoding example commandline is:
Code:
ffmpeg -i input.ac3 -acodec ac3 -ac 6 -ab 256 output.ac3
3. What's the difference between normalization and dynamic range compression?

Normalization applies gain to all the audio, essentially multiplying everything by a common factor in order to max out the use of the 16 bits you have in most wav files. Normalization preserves the dynamics of the original recording, meaning that the relationship between loud and soft stays the same, except that everything is now louder by the same factor.

Dynamic range compression basically amplifies softer parts more than louder parts, to bring soft and loud closer together and lessen the contrast between, say, explosions and background music.

[Both concepts, Dialog Normalization (DN) and Dynamic Range Compression (DRC) was introduced by Dolby with good intentions but with bad results, because other sources go to inverse direction (see Loudness war).
To compete in volume with other sources I recommend supress the DN attenuation (like eac3to and other tools do) included in the AC3 metadata.
And ignore the DRC metadata info (than some encoders include, not ffmpeg) to avoid lose quality when decode: use always -dsc_scale 0
The moderns AVR's have enough capacity to apply 'Night mode', or equivalent, on the fly when it is necesary]

4. Where can I get some comprehensive information on encoding AC3?

There is an excellent guide available courtesy of SomeJoe.

[Like I say before I can't recommend to be Dolby compliant because other sources aren't (Audio CD's, commercials in TV), the best option is encode without DN and DRC like other codecs do (DTS, MP3, AAC, Opus, FLAC,...)]

5. How can i join AC3 files?

Let's say you want to join stream1.ac3,stream2.ac3,stream3.ac3 into stream.ac3.
create a listfile. join.lst:
stream1.ac3
stream2.ac3
stream3.ac3

Use BeSplit :
Code:
BeSplit -core( -input join.lst -output stream.ac3 -type ac3 -join )
[AC3, like other streams with a header in each frame (DTS, AAC) can be joined with a simple binary copy:
copy /B stream1.ac3 + stream2.ac3 + stream3.ac3 full_output.ac3
Of course the output is only valid if the parts have the same Bitrate, Samplerate and Channels]

6. What can I do if I'm having trouble adding an AC3 file to a DVD project?

First try fixing it with BeSplit. If there is still a problem, it could be a VBR AC3 that your authoring program doesn't support so reencode it to CBR (see Q#2 for AC3 encoders).

[Sometimes an AC3 stream is invalid whith fragments a different bitrate/channels.

I make a tool (LeeAudBi) to detect errors, to work with the attached one you need the autoit3 package installed to interpret the .au3 files.
If you want the compiled exe you need download it from here (to big to be attached).

There are also other tools to split fragments stereo from multichannel typical from AC3 TV capture.

And tools to modify Dialog Normalization (AC3 or EAC3) or set the AC3 flag DPL encoded.

Finally WavSplit (in channels) and WavFix (to repair WAV headers)]
Attached Files
File Type: 7z AC3Util.7z (92.7 KB, 344 views)
File Type: 7z Wav2Util.7z (15.3 KB, 267 views)
File Type: 7z LeeAudBi7i.7z (72.2 KB, 428 views)

Last edited by tebasuna51; 4th October 2021 at 03:48. Reason: update
KpeX is offline