项目作者: indiscipline

项目描述 :
Command line helper for performing linear audio loudness normalization using ffmpeg's loudnorm audio filter.
高级语言: Rust
项目地址: git://github.com/indiscipline/ffmpeg-loudnorm-helper.git
创建时间: 2019-10-15T15:49:47Z
项目社区:https://github.com/indiscipline/ffmpeg-loudnorm-helper

开源协议:Other

下载


" class="reference-link">ffmpeg-loudnorm-helper ffmpeg-loudnorm-helper logo

License

Command line helper for performing audio loudness normalization with ffmpeg’s loudnorm[^1] audio filter.

Performs the loudness scanning pass of the given file and outputs the string of desired loudnorm options to be included in ffmpeg arguments. This automates the two-pass workflow that is necessary for the loudnorm filter to apply a uniform linear normalization that is desirable for keeping the original audio dynamics intact.

This program is a simpler alternative to the ffmpeg-normalize Python script.

Requirements

The program relies on ffmpeg of version >= 3.1 for its functions and expects it to be accessible from the environment.

Output of the --resample option implies ffmpeg is compiled with the SOX resampler support (libsoxr), though it is only printed and never executed.

Usage

Summary: Perform a single pass with ffmpeg-lh input.wav or use command substitution to combine both passes.

ffmpeg-loudnorm-helper is designed to work using your shell’s command substitution capability. It launches an ffmpeg instance to measure the original audio loudness and then outputs the properly formatted copy-pasteable audio filter string to perform the required normalization. If the requested loudness target is provably unattainable with linear normalization, the program will warn the user. However, loudnorm is a bit picky, so there’s no guarantee it will not fall back onto dynamic normalization.

Full help available with the --help switch.

Bash example

  1. ffmpeg -i input.mov -c:v copy -c:a libopus $(ffmpeg-lh input.mov) normalized.mkv

Windows CMD example

  1. for /f "tokens=*" %i in ('ffmpeg-lh input.mov') do ffmpeg -i input.mov -c:v copy -c:a libopus %i normalized.mkv

How to build

Developed with stable Rust with the minimal number of direct dependencies (Serde and clap).

To build the program, go to the project directory and run:

  1. $ cargo build --release

The executable will be located at target/release/ffmpeg-lh.

Contributing

The project is open for contributions. Open an issue for bugs, ideas and feature requests.

License

ffmpeg-loudnorm-helper is licensed under GNU General Public License version 3;

See LICENSE.md for full details.


[^1]: An informative description of the filter’s inner-workings by its author, Kyle Swanson.