View Single Post
Old 18th May 2007, 13:45   #1  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
eac3to - audio conversion tool

http://madshi.net/eac3to.zip

[EDIT]New versions here https://www.rationalqm.us/board/viewforum.php?f=18[/EDIT]

Code:
eac3to v3.36, freeware by madshi.net

- can show information about audio, video, VOB/EVO/(M2)TS and MKV files
- can decode and encode various audio formats
- can remove dialog normalization from AC3, E-AC3, DTS and TrueHD tracks
- can extract AC3 stream from Blu-Ray TrueHD/AC3 tracks
- can extract TrueHD stream from Blu-Ray TrueHD/AC3 tracks
- can extract DTS core from DTS-HD tracks
- can remove DTS zero padding and repair outdated DTS-ES headers
- can apply positive or negative audio delays
- can reduce bitdepth of decoded audio data by using TPDF dithering
- can resample decoded audio data (using SSRC or r8brain)
- can apply/reverse PAL speedup on decoded audio data (SSRC/r8brain)
- can demux video / audio tracks of EVO/VOB/(M2)TS and MKV sources
- can list available titles of Blu-Ray and HD DVD discs
- can extract Blu-Ray and HD DVD chapter information and subtitles
- can mux MPEG2, VC-1 and h264 video tracks to Matroska
- can remove pulldown flags from MPEG2, VC-1 and h264 video tracks

eac3to sourcefile[+sourcefile2] [trackno:] [destfile|stdout] [-options]

Examples:
eac3to source.pcm destination.flac
eac3to source.thd destination.flac destination.ac3
eac3to blurayMovieFolder movie.mkv
eac3to source.evo 1: chapters.txt 2: video.mkv 3: audio.flac 5: subtitle.sup
eac3to feature_1.evo+feature_2.evo movie.mkv

Options:
-448               use e.g. "192", "448" or "640" kbps for AC3 encoding
-768               use "768" or "1536" kbps for DTS encoding
-core              extract the DTS core of a DTS-HD track
+/-100ms           apply a positive or negative audio delay
+/-3dB             apply a positive or negative audio gain (volume change)
-0,1,2,3,4,5       remap the channels to the specified order
-edit=0:00:00,0ms  loops or removes audio data at the specified runtime
-silence/-loop     forces usage of silence (or looping) for audio edits
-down6             downmix 7 or 8 channels to 6 channels
-downDpl           downmix multi channel audio to Dolby Pro Logic II
-downStereo        downmix multi channel audio to simple Stereo
-phaseShift        shift phase (when doing stereo downmixing, see "down2")
-mixlfe            mix LFE in (when doing stereo downmixing, see "down2")
-down16            downconvert decoded audio data to 14..23 bit
-slowdown          convert 25.000 and 24.000 content to 23.976 fps
-speedup           convert 23.976 and 24.000 content to 25.000 fps
-23.976/...        define source fps to be "23.976", "24.000", "25.000", ...
-changeTo24.000    change source fps to "23.976", "24.000", "25.000", ...
-resampleTo48000   resample audio to "44100", "48000" or "96000" Hz
-r8brain           use r8brain resampler instead of SSRC
-quality=0.50      Nero AAC encoding quality (0.00 = lowest; 1.00 = highest)
-8                 define PCM file to be "1".."8" channels
-16                define PCM file to be "16" or "24" bit
-little            define PCM file to be "little" or "big" endian
-96000             define PCM file to be 44100, 48000, 96000 or 192000 Hz
-override          forcefully overrides PCM auto detection with manual values
-sonic/nero/...    force the use of a specific decoder (not recommended)
-keepDialnorm      disables dialog normalization removal (not recommended)
-decodeHdcd        decodes HDCD source track (usually 16 -> 20 bit)
-demux             demuxes 1st video track and all audio and subtitle tracks
-stripPulldown     strips the pulldown from MPEG2 video tracks
-keepPulldown      disable removal of pulldown for MPEG2, h264 and VC-1 tracks
-seekToIFrames     make all h264/AVC "I" frames seekable
-check             checks if the source EVO/(M2)TS file is clean.
-test              checks if the external filters are installed & working
-lowPriority       moves processing to background/idle priority
-shutdown          automatically shutdown the PC after processing is done

Supported source formats:
(1) RAW, (L)PCM
(2) WAV (PCM, DTS and AC3), W64, RF64
(3) AC3, E-AC3
(4) DTS, DTS-ES, DTS-96/24, DTS-HD Hi-Res, DTS-HD Master Audio
(5) MP1, MP2, MP3 audio
(6) AAC audio
(7) MLP, TrueHD, TrueHD/AC3
(8) FLAC
(9) EVO/VOB/(M2)TS and MKV

