ffmpeg-normalize 1.28.2__py2.py3-none-any.whl → 1.28.3__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ffmpeg_normalize/_version.py +1 -1
- {ffmpeg_normalize-1.28.2.dist-info → ffmpeg_normalize-1.28.3.dist-info}/METADATA +81 -39
- {ffmpeg_normalize-1.28.2.dist-info → ffmpeg_normalize-1.28.3.dist-info}/RECORD +7 -7
- {ffmpeg_normalize-1.28.2.dist-info → ffmpeg_normalize-1.28.3.dist-info}/LICENSE +0 -0
- {ffmpeg_normalize-1.28.2.dist-info → ffmpeg_normalize-1.28.3.dist-info}/WHEEL +0 -0
- {ffmpeg_normalize-1.28.2.dist-info → ffmpeg_normalize-1.28.3.dist-info}/entry_points.txt +0 -0
- {ffmpeg_normalize-1.28.2.dist-info → ffmpeg_normalize-1.28.3.dist-info}/top_level.txt +0 -0
ffmpeg_normalize/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.28.
|
|
1
|
+
__version__ = "1.28.3"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ffmpeg-normalize
|
|
3
|
-
Version: 1.28.
|
|
3
|
+
Version: 1.28.3
|
|
4
4
|
Summary: Normalize audio via ffmpeg
|
|
5
5
|
Home-page: https://github.com/slhck/ffmpeg-normalize
|
|
6
6
|
Author: Werner Robitza
|
|
@@ -23,19 +23,19 @@ Requires-Python: >=3.8
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
25
|
Requires-Dist: tqdm
|
|
26
|
-
Requires-Dist: colorama
|
|
27
26
|
Requires-Dist: ffmpeg-progress-yield
|
|
28
27
|
Requires-Dist: colorlog
|
|
28
|
+
Requires-Dist: colorama ; platform_system == "Windows"
|
|
29
29
|
|
|
30
30
|
# ffmpeg-normalize
|
|
31
31
|
|
|
32
|
-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
33
|
-
[](#contributors-)
|
|
34
|
-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
35
|
-
|
|
36
32
|
[](https://pypi.org/project/ffmpeg-normalize)
|
|
33
|
+

|
|
34
|
+

|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
37
|
+
[](#contributors-)
|
|
38
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
39
39
|
|
|
40
40
|
A utility for batch-normalizing audio using ffmpeg.
|
|
41
41
|
|
|
@@ -58,9 +58,8 @@ Read on for more info.
|
|
|
58
58
|
- [ffmpeg](#ffmpeg)
|
|
59
59
|
- [Installation](#installation)
|
|
60
60
|
- [Usage with Docker](#usage-with-docker)
|
|
61
|
-
|
|
62
|
-
- [Usage](#usage)
|
|
63
|
-
- [Description](#description)
|
|
61
|
+
- [High LeveL Introduction](#high-level-introduction)
|
|
62
|
+
- [Basic Usage](#basic-usage)
|
|
64
63
|
- [Examples](#examples)
|
|
65
64
|
- [Detailed Options](#detailed-options)
|
|
66
65
|
- [File Input/Output](#file-inputoutput)
|
|
@@ -73,10 +72,11 @@ Read on for more info.
|
|
|
73
72
|
- [Environment Variables](#environment-variables)
|
|
74
73
|
- [API](#api)
|
|
75
74
|
- [FAQ](#faq)
|
|
75
|
+
- [What options should I choose for the EBU R128 filter? What is linear and dynamic mode?](#what-options-should-i-choose-for-the-ebu-r128-filter-what-is-linear-and-dynamic-mode)
|
|
76
76
|
- [The program doesn't work because the "loudnorm" filter can't be found](#the-program-doesnt-work-because-the-loudnorm-filter-cant-be-found)
|
|
77
77
|
- [Should I use this to normalize my music collection?](#should-i-use-this-to-normalize-my-music-collection)
|
|
78
78
|
- [Why are my output files MKV?](#why-are-my-output-files-mkv)
|
|
79
|
-
- ["Could not write header for output file" error](#could-not-write-header-for-output-file-error)
|
|
79
|
+
- [I get a "Could not write header for output file" error](#i-get-a-could-not-write-header-for-output-file-error)
|
|
80
80
|
- [The conversion does not work and I get a cryptic ffmpeg error!](#the-conversion-does-not-work-and-i-get-a-cryptic-ffmpeg-error)
|
|
81
81
|
- [What are the different normalization algorithms?](#what-are-the-different-normalization-algorithms)
|
|
82
82
|
- [Couldn't I just run `loudnorm` with ffmpeg?](#couldnt-i-just-run-loudnorm-with-ffmpeg)
|
|
@@ -91,7 +91,7 @@ Read on for more info.
|
|
|
91
91
|
|
|
92
92
|
## Requirements
|
|
93
93
|
|
|
94
|
-
You need Python 3.8 or higher.
|
|
94
|
+
You need Python 3.8 or higher, and ffmpeg.
|
|
95
95
|
|
|
96
96
|
### ffmpeg
|
|
97
97
|
|
|
@@ -130,9 +130,9 @@ pip3 install ffmpeg-normalize
|
|
|
130
130
|
|
|
131
131
|
Or download this repository, then run `pip3 install .`.
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
To later upgrade to the latest version, run `pip3 install --upgrade ffmpeg-normalize`.
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
## Usage with Docker
|
|
136
136
|
|
|
137
137
|
You can use the pre-built image from Docker Hub:
|
|
138
138
|
|
|
@@ -142,7 +142,7 @@ docker run -v "$(pwd):/tmp" -it slhck/ffmpeg-normalize
|
|
|
142
142
|
|
|
143
143
|
Alternatively, download this repository and run
|
|
144
144
|
|
|
145
|
-
```
|
|
145
|
+
```bash
|
|
146
146
|
docker build -t ffmpeg-normalize .
|
|
147
147
|
```
|
|
148
148
|
|
|
@@ -160,45 +160,31 @@ docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /tmp/yourfile.mp4 -o /tmp/your
|
|
|
160
160
|
|
|
161
161
|
You will then find the normalized file in your current directory.
|
|
162
162
|
|
|
163
|
-
##
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
ffmpeg-normalize input [input ...][-h][-o OUTPUT [OUTPUT ...]] [options]
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Example:
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
ffmpeg-normalize 1.wav 2.wav -o 1-normalized.m4a 2-normalized.m4a -c:a aac -b:a 192k
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
For more information on the options (`[options]`) available, run `ffmpeg-normalize -h`, or read on.
|
|
176
|
-
|
|
177
|
-
## Description
|
|
163
|
+
## High LeveL Introduction
|
|
178
164
|
|
|
179
165
|
Please read this section for a high level introduction.
|
|
180
166
|
|
|
181
167
|
**What does the program do?**
|
|
182
168
|
|
|
183
|
-
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.
|
|
169
|
+
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.
|
|
184
170
|
|
|
185
171
|
**How do I specify the input?**
|
|
186
172
|
|
|
187
|
-
Just give the program one or more input files as arguments. It works with most media files.
|
|
173
|
+
Just give the program one or more input files as arguments. It works with most media files, including video files.
|
|
188
174
|
|
|
189
175
|
**How do I specify the output?**
|
|
190
176
|
|
|
191
|
-
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.
|
|
177
|
+
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.
|
|
192
178
|
|
|
193
179
|
Example:
|
|
194
180
|
|
|
195
|
-
```
|
|
196
|
-
ffmpeg-normalize 1.wav 2.wav -o
|
|
181
|
+
```bash
|
|
182
|
+
ffmpeg-normalize 1.wav 2.wav -o 1-normalized.wav 2-normalized.wav
|
|
197
183
|
```
|
|
198
184
|
|
|
199
|
-
|
|
185
|
+
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.
|
|
200
186
|
|
|
201
|
-
Using the `-ext` option, you can supply a different output extension common to all output files, e.g. `-ext m4a`.
|
|
187
|
+
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).
|
|
202
188
|
|
|
203
189
|
**What will get normalized?**
|
|
204
190
|
|
|
@@ -206,7 +192,7 @@ By default, all streams from the input file will be written to the output file.
|
|
|
206
192
|
|
|
207
193
|
**How will the normalization be done?**
|
|
208
194
|
|
|
209
|
-
The normalization will be performed with the [`loudnorm` filter](https://ffmpeg.org/ffmpeg-filters.html#loudnorm) from FFmpeg, which was [originally written by Kyle Swanson](https://k.ylo.ph/2016/04/04/loudnorm.html). 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.
|
|
195
|
+
The normalization will be performed according to the EBU R128 algorithm with the [`loudnorm` filter](https://ffmpeg.org/ffmpeg-filters.html#loudnorm) from FFmpeg, which was [originally written by Kyle Swanson](https://k.ylo.ph/2016/04/04/loudnorm.html). 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.
|
|
210
196
|
|
|
211
197
|
**What codec is chosen?**
|
|
212
198
|
|
|
@@ -214,6 +200,22 @@ The default audio encoding method is uncompressed PCM (`pcm_s16le`) to avoid int
|
|
|
214
200
|
|
|
215
201
|
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).
|
|
216
202
|
|
|
203
|
+
## Basic Usage
|
|
204
|
+
|
|
205
|
+
Supply one or more input files, and optionally, output file names:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
ffmpeg-normalize input [input ...][-h][-o OUTPUT [OUTPUT ...]] [options]
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Example:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
ffmpeg-normalize 1.wav 2.wav -o 1-normalized.m4a 2-normalized.m4a -c:a aac -b:a 192k
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
For more information on the options (`[options]`) available, run `ffmpeg-normalize -h`, or read on.
|
|
218
|
+
|
|
217
219
|
## Examples
|
|
218
220
|
|
|
219
221
|
[Read the examples on the wiki.](https://github.com/slhck/ffmpeg-normalize/wiki/examples)
|
|
@@ -404,6 +406,32 @@ For more information see the [API documentation](https://htmlpreview.github.io/?
|
|
|
404
406
|
|
|
405
407
|
## FAQ
|
|
406
408
|
|
|
409
|
+
### What options should I choose for the EBU R128 filter? What is linear and dynamic mode?
|
|
410
|
+
|
|
411
|
+
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:
|
|
412
|
+
|
|
413
|
+
* Integrated Loudness (I): The overall loudness of the entire audio.
|
|
414
|
+
* Loudness Range (LRA): The variation in loudness over time.
|
|
415
|
+
* True Peak (TP): The maximum level of the audio signal.
|
|
416
|
+
|
|
417
|
+
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).
|
|
418
|
+
|
|
419
|
+
**Linear mode** applies a constant gain adjustment across the entire audio file. This is generally preferred because:
|
|
420
|
+
|
|
421
|
+
* It preserves the original dynamic range of the audio.
|
|
422
|
+
* It maintains the relative loudness between different parts of the audio.
|
|
423
|
+
* It avoids potential artifacts or pumping effects that can occur with dynamic processing.
|
|
424
|
+
|
|
425
|
+
**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).
|
|
426
|
+
|
|
427
|
+
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:
|
|
428
|
+
|
|
429
|
+
* 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.
|
|
430
|
+
|
|
431
|
+
* 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.
|
|
432
|
+
|
|
433
|
+
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!
|
|
434
|
+
|
|
407
435
|
### The program doesn't work because the "loudnorm" filter can't be found
|
|
408
436
|
|
|
409
437
|
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.
|
|
@@ -416,13 +444,15 @@ If you have to use an outdated ffmpeg version, you can only use `rms` or `peak`
|
|
|
416
444
|
|
|
417
445
|
### Should I use this to normalize my music collection?
|
|
418
446
|
|
|
447
|
+
Generally, no.
|
|
448
|
+
|
|
419
449
|
When you run `ffmpeg-normalize` and re-encode files with MP3 or AAC, you will inevitably introduce [generation loss](https://en.wikipedia.org/wiki/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](http://mp3gain.sourceforge.net/) and [aacgain](http://aacgain.altosdesign.com/).
|
|
420
450
|
|
|
421
451
|
### Why are my output files MKV?
|
|
422
452
|
|
|
423
453
|
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.
|
|
424
454
|
|
|
425
|
-
### "Could not write header for output file" error
|
|
455
|
+
### I get a "Could not write header for output file" error
|
|
426
456
|
|
|
427
457
|
See the [next section](#the-conversion-does-not-work-and-i-get-a-cryptic-ffmpeg-error).
|
|
428
458
|
|
|
@@ -518,6 +548,7 @@ If you found this program useful and feel like giving back, feel free to send a
|
|
|
518
548
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sian1468"><img src="https://avatars.githubusercontent.com/u/58017832?v=4?s=100" width="100px;" alt="sian1468"/><br /><sub><b>sian1468</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=sian1468" title="Tests">⚠️</a></td>
|
|
519
549
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/psavva"><img src="https://avatars.githubusercontent.com/u/1454758?v=4?s=100" width="100px;" alt="Panayiotis Savva"/><br /><sub><b>Panayiotis Savva</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=psavva" title="Code">💻</a></td>
|
|
520
550
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/HighMans"><img src="https://avatars.githubusercontent.com/u/42877729?v=4?s=100" width="100px;" alt="HighMans"/><br /><sub><b>HighMans</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=HighMans" title="Code">💻</a></td>
|
|
551
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kanjieater"><img src="https://avatars.githubusercontent.com/u/32607317?v=4?s=100" width="100px;" alt="kanjieater"/><br /><sub><b>kanjieater</b></sub></a><br /><a href="#ideas-kanjieater" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
521
552
|
</tr>
|
|
522
553
|
</tbody>
|
|
523
554
|
<tfoot>
|
|
@@ -565,6 +596,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
565
596
|
# Changelog
|
|
566
597
|
|
|
567
598
|
|
|
599
|
+
## v1.28.3 (2024-08-16)
|
|
600
|
+
|
|
601
|
+
* Make colorama dependency windows-only.
|
|
602
|
+
|
|
603
|
+
* Update.
|
|
604
|
+
|
|
605
|
+
* Update badges.
|
|
606
|
+
|
|
607
|
+
* Docs: add @kanjieater as a contributor.
|
|
608
|
+
|
|
609
|
+
|
|
568
610
|
## v1.28.2 (2024-06-22)
|
|
569
611
|
|
|
570
612
|
* Provide an entrypoint for the Docker image.
|
|
@@ -6,11 +6,11 @@ ffmpeg_normalize/_ffmpeg_normalize.py,sha256=zvqxGvyAfx1pZr7kSlhHACx5qJC-atlmQpb
|
|
|
6
6
|
ffmpeg_normalize/_logger.py,sha256=3Ap4Fxg7xGrzz7h4IGuNEf0KKstx0Rq_eLbHPrHzcrI,1841
|
|
7
7
|
ffmpeg_normalize/_media_file.py,sha256=oBZl0wl6XEyJLWNxtyhgZR_9cp22D9-hSUUHDC8LdQo,16310
|
|
8
8
|
ffmpeg_normalize/_streams.py,sha256=5zLlSK2vMTBs0HzBTmI5UiJVqSp1Nk19TZXpxNtjkIA,19973
|
|
9
|
-
ffmpeg_normalize/_version.py,sha256=
|
|
9
|
+
ffmpeg_normalize/_version.py,sha256=4WEUaUH8jsAY-R3QLSQJkfbfM276l8HmEK4N_ImQJSo,23
|
|
10
10
|
ffmpeg_normalize/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
ffmpeg_normalize-1.28.
|
|
12
|
-
ffmpeg_normalize-1.28.
|
|
13
|
-
ffmpeg_normalize-1.28.
|
|
14
|
-
ffmpeg_normalize-1.28.
|
|
15
|
-
ffmpeg_normalize-1.28.
|
|
16
|
-
ffmpeg_normalize-1.28.
|
|
11
|
+
ffmpeg_normalize-1.28.3.dist-info/LICENSE,sha256=zeqAHGWrSIwdPHsZMZv1_N0gGFO1xxjcZEz9CplR4EM,1086
|
|
12
|
+
ffmpeg_normalize-1.28.3.dist-info/METADATA,sha256=v8BqX0BtgxXH0FX5DqGj-IlQU-yA54kwr7qtTiGEnh8,55862
|
|
13
|
+
ffmpeg_normalize-1.28.3.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
|
|
14
|
+
ffmpeg_normalize-1.28.3.dist-info/entry_points.txt,sha256=X0EC5ptb0iGOxrk3Aa65dVQtvUixngLd_2-iAtSixdc,68
|
|
15
|
+
ffmpeg_normalize-1.28.3.dist-info/top_level.txt,sha256=wnUkr17ckPrrU1JsxZQiXbEBUnHKsC64yck-MemEBuI,17
|
|
16
|
+
ffmpeg_normalize-1.28.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|