GithubHelp home page GithubHelp logo

audio-encoding-kit's Introduction

General requirements

  • ffmpeg
  • ffprobe

Codec-specific requirements

Codec Encoder
AC-3 (DD) Dolby Encoding Engine
E-AC-3 (DD+) Dolby Encoding Engine
TrueHD Dolby Encoding Engine
AAC qaac
FLAC ffmpeg
Opus ffmpeg /w libopus

Installation

git clone https://github.com/vevv/eat
cd eat
pip install .

pip install -e . can be used instead for an editable instance (see: https://stackoverflow.com/a/35064498)

  • run eat with no params to generate an example config in ~/.eat/config.toml.example

Configuration

Binary paths in config should only need to be specified if binary is not in PATH, but they might be necessary if you're using Wine or WSL.

To use with Wine (for DEE/qaac), please ensure wine-binfmt is installed, the binaries are set as executable, and you're launching eat with the correct Wine prefix.

WSL is untested, but I don't anticipate any issues.

Usage

usage: eat [-h] [-v] [-i [INPUT ...]] [-o OUTPUT_DIR] [-f [{dd,ddp,thd,opus,flac,aac} ...]] [-b BITRATE]
           [-m {1,2,6,8}] [--sample-rate {44100,48000,96000}] [--bit-depth {16,24}] [-y] [-d]

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         shows version
  -i [INPUT ...], --input [INPUT ...]
                        audio file(s)
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        output directory (default: cwd)
  -f [{dd,ddp,thd,opus,flac,aac} ...], --format [{dd,ddp,thd,opus,flac,aac} ...]
                        output codec
  -b BITRATE, -q BITRATE, --bitrate BITRATE
                        output bitrate (quality value for aac) for lossy codecs
  -m {1,2,6,8}, --mix {1,2,6,8}
                        specify down/upmix, support varies by codec (default: none)
  --sample-rate {44100,48000,96000}
                        change output sample rate (FLAC only)
  --bit-depth {16,24}, --bitdepth {16,24}
                        change output bit depth (FLAC only)
  -y, --allow-overwrite
                        allow file overwrite
  -d, --debug           Print debug statements

Default bitrates

Channels AC-3 (DD) E-AC-3 (DD+) Opus AAC
1 128 kbps 128 kbps 96 kbps -V127
2 224 kbps 224 kbps 160 kbps -V127
6 640 1024 kbps 384 kbps -V127
8 N/A 1536 kbps 512 kbps -V127

AAC

AAC is configured to use TVBR mode rather than ABR/CBR. This means the output param is a value between 0 and 127 rather than a bitrate target. See https://github.com/nu774/qaac/wiki/Encoder-configuration#tvbr-quality-steps for more details.

Like qaac, eat will accept any value, but it'll internally be clamped to one of the following.

0 9 18 27 36 45 54 63 73 82 91 100 109 118 127

Default value is 127, which is the maximum quality, depending on the source it can result in different bitrates, I've seen it go from 192 kbps and under on some lower quality 2.0 sources to ~490 kbps on 7.1. I'd recommend trying 127 first, and if bitrate is too high, going from 127 to 91 and then moving up.

Remixing support

Channels AC-3 (DD) E-AC-3 (DD+) TrueHD Opus FLAC
* -> 1 yes yes no yes no
* -> 2 yes yes no yes no
8 -> 6 yes yes no no no
6 -> 8 N/A yes no no no
1/2 -> 6/8 no no no no no

Remixing is handled by the encoder rather than ffmpeg, as AFAIK it doesn't do it very well.

Examples

  • DD+5.1 1024 kbps: eat -i audio.flac -f ddp -b 1024
  • TrueHD + DD5.1 640 kbps "core": eat -i audio.dts -f thd dd -b 640

Notes

  • Files are processed in order; if multiple formats are passed, each file will be encoded to every format before processing the the next one.
  • Support for layouts other than 1.0, 2.0, 5.1, 7.1 depends on the encoder (DEE will only accept those), it's recommended that user converts them beforehand.
  • 7.1 will automatically be downmixed to 5.1 with DEE for DD.
  • Temp files (including thd.log/thd.mll) are cleaned after each encoding job

TODO

  • Threading support / multiple simultaneous encodes
  • Test with WSL

Credits

Thanks to pcroland for his deew project which was the base for this (originally a fork, ended up rewritten from scratch). DEE xml config files were used verbatim, and some shared functionality has been added later.

audio-encoding-kit's People

Contributors

vevv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.