ffmpeg-normalize 1.28.1__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.
@@ -1 +1 @@
1
- __version__ = "1.28.1"
1
+ __version__ = "1.28.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ffmpeg-normalize
3
- Version: 1.28.1
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
- [![All Contributors](https://img.shields.io/badge/all_contributors-18-orange.svg?style=flat-square)](#contributors-)
34
- <!-- ALL-CONTRIBUTORS-BADGE:END -->
35
-
36
32
  [![PyPI version](https://img.shields.io/pypi/v/ffmpeg-normalize.svg)](https://pypi.org/project/ffmpeg-normalize)
33
+ ![Docker Image Version](https://img.shields.io/docker/v/slhck/ffmpeg-normalize?sort=semver&label=Docker%20image)
34
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/slhck/ffmpeg-normalize/python-package.yml)
37
35
 
38
- [![Python package](https://github.com/slhck/ffmpeg-normalize/actions/workflows/python-package.yml/badge.svg)](https://github.com/slhck/ffmpeg-normalize/actions/workflows/python-package.yml)
36
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
37
+ [![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors-)
38
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
39
39
 
40
40
  A utility for batch-normalizing audio using ffmpeg.
41
41
 
@@ -57,9 +57,9 @@ Read on for more info.
57
57
  - [Requirements](#requirements)
58
58
  - [ffmpeg](#ffmpeg)
59
59
  - [Installation](#installation)
60
- - [Docker Build](#docker-build)
61
- - [Usage](#usage)
62
- - [Description](#description)
60
+ - [Usage with Docker](#usage-with-docker)
61
+ - [High LeveL Introduction](#high-level-introduction)
62
+ - [Basic Usage](#basic-usage)
63
63
  - [Examples](#examples)
64
64
  - [Detailed Options](#detailed-options)
65
65
  - [File Input/Output](#file-inputoutput)
@@ -72,10 +72,11 @@ Read on for more info.
72
72
  - [Environment Variables](#environment-variables)
73
73
  - [API](#api)
74
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)
75
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)
76
77
  - [Should I use this to normalize my music collection?](#should-i-use-this-to-normalize-my-music-collection)
77
78
  - [Why are my output files MKV?](#why-are-my-output-files-mkv)
78
- - ["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)
79
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)
80
81
  - [What are the different normalization algorithms?](#what-are-the-different-normalization-algorithms)
81
82
  - [Couldn't I just run `loudnorm` with ffmpeg?](#couldnt-i-just-run-loudnorm-with-ffmpeg)
@@ -90,7 +91,7 @@ Read on for more info.
90
91
 
91
92
  ## Requirements
92
93
 
93
- You need Python 3.8 or higher.
94
+ You need Python 3.8 or higher, and ffmpeg.
94
95
 
95
96
  ### ffmpeg
96
97
 
@@ -129,74 +130,61 @@ pip3 install ffmpeg-normalize
129
130
 
130
131
  Or download this repository, then run `pip3 install .`.
131
132
 
132
- ## Docker Build
133
- Download this repository and run
133
+ To later upgrade to the latest version, run `pip3 install --upgrade ffmpeg-normalize`.
134
134
 
135
- ```
136
- docker build -t ffmpeg-normalize .
137
- ```
135
+ ## Usage with Docker
138
136
 
139
- Run using Windows Powershell or Linux:
140
- ```
141
- docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /bin/sh
142
- ```
143
- This will mount your current folder to the /tmp directory inside the container
137
+ You can use the pre-built image from Docker Hub:
144
138
 
145
- Note: The container will run in interactive mode.
139
+ ```bash
140
+ docker run -v "$(pwd):/tmp" -it slhck/ffmpeg-normalize
141
+ ```
146
142
 
147
- Example Usage:
143
+ Alternatively, download this repository and run
148
144
 
149
- ```
150
- PS C:\yonkers> docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /bin/sh
151
- / # cd /tmp
152
- /tmp # ls
153
- 01. Goblin.mp3
154
- /tmp # ffmpeg-normalize "01. Goblin.mp3" -f -c:a libmp3lame -b:a 320k --target-level -13 --output "01. Goblin normalized.mp3"
155
- WARNING: The chosen output extension mp3 does not support video/cover art. It will be disabled.
156
- /tmp # ls
157
- 01. Goblin normalized.mp3
158
- 01. Goblin.mp3
145
+ ```bash
146
+ docker build -t ffmpeg-normalize .
159
147
  ```
160
148
 
161
- ## Usage
149
+ Then run the container with:
162
150
 
163
151
  ```bash
164
- ffmpeg-normalize input [input ...][-h][-o OUTPUT [OUTPUT ...]] [options]
152
+ docker run -v "$(pwd):/tmp" -it ffmpeg-normalize
165
153
  ```
166
154
 
167
- Example:
155
+ 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:
168
156
 
169
157
  ```bash
170
- ffmpeg-normalize 1.wav 2.wav -o 1-normalized.m4a 2-normalized.m4a -c:a aac -b:a 192k
158
+ docker run -v "$(pwd):/tmp" -it ffmpeg-normalize /tmp/yourfile.mp4 -o /tmp/yourfile-normalized.wav
171
159
  ```
172
160
 
173
- For more information on the options (`[options]`) available, run `ffmpeg-normalize -h`, or read on.
161
+ You will then find the normalized file in your current directory.
174
162
 
175
- ## Description
163
+ ## High LeveL Introduction
176
164
 
177
165
  Please read this section for a high level introduction.
178
166
 
179
167
  **What does the program do?**
180
168
 
181
- 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.
182
170
 
183
171
  **How do I specify the input?**
184
172
 
185
- 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.
186
174
 
187
175
  **How do I specify the output?**
188
176
 
189
- 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.
190
178
 
191
179
  Example:
192
180
 
193
- ```
194
- ffmpeg-normalize 1.wav 2.wav -o 1n.wav 2n.wav
181
+ ```bash
182
+ ffmpeg-normalize 1.wav 2.wav -o 1-normalized.wav 2-normalized.wav
195
183
  ```
196
184
 
197
- 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`.
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.
198
186
 
199
- 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).
200
188
 
201
189
  **What will get normalized?**
202
190
 
@@ -204,7 +192,7 @@ By default, all streams from the input file will be written to the output file.
204
192
 
205
193
  **How will the normalization be done?**
206
194
 
207
- 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.
208
196
 
209
197
  **What codec is chosen?**
210
198
 
@@ -212,6 +200,22 @@ The default audio encoding method is uncompressed PCM (`pcm_s16le`) to avoid int
212
200
 
213
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).
214
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
+
215
219
  ## Examples
216
220
 
217
221
  [Read the examples on the wiki.](https://github.com/slhck/ffmpeg-normalize/wiki/examples)
@@ -402,6 +406,32 @@ For more information see the [API documentation](https://htmlpreview.github.io/?
402
406
 
403
407
  ## FAQ
404
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
+
405
435
  ### The program doesn't work because the "loudnorm" filter can't be found
406
436
 
407
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.
@@ -414,13 +444,15 @@ If you have to use an outdated ffmpeg version, you can only use `rms` or `peak`
414
444
 
415
445
  ### Should I use this to normalize my music collection?
416
446
 
447
+ Generally, no.
448
+
417
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/).
418
450
 
419
451
  ### Why are my output files MKV?
420
452
 
421
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.
422
454
 
423
- ### "Could not write header for output file" error
455
+ ### I get a "Could not write header for output file" error
424
456
 
425
457
  See the [next section](#the-conversion-does-not-work-and-i-get-a-cryptic-ffmpeg-error).
426
458
 
@@ -516,6 +548,7 @@ If you found this program useful and feel like giving back, feel free to send a
516
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>
517
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>
518
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>
519
552
  </tr>
520
553
  </tbody>
521
554
  <tfoot>
@@ -563,6 +596,24 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
563
596
  # Changelog
564
597
 
565
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
+
610
+ ## v1.28.2 (2024-06-22)
611
+
612
+ * Provide an entrypoint for the Docker image.
613
+
614
+ * Add docker push (#261)
615
+
616
+
566
617
  ## v1.28.1 (2024-05-15)
567
618
 
568
619
  * Fix assignment of audio statistics, fixes #257.
@@ -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=GNxoM8SI2qRTXk0Hyl17OqL1txdSUOLdXssQ5A6aSVU,23
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.1.dist-info/LICENSE,sha256=zeqAHGWrSIwdPHsZMZv1_N0gGFO1xxjcZEz9CplR4EM,1086
12
- ffmpeg_normalize-1.28.1.dist-info/METADATA,sha256=jnU_otZQTVQmuDli7HJrUBF4dnpS4ct5ffq3x5-EaPA,50941
13
- ffmpeg_normalize-1.28.1.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
14
- ffmpeg_normalize-1.28.1.dist-info/entry_points.txt,sha256=X0EC5ptb0iGOxrk3Aa65dVQtvUixngLd_2-iAtSixdc,68
15
- ffmpeg_normalize-1.28.1.dist-info/top_level.txt,sha256=wnUkr17ckPrrU1JsxZQiXbEBUnHKsC64yck-MemEBuI,17
16
- ffmpeg_normalize-1.28.1.dist-info/RECORD,,
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,,