Normalize audio via ffmpeg
Project description
ffmpeg-normalize
A utility for batch-normalizing audio using ffmpeg.
This program normalizes media files to a certain loudness level using the EBU R128 loudness normalization procedure. It can also perform RMS-based normalization (where the mean is lifted or attenuated), or peak normalization to a certain target level.
Batch processing of several input files is possible, including video files.
A very quick how-to:
- Install a recent version of ffmpeg
- Run
pip3 install ffmpeg-normalize
- Run
ffmpeg-normalize /path/to/your/file.mp4
- Done! 🎧 (the file will be in a folder called
normalized
)
Read on for more info.
Contents:
- Requirements
- Installation
- Usage with Docker
- High LeveL Introduction
- Basic Usage
- Examples
- Detailed Options
- API
- FAQ
- What options should I choose for the EBU R128 filter? What is linear and dynamic mode?
- The program doesn't work because the "loudnorm" filter can't be found
- Should I use this to normalize my music collection?
- Why are my output files MKV?
- I get a "Could not write header for output file" error
- The conversion does not work and I get a cryptic ffmpeg error!
- What are the different normalization algorithms?
- Couldn't I just run
loudnorm
with ffmpeg? - What about speech?
- After updating, this program does not work as expected anymore!
- Can I buy you a beer / coffee / random drink?
- Related Tools and Articles
- Contributors
- License
Requirements
You need Python 3.8 or higher, and ffmpeg.
ffmpeg
- ffmpeg 5.x is required, ffmpeg 6.x is recommended (it fixes a bug for short files)
- Download a static build for your system
- Place the
ffmpeg
executable in your$PATH
, or specify the path to the binary with theFFMPEG_PATH
environment variable inffmpeg-normalize
For instance, under Linux:
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
mkdir -p ffmpeg
tar -xf ffmpeg-release-amd64-static.tar.xz -C ffmpeg --strip-components=1
sudo cp ffmpeg/ffmpeg /usr/local/bin
sudo cp ffmpeg/ffprobe /usr/local/bin
sudo chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe
For Windows, follow this guide.
For macOS and Linux, you can also use Homebrew:
brew install ffmpeg
Note that using distribution packages (e.g., apt install ffmpeg
) is not recommended, as these are often outdated.
Installation
For Python 3 and pip:
pip3 install ffmpeg-normalize
Or download this repository, then run pip3 install .
.
To later upgrade to the latest version, run pip3 install --upgrade ffmpeg-normalize
.
Usage with Docker
You can use the pre-built image from Docker Hub:
docker run -v "$(pwd):/tmp" -it slhck/ffmpeg-normalize
Alternatively, download this repository and run
docker build -t ffmpeg-normalize .
Then run the container with:
docker run -v "$(pwd):/tmp" -it ffmpeg-normalize
This will mount your current directory to the /tmp
directory inside the container. Everything else works the same way as if you had installed the program locally. For example, to normalize a file:
docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /tmp/yourfile.mp4 -o /tmp/yourfile-normalized.wav
You will then find the normalized file in your current directory.
High LeveL Introduction
Please read this section for a high level introduction.
What does the program do?
The program takes one or more input files and, by default, writes them to a folder called normalized
, using an .mkv
container. All audio streams will be normalized so that they have the same (perceived) volume according to the EBU R128 standard. This is done by analyzing the audio streams and applying a filter to bring them to a target level. Under the hood, the program uses ffmpeg's loudnorm
filter to do this.
How do I specify the input?
Just give the program one or more input files as arguments. It works with most media files, including video files.
How do I specify the output?
You don't have to specify an output file name (the default is normalized/<input>.mkv
), but if you want to override it, you can specify one output file name for each input file with the -o
option. In this case, the container format (e.g. .wav
) will be inferred from the file name extension that you've given.
Example:
ffmpeg-normalize 1.wav 2.wav -o 1-normalized.wav 2-normalized.wav
Note that if you don't specify the output file name for an input file, the container format will be MKV, and the output will be written to normalized/<input>.mkv
. The reason for choosing the MKV container is that it can handle almost any codec combination.
Using the -ext
option, you can supply a different output extension common to all output files, e.g. -ext m4a
. However, you need to make sure that the container supports the codecs used for the output (see below).
What will get normalized?
By default, all streams from the input file will be written to the output file. For example, if your input is a video with two language tracks and a subtitle track, both audio tracks will be normalized independently. The video and subtitle tracks will be copied over to the output file.
How will the normalization be done?
The normalization will be performed according to the EBU R128 algorithm with the loudnorm
filter from FFmpeg, which was originally written by Kyle Swanson. It will bring the audio to a specified target level. This ensures that multiple files normalized with this filter will have the same perceived loudness.
What codec is chosen?
The default audio encoding method is uncompressed PCM (pcm_s16le
) to avoid introducing compression artifacts. This will result in a much higher bitrate than you might want, for example if your input files are MP3s.
Some containers (like MP4) also cannot handle PCM audio. If you want to use such containers and/or keep the file size down, use -c:a
and specify an audio codec (e.g., -c:a aac
for ffmpeg's built-in AAC encoder).
Basic Usage
Supply one or more input files, and optionally, output file names:
ffmpeg-normalize input [input ...][-h][-o OUTPUT [OUTPUT ...]] [options]
Example:
ffmpeg-normalize 1.wav 2.wav -o 1-normalized.m4a 2-normalized.m4a -c:a aac -b:a 192k
For more information on the options ([options]
) available, run ffmpeg-normalize -h
, or read on.
Examples
Read the examples on the wiki.
Detailed Options
File Input/Output
-
input
: Input media file(s) -
-o OUTPUT [OUTPUT ...], --output OUTPUT [OUTPUT ...]
: Output file names.Will be applied per input file.
If no output file name is specified for an input file, the output files will be written to the default output folder with the name
<input>.<ext>
, where<ext>
is the output extension (see-ext
option).Example:
ffmpeg-normalize 1.wav 2.wav -o 1n.wav 2n.wav
-
-of OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER
: Output folder (default:normalized
)This folder will be used for input files that have no explicit output name specified.
General
-
-f, --force
: Force overwrite existing files -
-d, --debug
: Print debugging output -
-v, --verbose
: Print verbose output -
-q, --quiet
: Only print errors -
-n, --dry-run
: Do not run normalization, only print what would be done -
-pr
,--progress
: Show progress bar for files and streams -
--version
: Print version and exit
Normalization
-
-nt {ebu,rms,peak}, --normalization-type {ebu,rms,peak}
: Normalization type (default:ebu
).EBU normalization performs two passes and normalizes according to EBU R128.
RMS-based normalization brings the input file to the specified RMS level.
Peak normalization brings the signal to the specified peak level.
-
-t TARGET_LEVEL, --target-level TARGET_LEVEL
: Normalization target level in dB/LUFS (default: -23).For EBU normalization, it corresponds to Integrated Loudness Target in LUFS. The range is -70.0 - -5.0.
Otherwise, the range is -99 to 0.
-
-p, --print-stats
: Print loudness statistics for both passes formatted as JSON to stdout.
EBU R128 Normalization
-
-lrt LOUDNESS_RANGE_TARGET, --loudness-range-target LOUDNESS_RANGE_TARGET
: EBU Loudness Range Target in LUFS (default: 7.0).Range is 1.0 - 50.0.
-
--keep-loudness-range-target
: Keep the input loudness range target to allow for linear normalization. -
--keep-lra-above-loudness-range-target
: Keep input loudness range above loudness range target.LOUDNESS_RANGE_TARGET
for input loudness range<= LOUDNESS_RANGE_TARGET
or- keep input loudness range target above
LOUDNESS_RANGE_TARGET
.
as alternative to
--keep-loudness-range-target
to allow for linear normalization. -
-tp TRUE_PEAK, --true-peak TRUE_PEAK
: EBU Maximum True Peak in dBTP (default: -2.0).Range is -9.0 - +0.0.
-
--offset OFFSET
: EBU Offset Gain (default: 0.0).The gain is applied before the true-peak limiter in the first pass only. The offset for the second pass will be automatically determined based on the first pass statistics.
Range is -99.0 - +99.0.
-
--dual-mono
: Treat mono input files as "dual-mono".If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be perceptually incorrect. If set, this option will compensate for this effect. Multi-channel input files are not affected by this option.
-
--dynamic
: Force dynamic normalization mode.Instead of applying linear EBU R128 normalization, choose a dynamic normalization. This is not usually recommended.
Dynamic mode will automatically change the sample rate to 192 kHz. Use -ar/--sample-rate to specify a different output sample rate.
Audio Encoding
-
-c:a AUDIO_CODEC, --audio-codec AUDIO_CODEC
: Audio codec to use for output files.See
ffmpeg -encoders
for a list.Will use PCM audio with input stream bit depth by default.
-
-b:a AUDIO_BITRATE, --audio-bitrate AUDIO_BITRATE
: Audio bitrate in bits/s, or with K suffix.If not specified, will use codec default.
-
-ar SAMPLE_RATE, --sample-rate SAMPLE_RATE
: Audio sample rate to use for output files in Hz.Will use input sample rate by default, except for EBU normalization, which will change the input sample rate to 192 kHz.
-
-ac
,--audio-channels
: Set the number of audio channels. If not specified, the input channel layout will be used. This is equivalent to-ac
in ffmpeg. -
-koa, --keep-original-audio
: Copy original, non-normalized audio streams to output file -
-prf PRE_FILTER, --pre-filter PRE_FILTER
: Add an audio filter chain before applying normalization.Multiple filters can be specified by comma-separating them.
-
-pof POST_FILTER, --post-filter POST_FILTER
: Add an audio filter chain after applying normalization.Multiple filters can be specified by comma-separating them.
For EBU, the filter will be applied during the second pass.
Other Encoding Options
-
-vn, --video-disable
: Do not write video streams to output -
-c:v VIDEO_CODEC, --video-codec VIDEO_CODEC
: Video codec to use for output files (default: 'copy').See
ffmpeg -encoders
for a list.Will attempt to copy video codec by default.
-
-sn, --subtitle-disable
: Do not write subtitle streams to output -
-mn, --metadata-disable
: Do not write metadata to output -
-cn, --chapters-disable
: Do not write chapters to output
Input/Output Format
-
-ei EXTRA_INPUT_OPTIONS, --extra-input-options EXTRA_INPUT_OPTIONS
: Extra input options list.A list of extra ffmpeg command line arguments valid for the input, applied before ffmpeg's
-i
.You can either use a JSON-formatted list (i.e., a list of comma-separated, quoted elements within square brackets), or a simple string of space-separated arguments.
If JSON is used, you need to wrap the whole argument in quotes to prevent shell expansion and to preserve literal quotes inside the string. If a simple string is used, you need to specify the argument with
-e=
.Examples:
-ei '[ "-f", "mpegts", "-r", "24" ]'
or-ei="-f mpegts -r 24"
-
-e EXTRA_OUTPUT_OPTIONS, --extra-output-options EXTRA_OUTPUT_OPTIONS
: Extra output options list.A list of extra ffmpeg command line arguments valid for the output.
You can either use a JSON-formatted list (i.e., a list of comma-separated, quoted elements within square brackets), or a simple string of space-separated arguments.
If JSON is used, you need to wrap the whole argument in quotes to prevent shell expansion and to preserve literal quotes inside the string. If a simple string is used, you need to specify the argument with
-e=
.Examples:
-e '[ "-vbr", "3", "-preset:v", "ultrafast" ]'
or-e="-vbr 3 -preset:v ultrafast"
-
-ofmt OUTPUT_FORMAT, --output-format OUTPUT_FORMAT
: Media format to use for output file(s).See
ffmpeg -formats
for a list.If not specified, the format will be inferred by ffmpeg from the output file name. If the output file name is not explicitly specified, the extension will govern the format (see '--extension' option).
-
-ext EXTENSION, --extension EXTENSION
: Output file extension to use for output files that were not explicitly specified. (Default:mkv
)
Environment Variables
The program additionally respects environment variables:
-
TMP
/TEMP
/TMPDIR
Sets the path to the temporary directory in which files are stored before being moved to the final output directory. Note: You need to use full paths.
-
FFMPEG_PATH
Sets the full path to an
ffmpeg
executable other than the system default or you can provide a file name available on $PATH
API
This program has a simple API that can be used to integrate it into other Python programs.
For more information see the API documentation.
FAQ
What options should I choose for the EBU R128 filter? What is linear and dynamic mode?
EBU R128 is a method for normalizing audio loudness across different tracks or programs. It works by analyzing the audio content and adjusting it to meet specific loudness targets. The main components are:
- Integrated Loudness (I): The overall loudness of the entire audio.
- Loudness Range (LRA): The variation in loudness over time.
- True Peak (TP): The maximum level of the audio signal.
The normalization process involves measuring these values (input) and then applying gain adjustments to meet target levels (output), typically -23 LUFS for integrated loudness. You can also specify a target loudness range (LRA) and true peak level (TP).
Linear mode applies a constant gain adjustment across the entire audio file. This is generally preferred because:
- It preserves the original dynamic range of the audio.
- It maintains the relative loudness between different parts of the audio.
- It avoids potential artifacts or pumping effects that can occur with dynamic processing.
Dynamic mode, on the other hand, can change the volume dynamically throughout the file. While this can achieve more consistent loudness, it may alter the original artistic intent and potentially introduce audible artifacts (possibly due to some bugs in the ffmpeg filter).
For most cases, linear mode is recommended. Dynamic mode should only be used when linear mode is not suitable or when a specific effect is desired. In some cases, loudnorm
will still fall back to dynamic mode, and a warning will be printed to the console. Here's when this can happen:
-
When the input loudness range (LRA) is larger than the target loudness range: If the input file has a loudness range that exceeds the specified loudness range target, the loudnorm filter will automatically switch to dynamic mode. This is because linear normalization alone cannot reduce the loudness range without dynamic processing (limiting). The
--keep-loudness-range-target
option can be used to keep the input loudness range target above the specified target. -
When the required gain adjustment to meet the integrated loudness target would result in the true peak exceeding the specified true peak limit. This is because linear processing alone cannot reduce peaks without affecting the entire signal. For example, if a file needs to be amplified by 6 dB to reach the target integrated loudness, but doing so would push the true peak above the specified limit, the filter might switch to dynamic mode to handle this situation. If your content allows for it, you can increase the true peak target to give more headroom for linear processing. If you're consistently running into true peak issues, you might also consider lowering your target integrated loudness level.
At this time, the loudnorm
filter in ffmpeg does not provide a way to force linear mode when the input loudness range exceeds the target or when the true peak would be exceeded. The --keep-loudness-range-target
option can be used to keep the input loudness range target above the specified target, but it will not force linear mode in all cases. We are working on a solution to handle this automatically!
The program doesn't work because the "loudnorm" filter can't be found
Make sure you run a recent ffmpeg version and that loudnorm
is part of the output when you run ffmpeg -filters
. Many distributions package outdated ffmpeg versions, or (even worse), Libav's ffmpeg
disguising as a real ffmpeg
from the FFmpeg project.
Some ffmpeg builds also do not have the loudnorm
filter enabled.
You can always download a static build from their website and use that.
If you have to use an outdated ffmpeg version, you can only use rms
or peak
as normalization types, but I can't promise that the program will work correctly.
Should I use this to normalize my music collection?
Generally, no.
When you run ffmpeg-normalize
and re-encode files with MP3 or AAC, you will inevitably introduce generation loss. Therefore, I do not recommend running this on your precious music collection, unless you have a backup of the originals or accept potential quality reduction. If you just want to normalize the subjective volume of the files without changing the actual content, consider using MP3Gain and aacgain.
Why are my output files MKV?
I chose MKV as a default output container since it handles almost every possible combination of audio, video, and subtitle codecs. If you know which audio/video codec you want, and which container is supported, use the output options to specify the encoder and output file name manually.
I get a "Could not write header for output file" error
See the next section.
The conversion does not work and I get a cryptic ffmpeg error!
Maybe ffmpeg says something like:
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Or the program says:
… Please choose a suitable audio codec with the
-c:a
option.
One possible reason is that the input file contains some streams that cannot be mapped to the output file, or that you are using a codec that does not work for the output file. Examples:
-
You are trying to normalize a movie file, writing to a
.wav
or.mp3
file. WAV/MP3 files only support audio, not video. Disable video and subtitles with-vn
and-sn
, or choose a container that supports video (e.g..mkv
). -
You are trying to normalize a file, writing to an
.mp4
container. This program defaults to PCM audio, but MP4 does not support PCM audio. Make sure that your audio codec is set to something MP4 containers support (e.g.-c:a aac
).
The default output container is .mkv
as it will support most input stream types. If you want a different output container, make sure that it supports your input file's video, audio, and subtitle streams (if any).
Also, if there is some other broken metadata, you can try to disable copying over of metadata with -mn
.
Finally, make sure you use a recent version of ffmpeg. The static builds are usually the best option.
What are the different normalization algorithms?
-
EBU R128 is an EBU standard that is commonly used in the broadcasting world. The normalization is performed using a psychoacoustic model that targets a subjective loudness level measured in LUFS (Loudness Unit Full Scale). R128 is subjectively more accurate than any peak or RMS-based normalization. More info on R128 can be found in the official document and the
loudnorm
filter description by its original author. -
Peak Normalization analyzes the peak signal level in dBFS and increases the volume of the input signal such that the maximum in the output is 0 dB (or any other chosen threshold). Since spikes in the signal can cause high volume peaks, peak normalization might still result in files that are subjectively quieter than other, non-peak-normalized files.
-
RMS-based Normalization analyzes the RMS power of the signal and changes the volume such that a new RMS target is reached. Otherwise it works similar to peak normalization.
Couldn't I just run loudnorm
with ffmpeg?
You absolutely can. However, you can get better accuracy and linear normalization with two passes of the filter. Since ffmpeg does not allow you to automatically run these two passes, you have to do it yourself and parse the output values from the first run.
If ffmpeg-normalize is too over-engineered for you, you could also use an approach such as featured in this Ruby script that performs the two loudnorm
passes.
If you want dynamic normalization (the loudnorm default), simply use ffmpeg with one pass, e.g.:
ffmpeg -i input.mp3 -af loudnorm -c:a aac -b:a 192k output.m4a
What about speech?
You should check out the speechnorm
filter that is part of ffmpeg. It is a designed to be used in one pass, so you don't need this script at all.
See the documentation for more information.
After updating, this program does not work as expected anymore!
You are probably using a 0.x version of this program. There are significant changes to the command line arguments and inner workings of this program, so please adapt your scripts to the new one. Those changes were necessary to address a few issues that kept piling up; leaving the program as-is would have made it hard to extend it. You can continue using the old version (find it under Releases on GitHub or request the specific version from PyPi), but it will not be supported anymore.
Can I buy you a beer / coffee / random drink?
If you found this program useful and feel like giving back, feel free to send a donation via PayPal.
Related Tools and Articles
(Have a link? Please propose an edit to this section via a pull request!)
Contributors
License
The MIT License (MIT)
Copyright (c) 2015-2022 Werner Robitza
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Changelog
v1.29.2 (2024-11-18)
-
Fix: show percentage with two decimal digits in progress.
-
Chore: add python 12.
v1.29.1 (2024-10-22)
- Fix: override argparse usage.
v1.29.0 (2024-10-14)
- Add option to set audio channels directly.
v1.28.3 (2024-08-16)
-
Make colorama dependency windows-only.
-
Update.
-
Update badges.
-
Docs: add @kanjieater as a contributor.
v1.28.2 (2024-06-22)
-
Provide an entrypoint for the Docker image.
-
Add docker push (#261)
v1.28.1 (2024-05-15)
- Fix assignment of audio statistics, fixes #257.
v1.28.0 (2024-05-13)
-
Warn if dynamic mode is used but linear specified (#256)
-
Print debug commands in shell-escaped form.
v1.27.7 (2023-09-26)
- Allow cover art in MP3.
v1.27.6 (2023-07-22)
- Remove warning for short files (#87)
v1.27.5 (2023-07-12)
- Building on Windows failed due to character conversion (#244)
v1.27.4 (2023-06-29)
-
Docs: add HighMans as a contributor for code (#242)
-
docs: update README.md
-
docs: update .all-contributorsrc
-
-
Properly handle non-existing input files and skipping.
-
Fix: Dockerfile used wrong path.
-
Use
https
rather thanhttp
(#238) -
Docs: add psavva as a contributor for code (#236)
-
docs: update README.md
-
docs: update .all-contributorsrc
-
-
Add Docker support (#235)
-
Docs: add @sian1468 as a contributor.
-
Round percentage in test (#234)
v1.27.3 (2023-05-06)
-
Bump ffmpeg-progress-yield, round percentage output.
-
Fix test for progress.
seems flaky, worked locally?
v1.27.2 (2023-05-05)
-
Bump ffmpeg-progress-yield, output progress in percent.
-
Docs: add @07416 as a contributor.
-
A typo in README (#231)
v1.27.1 (2023-04-25)
-
Fix capping to [1, 50] instead of [1, 7] (#230)
-
Clarify usage, output/input order.
-
Add note on ffmpeg 6.0.
-
Docs: add @mjhalwa as a contributor.
v1.27.0 (2023-04-24)
-
Constrain input LRA for second pass, addresses #227.
-
Feat: add linear loudnorm option to set lra up to target, then keep input lra.
-
Update question template.
v1.26.6 (2023-03-16)
-
Production status stable.
-
Make install_requires more abstract.
v1.26.5 (2023-03-15)
-
Add "-hide_banner" remove "-nostdin" (#222)
The
-nostdin
option is unnessary because of the-y
option. Adding-hide_banner
makes DEBUG statements shorter. -
Homebrew works on linux too.
-
Explain ffmpeg installation steps.
v1.26.4 (2023-02-08)
- Re-add requirements.txt to (maybe) fix conda-forge builds.
v1.26.3 (2023-02-08)
-
Fix requirements (#218)
-
Improve types.
-
Docs: add @g3n35i5 as a contributor.
v1.26.2 (2023-02-06)
-
Add ignore-revs file.
-
Formatting and import sorting.
-
Refactor: Improved logging behavior (#216)
-
Add "apt update" (#215)
-
Remove stalebot.
-
Update README.
-
Move to_ms and make CommandRunner more ergonomic (#212)
-
Upgrade workflow, get ffmpeg from apt (#213)
-
Turn FFmpegNormalizeError into a normal Exception (#211)
-
Remove manifest.in (#210)
-
Simplify logging (#209)
-
Use pep585 type hints (#207)
-
Don't use tempfile's private module function (#206)
-
Fix smaller type errors.
-
Reduce mypy errors 12 -> 4 (#204)
-
Make input validation more efficient.
Make input validation more efficient
Re-separate formats and exts
v1.26.1 (2022-12-18)
-
Bump requirements.
-
Add py.typed support.
-
General refactoring + type hints (#202)
-
Re-write to f-strings when possible (#201)
-
Remove unnecessary utf-8 declarations (#200)
"-- coding: utf-8 --" is a Python 2 construct and can be safely removed. Other utf-8 declarations are also unnecessary.
v1.26.0 (2022-12-14)
-
Add .editorconfig.
-
Link to API docs.
-
Add docs.
-
Add type hints, document everything, refactor some code.
-
Add more audio formats (#199)
-
Add python 3.11 to CI.
-
Docs: add WyattBlue as a contributor for code (#198)
-
docs: update README.md
-
docs: update .all-contributorsrc
-
-
Upgrade to Python 3.8 syntax (#197)
-
Fix python version in github tests.
-
Bump requirements to latest versions.
-
Add python 3.11 to list of languages.
-
Bump required python version to 3.8.
-
Various minor code cleanups and type hints.
-
Harmonize logger code.
-
Update python version in tests.
-
Docs: add @mvbattista as a contributor.
-
Docs: add @mpuels as a contributor.
-
Docs: add @Mathijsz as a contributor.
-
Docs: add @Nottt as a contributor.
-
Docs: add @justinpearson as a contributor.
-
Docs: add @kostalski as a contributor.
-
Docs: add @jetpks as a contributor.
-
Docs: add @aviolo as a contributor.
-
Docs: add @thenewguy as a contributor.
-
Docs: add @Geekfish as a contributor.
-
Docs: add @benjaoming as a contributor.
-
Reference speechnorm.
v1.25.3 (2022-11-09)
-
Update README.
-
Update list of pcm-incompatible extensions.
v1.25.2 (2022-09-14)
-
Constrain parsed ranges to avoid out of bounds, fixes #189.
-
Fix readme for extra-input-options.
-
Warn about dynamic mode only if not already set, fixes #187.
v1.25.1 (2022-08-21)
- Add warning in case user specifies both --lrt and --keep-loudness-range-target.
v1.25.0 (2022-08-20)
-
Add option to keep loudness range target, fixes #181.
-
Only show warning about disabling video if not yet disabled, addresses #184.
v1.24.1 (2022-08-20)
-
Code formatting.
-
Extend warning for audio-only format to opus, fixes #184.
v1.24.0 (2022-08-02)
-
Update python requirements.
-
Prevent race condition in output dir creation.
v1.23.1 (2022-07-12)
- Increase possible loudness range target to 50.
v1.23.0 (2022-05-01)
- Add way to force dynamic mode, clarify usage, fixes #176.
v1.22.10 (2022-04-25)
-
Add warning for cover art, addresses #174 and #175.
-
Update README.
v1.22.9 (2022-04-17)
-
Improve issue templates.
-
Do not print ffmpeg progress in debug logs.
-
Remove unused import.
-
Replace which() function with shlex version.
-
Add python 3.10 in setup.py.
-
Clarify minimum ffmpeg version.
v1.22.8 (2022-03-07)
- Properly detect -inf dB input.
v1.22.7 (2022-02-25)
-
Debug command output for ffmpeg commands.
-
Remove unneeded warning message.
v1.22.6 (2022-02-20)
-
Use astats instead of volumedetect filter, fixes #163.
Allows floating point calculation.
v1.22.5 (2022-01-25)
- Print warning for bit depths > 16, addresses #163.
v1.22.4 (2021-10-18)
-
Re-raise error on ffmpeg command failure.
This prevents incorrectly telling the user that a normalized file was written when it wasn't.
v1.22.3 (2021-08-31)
-
Set tqdm lock for logging only when multiprocessing is available.
Multiprocessing is not available in all environments, for example on AWS lambda python run time lacks /dev/shm, so trying to acquire a multiprocessing Lock throws an OSError. The module could also be missing in some cases (ex. Jython, although this library doesn't support Jython anyway).
The solution to this is to only try to set the lock when multiprocessing is available. The tqdm library solves this in the same manner.
For more details: https://github.com/slhck/ffmpeg-normalize/issues/156
-
Add instructions on how to run tests.
v1.22.2 (2021-08-14)
-
Bump requirements, should fix #155.
-
Move all examples to Wiki.
-
Update badge link.
v1.22.1 (2021-03-10)
- Add python_requires to setup.py.
v1.22.0 (2021-03-09)
-
Improve README.
-
Add GitHub actions badge.
-
Add GitHub actions tests.
-
Properly convert EBU JSON values to float.
-
Switch to f strings, remove Python 3.5 support.
-
Format code with black.
-
Fix flake8 errors.
-
Factor out method.
-
WIP: new tests.
-
Log to stderr by default to enable JSON parsing.
-
Remove release script.
v1.21.2 (2021-03-06)
-
Format setup.py.
-
Switch progress to external lib.
-
Remove support for older versions.
v1.21.1 (2021-03-05)
-
Adjusted handling of FFMPEG_PATH for binaries available via $PATH (#149)
- adjusted handling of FFMPEG_PATH for binaries available via $PATH
fixes #147
-
adjusted use of %s to {} to match style
-
documented the feature
-
condensed error message as other lines are longer
v1.21.0 (2021-02-27)
-
Fix JSON output for multiple files.
-
Update badge URL.
-
Update README.md (#142)
- Update README.md
Added example of verifying levels
Fixes #141
- shorten example, add link to wiki page
-
Error if no ffmpeg exec exists.
-
Add stalebot.
v1.20.2 (2020-11-06)
-
Fixing stdin corruption caused by new subprocess (#138)
-
Update issue template.
-
Create FUNDING.yml.
-
Fix usage, addresses #132.
v1.20.1 (2020-07-22)
-
Manually specify usage string, fixes #132.
-
Fix local import for tests.
v1.20.0 (2020-07-04)
- Add extra input options.
v1.19.1 (2020-06-25)
-
Add colorama to requirements, fixes #131.
-
Fix warning that is printed with default options.
v1.19.0 (2020-05-02)
-
Fix issue with output folder, fixes #126.
-
Fix typo in README's table of contents link to "File Input/Output". (#124)
-
Clarify readme, fixes #122.
v1.18.2 (2020-04-19)
-
Add warning for automatic sample rate conversion, addresses #122.
-
Ignore vscode folder.
-
Fix printing of errors in conversion.
v1.18.1 (2020-04-16)
-
Fix unit tests.
-
Improve handling of output file folder and errors.
-
Clarify usage of output options, add warning.
-
Improve documentation, fixes #120.
-
Do not include bump messages in changelog.
v1.18.0 (2020-04-13)
-
Use measured offset in second pass, fixes #119.
-
Update release instructions.
-
Remove author names from changelog.
v1.17.0 (2020-04-10)
-
Update release script and changelog template.
-
Apply pre-filters in all first passes, fixes #118.
This allows properly reading the level for any kind of normalization, even if filters affect the loudness in the first pass.
v1.16.0 (2020-04-07)
-
Add all commits to changelog.
-
Remove python 2 support.
-
Add quiet option, fixes #116.
- Add a new quiet option
- Promote some warnings to actual errors that need to be shown
- Add a very basic test case
v1.15.8 (2020-03-15)
-
Improve release script.
-
Python 3.8.
v1.15.7 (2020-03-14)
- Only print length warning for non-EBU type normalization.
v1.15.6 (2019-12-04)
-
Remove build and dist folder on release.
-
Do not exit on error in batch processing.
Simply process the next file if one has errors, addresses #110.
v1.15.5 (2019-11-19)
-
Use minimal dependency for tqdm.
-
Remove specific python version requirement.
v1.15.4 (2019-11-19)
-
Freeze tqdm version.
-
Update python to 3.7.
-
Improve release documentation.
v1.15.3 (2019-10-15)
-
Do not print stream warning when there is only one stream.
-
Remove previous dist versions before release.
v1.15.2 (2019-07-12)
-
Warn when duration cannot be read, fixes #105.
-
Update README.
minor improvements in the description
v1.15.1 (2019-06-17)
-
Add output to unit test failures.
-
Fix input label for audio stream.
v1.15.0 (2019-06-17)
-
Add pre-and post-filter hooks, fixes #67.
This allows users to specify filters to be run before or after the actual normalization call, using regular ffmpeg syntax. Only applies to audio.
-
Document audiostream class.
-
Warn when file is too short, fixes #87.
-
Update release method to twine.
v1.14.1 (2019-06-14)
-
Handle progress output from ffmpeg, fixes #10.
-
Merge pull request #99 from Nottt/patch-1.
fix -cn description
-
Fix -cn description.
-
Add nicer headers for options in README.
v1.14.0 (2019-04-24)
-
Add version file in release script before committing.
-
Add option to keep original audio, fixes #83.
-
Add pypi badge.
-
Allow release script to add changelog for future version; upload to pypi.
v1.13.11 (2019-04-16)
-
Add release script.
-
Add small developer guide on releasing.
-
Move HISTORY.md to CHANGELOG.md.
-
Fix ffmpeg static build download location.
v1.3.10 (2019-02-22)
-
Bump version.
-
Cap measured input loudness, fixes #92.
v1.3.9 (2019-01-10)
-
Bump version.
-
Fix handling of errors with tqdm.
-
Improve readme.
-
Delete issue template.
-
Bump version.
-
Clarify extra argument options, move to main entry point.
-
Update issue templates.
v1.3.8 (2018-11-28)
-
Bump version.
-
Clarify extra argument options, move to main entry point.
v1.3.7 (2018-10-28)
-
Bump version.
-
Copy metadata from individual streams, fixes #86.
-
Add python version for pyenv.
v1.3.6 (2018-07-09)
-
Bump version.
-
Update README, fixes #79 and addresses #80.
v1.3.5 (2018-06-12)
-
Bump version.
-
Minor README updates.
-
Fix documentation of TMPDIR parameter.
v1.3.4 (2018-05-05)
-
Bump version.
-
New way to specify extra options.
v1.3.3 (2018-05-05)
-
Update README.
-
Decode strings in extra options.
v1.3.2 (2018-04-25)
-
Bump version.
-
Merge pull request #69 from UbiCastTeam/master.
Stderror decoding ignoring utf8 encoding errors
-
Stderror decoding ignoring utf8 encoding errors.
v1.3.1 (2018-04-24)
-
Bump version.
-
Do not require main module in setup.py, fixes #68.
v1.3.0 (2018-04-15)
-
Bump version.
-
Remove dead code.
-
Fix for python2 division.
-
Update documentation.
-
Progress bar.
-
Remove imports from test file.
-
Fix travis file.
-
WIP: progress bar.
-
Minor typo in option group.
-
Add simple unit test for disabling chapters.
v1.2.3 (2018-04-11)
-
Fix unit test.
-
Bump version.
-
Add option to disable chapters, fixes #65, also fix issue with metadata.
v1.2.2 (2018-04-10)
-
Bump version.
-
Set default loudness target to -23, fixes #48.
v1.2.1 (2018-04-04)
-
Bump version.
-
Merge pull request #64 from UbiCastTeam/encoding-issue.
Stdout and stderror decoding ignoring utf8 encoding errors
-
Stdout and stderror decoding ignoring utf8 encoding errors.
v1.2.0 (2018-03-22)
-
Bump version.
-
Add errors for impossible format combinations, fixes #60.
-
Fix ordering of output maps, fixes #63.
-
Improve documentation.
v1.1.0 (2018-03-06)
- Add option to print first pass statistics.
v1.0.10 (2018-03-04)
-
Bump version.
-
Restrict parsing to valid JSON part only, fixes #61.
-
Add an example for MP3 encoding.
-
Update paypal link.
v1.0.9 (2018-02-08)
-
Bump version.
-
Add normalized folder to gitignore.
-
Do not print escape sequences on Windows.
-
Do not check for file existence, fixes #57.
-
Add github issue template.
v1.0.8 (2018-02-01)
-
Bump version.
-
Do not check for ffmpeg upon module import.
v1.0.7 (2018-02-01)
-
Bump version.
-
Rename function test.
-
Fix issue with wrong adjustment parameters, fixes #54.
v1.0.6 (2018-01-30)
- Allow setting FFMPEG_PATH and document TMP.
v1.0.5 (2018-01-26)
- Handle edge case for short input clips.
v1.0.4 (2018-01-26)
-
Bump version.
-
Do not try to remove nonexisting file in case of error in command.
v1.0.3 (2018-01-26)
-
Bump version.
-
Always streamcopy when detecting streams to avoid initializing encoder.
-
Fix handling of temporary file.
-
Add build status.
-
Travis tests.
v1.0.2 (2018-01-25)
-
Fix bug with target level for peak/RMS.
-
Update documentation formatting.
-
Update history.
v1.0.1 (2018-01-24)
-
Bump version.
-
Set default target to -23.
v1.0.0 (2018-01-23)
-
Add version info and test case for dry run.
-
New feature detection, add documentation, contributors guide etc.
-
WIP: v1.0 rewrite.
v0.7.3 (2017-10-09)
- Use shutil.move instead of os.rename.
v0.7.2 (2017-09-17)
- Allow setting threshold to 0.
v0.7.1 (2017-09-14)
-
Bump version.
-
Update HISTORY.md.
-
Merge pull request #37 from Mathijsz/fix-which-path-expansion.
expand tilde and environment variables, fixes #36
-
Expand tilde and environment variables, fixes #36.
-
Update HISTORY.md.
-
Update README w.r.t. loudnorm filter.
-
Update README and indentation.
v0.7.0 (2017-08-02)
-
Bump version.
-
Fix handling of extra options with spaces.
-
Include test script.
-
Logging and other improvements.
-
Add test files.
-
Autopep8 that thing.
-
Logger improvements.
-
Add example for overwriting.
v0.6.0 (2017-07-31)
-
Allow overwriting input file, fixes #22.
-
Version bump.
-
Better handle cmd arguments.
-
Update README.md.
add another example
v0.5.1 (2017-04-04)
- Fix for problem introduced in 304e8df.
v0.5 (2017-04-02)
-
Fix pypi topics.
-
Bump version and README.
-
Fix issue where output was wrong format.
-
Add EBU R128 filter.
-
Use Markdown instead of RST for README/HISTORY.
-
Define file encode for python3, fixes #24.
-
Fix history.
-
Fix option -np.
-
Clarify merge option.
-
Minor documentation improvements.
- change README from CRLF to LF
- add "attenuated" in description
- extend LICENSE year
- add license to main README
v0.4.1 (2017-02-13)
-
Update for release.
-
Merge pull request #21 from mpuels/patch-1.
Fix for #13
-
Fix for #13.
-
Mention Python 3.
mention that Python 3 may work, just didn't have time to test
-
Fix README's code blocks.
v0.4 (2017-01-24)
- Code cleanup, add option to set format and audio codec.
v0.3 (2017-01-19)
-
Add option for no prefix, fixes #20.
-
Handle multiple spaces in path; fixes issue #18.
-
Handle spaces in path, fixes #12.
-
Update README.rst.
-
Change default level back to -26.
-
Typo in README example.
-
Update documentation.
-
Bump to v0.2.0.
- Support for multiple files and output directories.
- Support merging of audio with input file
- Set audio codec and additional options
- User-definable threshold
- Better error handling and logging
- Deprecates avconv
-
Change default level back to -28.
-
Merge pull request #15 from auricgoldfinger/master.
Add extended normalisation options
-
Add extended normalisation options.
-
add program option to write output in a separate directory in stead of prefixing it
-
add program option to merge the normalized audio in the original (video) file rather than creating a separate WAV file
-
change the maximum setting: will now normalize so that max volume is set to 0, adjusted with the given level. e.g. : -m -l -5 will increase the audio level to max = -5.0dB
-
improve verbose logging: number of files are written to the info log
-
improve performance: check first whether the output file exists before calculating the volume levels + not modifying the file if the adjustment < 0.5dB (level is never exactly 0)
-
-
Update README, fixes #11.
v0.1.3 (2015-12-15)
-
Check for Windows .exe, fixes #10.
-
Check path and fix #9.
-
Merge pull request #8 from benjaoming/master.
Add MANIFEST.in
-
Bump version.
-
Add manifest to include missing files in sdist.
-
Merge pull request #6 from jetpks/master.
Fixed ffmpeg v2.6.3 compatibility and docopt config
-
Updated to work with ffmpeg v2.6.3, and fixed broken docopt config.
ffmpeg update:
ffmpeg v2.6.3 puts mean_volume on stderr instead of stdout, causing
output
inffmpeg_get_mean
to be completely empty, and no match for mean_volume or max_volume to be found.Fixed by adding
stderr=subprocess.PIPE
in both Popen calls inrun_command
, and combining stdout and stderr on return. We already exit with non-zero return, so combining stderr/stdout shouldn't cause any poor side-effects.docopt config:
- args['--level'] was not recognizing its default because there was an errant comma between -l and --level, and it needed after the arguments.
- Fixed spacing for --max
- Removed quotes around 'normalized' so single quote characters don't end up in the output file names.
-
Removed Windows carraige returns from main.py.
-
Merge pull request #5 from mvbattista/master.
Installation update to ffmpeg
-
Installation update to ffmpeg.
-
Update to ffmpeg.
-
Update HISTORY.rst.
-
Update to ffmpeg.
-
Merge pull request #4 from benjaoming/rename.
Rename project
-
Make at least one file mandatory.
-
Rename project and remove pyc file.
-
Merge pull request #2 from benjaoming/docopt-setuptools-avconv.
Docopt, Setuptools, avconv compatibility
-
Use docopt.
-
Use normalize-audio when using avconv because it doesn't have a way to measure volume.
-
Functional setup.py, communicate with avconv/ffmpeg about overwriting.
-
Also detect avconv.
-
Use a main function instead.
-
Add a history for the project.
-
Move to more unique module name.
-
Update README.rst.
-
Change the README to rst (PyPi)
-
Delete .gitignore.
-
Update README.md.
-
Various improvements, fixes #1.
-
License.
-
Livense.
-
Update README.md.
-
Merge branch 'master' of https://github.com/slhck/audio-normalize.
-
Initial commit.
-
Initial commit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ffmpeg-normalize-1.29.2.tar.gz
.
File metadata
- Download URL: ffmpeg-normalize-1.29.2.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2b46b549227402a7705344da36b147a3565a5a8be4006fce90de1a50d70d6e1 |
|
MD5 | ecfb5885dad373e7c655b2132f1c13cb |
|
BLAKE2b-256 | bed72edfc3acf45a027b3af9ba761720b535cd33905c02b6ed0b6c8681733a60 |
File details
Details for the file ffmpeg_normalize-1.29.2-py2.py3-none-any.whl
.
File metadata
- Download URL: ffmpeg_normalize-1.29.2-py2.py3-none-any.whl
- Upload date:
- Size: 41.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 160f853ecde4df7b9e2a5b85f6a56f3b9325fa6900c468c49f12fd432d7eda88 |
|
MD5 | 0368b38fec99a6c88f8b8778d052dba5 |
|
BLAKE2b-256 | 17d923ab2bdb1ab2a7450bc7d950d3b6c53fa6af5f7af4fc6e351472b249d44a |