Decoded audio data can be stored as / encoded to:
(1) RAW, (L)PCM
(2) WAV (PCM only), W64, RF64, AGM
(3) WAVs (multiple mono WAV files, PCM only)
(4) AC3
(5) DTS
(6) AAC
(7) FLAC

For best AAC decoding you need:
(1) Nero 7 (Nero 8 won't work!)

For DTS encoding you need:
(1) SurCode DVD DTS - version 1.0.21 or newer

For AAC encoding you need:
(1) Nero AAC Encoder

For video muxing you need:
(1) Haali Matroska Muxer
wiki:

Not written by me, not finished yet, but definitely worth a look:

http://en.wikibooks.org/wiki/Eac3to

bug tracker:

http://eac3to.bugs.madshi.net

GUIs:

If you prefer a graphical user interface, here are three choices (not written by me):

Eac3to and More GUI:
http://forum.doom9.org/showthread.php?t=135095

HD DVD/Blu-Ray Stream Extractor:
http://forum.doom9.org/showthread.php?t=141829

Clown BD:
https://www.videohelp.com/software/Clown-BD

eac3to µGUI:
Link don't work, GUI obsolete[www homecinema-hd com/index.php?page=eac3tougui&lang=en_US]

links:

arcsoft: http://www.arcsoft.com
dcadec: https://github.com/foo86/dcadec [Recommended replace the libdcadec.dll from the eac3to package with the updated v2.0 in the link]
nero: http://www.nero.com
NeroAacEnc: https://web.archive.org/web/20160923...odec-1.5.1.zip
sonic: http://www.sonic.com
dts: http://www.surcode.com
libav: http://www.mplayerhq.hu [The avcodec-54 and avutil-52 can't be replaced by new ones (now 59/58)]
aften: http://win32builds.sourceforge.net/aften/index.html
flac: http://sourceforge.net/project/showf...ckage_id=12675[you can replace the libFLAC.dll with the 1.4.2 (2022-10-22) last version from here (rename the 32 bits libFLAC_dynamic.dll)]
r8brain: http://www.voxengo.com/product/r8brain
haali: http://haali.cs.msu.ru/mkv
mkvtoolnix: http://www.bunkus.org/videotools/mkvtoolnix

WARNING:

Nero 8 won't work for eac3to cause Nero 8 doesn't allow its DirectShow filters to be used from outside of Nero ShowTime. Nero 9 is currently not supported, either. So please use/install Nero 7 if you want to use Nero DirectShow filters in eac3to.

background information:

Please note that there are three common problems with "properly" decoding compressed audio tracks. The first problem has to do with that the purpose of a media player is different than the purpose of people like us who want to reencode audio tracks. A media player may want to adjust volume levels to specific parameters and circumstances. We reencoders absolutely want to avoid any processing on the precious audio data. This is a conflict which can not always be solved. The three known problems are:

(1) Some decoders apply DRC (Dynamic Range Compression). Stupidly Dolby's license requests that DRC must be applied, unless your decoder has an option to turn it on/off. Only then the decoder is allowed to not apply DRC. The purpose of DRC is to limit the dynamic range of an audio track, mainly to not annoy neighbours or to accomodate to noisy living room conditions. For our purposes DRC is catastrophic.
(2) Some decoders forcefully downconvert to 16bit, or raise volume for unknown reasons or do other stupid stuff.
(3) Some decoders don't make use of the full available information, but just extract and decode the "core" of the compressed audio data, which obviously results in less than optimal audio quality.

evaluation of available decoders:

The Sonic (E-)AC3 decoder forcefully applies DRC. As a result I do not recommend to use the Sonic (E-)AC3 decoder. The current version of the Sonic TrueHD decoder doesn't work properly at all. The Sonic DTS decoder is good for DTS, DTS-ES, DTS-96/24, DTS-HD Master Audio and DTS-HD High Resolution tracks. It's quite slow, though and it decodes DTS-HD 7.1 tracks only as 5.1. Most DTS-ES and DTS-HD Master Audio 6.1 tracks are fully decoded as 6.1, though. The Nero TrueHD decoder is working perfectly fine, but is limited to 5.1 channels. The Nero (E-)AC3 works fine for most audio tracks, but sometimes DRC is still enabled, so it's not really recommended. The Nero DTS decoder ignores the additional DTS-HD information and only decodes the DTS core. The Cyberlink decoders always only output 16bit and can't be used outside of PowerDVD. So they currently do not make a lot of sense for eac3to. The libav/ffmpeg (E-)AC3 decoder works really well, but don't support 7.1 decoding yet. The libav/ffmpeg DTS decoder works well, too, but currently ignores the additional DTS-HD information, so especially DTS-HD Master Audio can't be decoded in full quality. The libav/ffmpeg TrueHD decoder works perfectly fine including full 7.1 decoding. The ArcSoft DTS decoder works well for DTS and DTS-HD decoding, but decodes many 7.1 tracks either incorrectly or with forced processing/mixing. It does support every format and channel configuration, though. The ArcSoft TrueHD and ArcSoft (E-)AC3 decoders are currently not supported by eac3to. The dcadec decoder works great for all kinds of DTS formats and channel configurations, except LBR/XSA (low bitrate) content is not properly supported yet.

default decoders used by eac3to:

AAC: Nero
MP1, MP2, MP3: libav/ffmpg
(E-)AC3: libav/ffmpeg
TrueHD: libav/ffmpeg
DTS(-HD): dcaDec
DTS-LBR/XSA: ArcSoft

making the ArcSoft DTS decoder work in eac3to:

Sometimes the ArcSoft DTS decoder doesn't work even after you've installed the full retail software. This can usually be fixed by manually adding the ArcSoft "Bin" folder (e.g. "C:\Program Files\Common Files\ArcSoft\Bin") to your environment path. If you don't know how to do this, google "environment path".

Don't ask for pirated versions of ArcSoft, Nero, Sonic and Surcode. You should buy those.

EDIT (2016-02-13 and later) by tebasuna51:
At this moment only Nero 7 DirectShow are needed to decode AAC, ArcSoft and Sonic are not needed at all (libdcadec and libav can do the job).
There are troubles decoding some new implementations of EAC3, then for decode AAC and EAC3 is better use a modern version of ffmpeg.
And Surcode can be replaced by the experimental ffdcaenc encoder to dts like you can see after

In addition to eac3to audio outputs: PCM, AC3 (libAften), DTS (Surcode), AAC (NeroAacEnc M4A) and FLAC (libFLAC), you can use the eac3to stdout to pipe PCM to any encoder than support stdin.

Generic syntax:

eac3to INPUT stdout.wav [-EAC3TO_PARAMETERS] | ENCODER PARAMETERS - OUTPUT

Where:
- INPUT, ENCODER and OUTPUT must be in quotted full paths if aren't at same folder than eac3to.
- INPUT can be any supported audio file or a track from a supported container: "D\tmp\input.mkv" 2:
- PARAMETERS can be any supported encoder parameters.
- The order of: PARAMETERS - OUTPUT, can be different for some encoders. See examples below.

You can use also Aften.exe, NeroAacEnc.exe and Flac.exe encoders to override eac3to defaults.
Also you can use other soft to filter output: eac3to INPUT stdout.wav | sox ... | encoder ...
Some tested examples:

eac3to INPUT stdout.wav | Lame -V 2 - output.mp3
eac3to INPUT stdout.wav | TwoLame -b 192 - output.mp2 (Twolame v0.3.10b)
eac3to INPUT stdout.wav | ffdcaenc -i - -o output.dts -l -b 1509.75
eac3to INPUT stdout.wav | OggEnc2 -q 3 --ignorelength -o output.ogg -
eac3to INPUT stdout.wav | opusenc --ignorelength --bitrate 128 - output.opus
eac3to INPUT stdout.wav | qaac -V 99 --ignorelength --adts --no-delay -o output.aac -
eac3to INPUT stdout.wav | fhgaacenc --vbr 5 --ignorelength - output.m4a
eac3to INPUT stdout.wav | NeroAacEnc -br 192000 -he -ignorelength -if - -of output.m4a
eac3to INPUT stdout.wav | Flac -5 --ignore-chunk-sizes -o output.flac -
eac3to INPUT stdout.wav | Aften -b 640 -pad 0 -readtoeof 1 -exps 32 -s 1 - output.ac3
eac3to INPUT stdout.w64 | ffmpeg -i - -c:a ac3 -b:a 640k -center_mixlev 0.707 output.ac3

Note than last ffmpeg example require PCM data with w64 header, the other encoders support wav data greater than 4GB with special parameter -ignorelength or equivalent.
Of course ffmpeg can be used for other supported audio output format, but is highly recommended for AC3 because libAften.dll is outdated and can cause troubles

Last edited by tebasuna51; 23rd December 2023 at 13:06. Reason: New versions
madshi is offline