ffmpeg-normalize 1.32.5__py3-none-any.whl → 1.33.1__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,8 +1,11 @@
1
+ import importlib.metadata
2
+
1
3
  from ._errors import FFmpegNormalizeError
2
4
  from ._ffmpeg_normalize import FFmpegNormalize
3
5
  from ._media_file import MediaFile
4
6
  from ._streams import AudioStream, MediaStream, SubtitleStream, VideoStream
5
- from ._version import __version__
7
+
8
+ __version__ = importlib.metadata.version("ffmpeg-normalize")
6
9
 
7
10
  __module_name__ = "ffmpeg_normalize"
8
11
 
@@ -13,7 +13,11 @@ from typing import NoReturn
13
13
  from ._errors import FFmpegNormalizeError
14
14
  from ._ffmpeg_normalize import NORMALIZATION_TYPES, FFmpegNormalize
15
15
  from ._logger import setup_cli_logger
16
- from ._version import __version__
16
+
17
+ # Import version from package
18
+ import importlib.metadata
19
+
20
+ __version__ = importlib.metadata.version("ffmpeg-normalize")
17
21
 
18
22
  _logger = logging.getLogger(__name__)
19
23
 
@@ -52,7 +56,12 @@ def create_parser() -> argparse.ArgumentParser:
52
56
  )
53
57
 
54
58
  group_io = parser.add_argument_group("File Input/output")
55
- group_io.add_argument("input", nargs="+", help="Input media file(s)")
59
+ group_io.add_argument("input", nargs="*", help="Input media file(s)")
60
+ group_io.add_argument(
61
+ "--input-list",
62
+ type=str,
63
+ help="Path to a text file containing a line-separated list of input files",
64
+ )
56
65
  group_io.add_argument(
57
66
  "-o",
58
67
  "--output",
@@ -583,7 +592,18 @@ def main() -> None:
583
592
  "Will apply default file naming for the remaining ones."
584
593
  )
585
594
 
586
- for index, input_file in enumerate(cli_args.input):
595
+ # Collect input files from positional args and --input-list
596
+ input_files = list(cli_args.input) if cli_args.input else []
597
+ if cli_args.input_list:
598
+ if not os.path.exists(cli_args.input_list):
599
+ error(f"Input list file '{cli_args.input_list}' does not exist")
600
+ with open(cli_args.input_list, "r") as f:
601
+ input_files.extend([line.strip() for line in f if line.strip()])
602
+
603
+ if not input_files:
604
+ error("No input files specified. Use positional arguments or --input-list.")
605
+
606
+ for index, input_file in enumerate(input_files):
587
607
  if cli_args.output is not None and index < len(cli_args.output):
588
608
  if cli_args.output_folder and cli_args.output_folder != "normalized":
589
609
  _logger.warning(
@@ -624,7 +624,11 @@ class MediaFile:
624
624
  raise e
625
625
  else:
626
626
  # only move the temp file if it's not a null device and ReplayGain is not enabled!
627
- if self.output_file != os.devnull and temp_file and not self.ffmpeg_normalize.replaygain:
627
+ if (
628
+ self.output_file != os.devnull
629
+ and temp_file
630
+ and not self.ffmpeg_normalize.replaygain
631
+ ):
628
632
  _logger.debug(
629
633
  f"Moving temporary file from {temp_file} to {self.output_file}"
630
634
  )
@@ -462,7 +462,7 @@ class AudioStream(MediaStream):
462
462
  )
463
463
  self.loudness_statistics["ebu_pass1"]["input_i"] = 0
464
464
 
465
- will_use_dynamic_mode = self.media_file.ffmpeg_normalize.dynamic
465
+ will_use_dynamic_mode: bool = self.media_file.ffmpeg_normalize.dynamic
466
466
 
467
467
  if self.media_file.ffmpeg_normalize.keep_loudness_range_target:
468
468
  _logger.debug(
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: ffmpeg-normalize
3
+ Version: 1.33.1
4
+ Summary: Normalize audio via ffmpeg
5
+ Keywords: ffmpeg,normalize,audio
6
+ Author: Werner Robitza
7
+ Author-email: Werner Robitza <werner.robitza@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE.md
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Multimedia :: Sound/Audio
13
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
14
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Conversion
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Natural Language :: English
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Requires-Dist: tqdm>=4.64.1
24
+ Requires-Dist: colorama>=0.4.6 ; sys_platform == 'win32'
25
+ Requires-Dist: ffmpeg-progress-yield>=1.0.1
26
+ Requires-Dist: colorlog==6.7.0
27
+ Requires-Dist: mutagen>=1.47.0
28
+ Requires-Python: >=3.9
29
+ Project-URL: Homepage, https://github.com/slhck/ffmpeg-normalize
30
+ Project-URL: Repository, https://github.com/slhck/ffmpeg-normalize
31
+ Description-Content-Type: text/markdown
32
+
33
+ # ffmpeg-normalize
34
+
35
+ [![PyPI version](https://img.shields.io/pypi/v/ffmpeg-normalize.svg)](https://pypi.org/project/ffmpeg-normalize)
36
+ ![Docker Image Version](https://img.shields.io/docker/v/slhck/ffmpeg-normalize?sort=semver&label=Docker%20image)
37
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/slhck/ffmpeg-normalize/python-package.yml)
38
+
39
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
40
+ [![All Contributors](https://img.shields.io/badge/all_contributors-22-orange.svg?style=flat-square)](#contributors-)
41
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
42
+
43
+ A utility for batch-normalizing audio using ffmpeg.
44
+
45
+ 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.
46
+
47
+ ## ✨ Features
48
+
49
+ - EBU R128 loudness normalization (two-pass by default, with an option for one-pass dynamic normalization)
50
+ - RMS-based normalization
51
+ - Peak normalization
52
+ - Video file support
53
+ - Docker support
54
+ - Python API
55
+
56
+ ## 🚀 Quick Start
57
+
58
+ 1. Install a recent version of [ffmpeg](https://ffmpeg.org/download.html)
59
+ 2. Run `pip3 install ffmpeg-normalize` and `ffmpeg-normalize /path/to/your/file.mp4`, alternatively install [`uv`](https://docs.astral.sh/uv/getting-started/installation/) and run `uvx ffmpeg-normalize /path/to/your/file.mp4`
60
+ 3. Done! 🎧 (the normalized file will be called `normalized/file.mkv`)
61
+
62
+ ## 📓 Documentation
63
+
64
+ Check out our [documentation](https://slhck.info/ffmpeg-normalize/) for more info!
65
+
66
+ ## 🤝 Contributors
67
+
68
+ The only reason this project exists in its current form is because [@benjaoming](https://github.com/slhck/ffmpeg-normalize/issues?q=is%3Apr+author%3Abenjaoming)'s initial PRs. Thanks for everyone's support!
69
+
70
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
71
+ <!-- prettier-ignore-start -->
72
+ <!-- markdownlint-disable -->
73
+ <table>
74
+ <tbody>
75
+ <tr>
76
+ <td align="center" valign="top" width="14.28%"><a href="https://overtag.dk/"><img src="https://avatars.githubusercontent.com/u/374612?v=4?s=100" width="100px;" alt="Benjamin Balder Bach"/><br /><sub><b>Benjamin Balder Bach</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=benjaoming" title="Code">💻</a></td>
77
+ <td align="center" valign="top" width="14.28%"><a href="https://chaos.social/@eleni"><img src="https://avatars.githubusercontent.com/u/511547?v=4?s=100" width="100px;" alt="Eleni Lixourioti"/><br /><sub><b>Eleni Lixourioti</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=Geekfish" title="Code">💻</a></td>
78
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/thenewguy"><img src="https://avatars.githubusercontent.com/u/77731?v=4?s=100" width="100px;" alt="thenewguy"/><br /><sub><b>thenewguy</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=thenewguy" title="Code">💻</a></td>
79
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/aviolo"><img src="https://avatars.githubusercontent.com/u/560229?v=4?s=100" width="100px;" alt="Anthony Violo"/><br /><sub><b>Anthony Violo</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=aviolo" title="Code">💻</a></td>
80
+ <td align="center" valign="top" width="14.28%"><a href="https://jacobs.af/"><img src="https://avatars.githubusercontent.com/u/952830?v=4?s=100" width="100px;" alt="Eric Jacobs"/><br /><sub><b>Eric Jacobs</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=jetpks" title="Code">💻</a></td>
81
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/kostalski"><img src="https://avatars.githubusercontent.com/u/34033008?v=4?s=100" width="100px;" alt="kostalski"/><br /><sub><b>kostalski</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=kostalski" title="Code">💻</a></td>
82
+ <td align="center" valign="top" width="14.28%"><a href="http://justinppearson.com/"><img src="https://avatars.githubusercontent.com/u/8844823?v=4?s=100" width="100px;" alt="Justin Pearson"/><br /><sub><b>Justin Pearson</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=justinpearson" title="Code">💻</a></td>
83
+ </tr>
84
+ <tr>
85
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/Nottt"><img src="https://avatars.githubusercontent.com/u/13532436?v=4?s=100" width="100px;" alt="ad90xa0-aa"/><br /><sub><b>ad90xa0-aa</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=Nottt" title="Code">💻</a></td>
86
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/Mathijsz"><img src="https://avatars.githubusercontent.com/u/1891187?v=4?s=100" width="100px;" alt="Mathijs"/><br /><sub><b>Mathijs</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=Mathijsz" title="Code">💻</a></td>
87
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/mpuels"><img src="https://avatars.githubusercontent.com/u/2924816?v=4?s=100" width="100px;" alt="Marc Püls"/><br /><sub><b>Marc Püls</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=mpuels" title="Code">💻</a></td>
88
+ <td align="center" valign="top" width="14.28%"><a href="http://www.mvbattista.com/"><img src="https://avatars.githubusercontent.com/u/158287?v=4?s=100" width="100px;" alt="Michael V. Battista"/><br /><sub><b>Michael V. Battista</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=mvbattista" title="Code">💻</a></td>
89
+ <td align="center" valign="top" width="14.28%"><a href="http://auto-editor.com"><img src="https://avatars.githubusercontent.com/u/57511737?v=4?s=100" width="100px;" alt="WyattBlue"/><br /><sub><b>WyattBlue</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=WyattBlue" title="Code">💻</a></td>
90
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/g3n35i5"><img src="https://avatars.githubusercontent.com/u/17593457?v=4?s=100" width="100px;" alt="Jan-Frederik Schmidt"/><br /><sub><b>Jan-Frederik Schmidt</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=g3n35i5" title="Code">💻</a></td>
91
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/mjhalwa"><img src="https://avatars.githubusercontent.com/u/8994014?v=4?s=100" width="100px;" alt="mjhalwa"/><br /><sub><b>mjhalwa</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=mjhalwa" title="Code">💻</a></td>
92
+ </tr>
93
+ <tr>
94
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/07416"><img src="https://avatars.githubusercontent.com/u/14923168?v=4?s=100" width="100px;" alt="07416"/><br /><sub><b>07416</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=07416" title="Documentation">📖</a></td>
95
+ <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>
96
+ <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>
97
+ <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>
98
+ <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>
99
+ <td align="center" valign="top" width="14.28%"><a href="https://ahmetsait.com/"><img src="https://avatars.githubusercontent.com/u/8372246?v=4?s=100" width="100px;" alt="Ahmet Sait"/><br /><sub><b>Ahmet Sait</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=ahmetsait" title="Code">💻</a></td>
100
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/georgev93"><img src="https://avatars.githubusercontent.com/u/39860568?v=4?s=100" width="100px;" alt="georgev93"/><br /><sub><b>georgev93</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=georgev93" title="Code">💻</a></td>
101
+ </tr>
102
+ <tr>
103
+ <td align="center" valign="top" width="14.28%"><a href="https://davidbern.com/"><img src="https://avatars.githubusercontent.com/u/371066?v=4?s=100" width="100px;" alt="David Bern"/><br /><sub><b>David Bern</b></sub></a><br /><a href="https://github.com/slhck/ffmpeg-normalize/commits?author=odie5533" title="Code">💻</a></td>
104
+ </tr>
105
+ </tbody>
106
+ <tfoot>
107
+ <tr>
108
+ <td align="center" size="13px" colspan="7">
109
+ <img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
110
+ <a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
111
+ </img>
112
+ </td>
113
+ </tr>
114
+ </tfoot>
115
+ </table>
116
+
117
+ <!-- markdownlint-restore -->
118
+ <!-- prettier-ignore-end -->
119
+
120
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
@@ -0,0 +1,14 @@
1
+ ffmpeg_normalize/__init__.py,sha256=l0arjiMMBNbiH3IH67gT6SdZjPGAVLAdorUx38dNtvE,508
2
+ ffmpeg_normalize/__main__.py,sha256=tUb8aJN0zh1F-QCYwg4vZlGwxqbMd3r4JgUv-5YIjvU,20720
3
+ ffmpeg_normalize/_cmd_utils.py,sha256=1JspVpguAPsq7DqvyvjUNzHhVv8J3X93xNOMwito_jY,5284
4
+ ffmpeg_normalize/_errors.py,sha256=brTQ4osJ4fTA8wnyMPVVYfGwJ0wqeShRFydTEwi_VEY,48
5
+ ffmpeg_normalize/_ffmpeg_normalize.py,sha256=_ZK2P3kAM0mnxY3iCYH61T6jhMndTdO2Rqh03vJo7rY,11852
6
+ ffmpeg_normalize/_logger.py,sha256=3Ap4Fxg7xGrzz7h4IGuNEf0KKstx0Rq_eLbHPrHzcrI,1841
7
+ ffmpeg_normalize/_media_file.py,sha256=pPRPNs1oxpMC6f_Cgsu8F9mMJlncjw6OP0cDk9rQMPY,26387
8
+ ffmpeg_normalize/_streams.py,sha256=hYqQiiVMJd-TrreHbrQertUnc4lQ9BPvBmDPKSr4o70,21596
9
+ ffmpeg_normalize/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ ffmpeg_normalize-1.33.1.dist-info/licenses/LICENSE.md,sha256=ig-_YggmJGbPQC_gUgBNFa0_XMsuHTpocivFnlOF4tE,1082
11
+ ffmpeg_normalize-1.33.1.dist-info/WHEEL,sha256=NHRAbdxxzyL9K3IO2LjmlNqKSyPZnKv2BD16YYVKo18,79
12
+ ffmpeg_normalize-1.33.1.dist-info/entry_points.txt,sha256=1bdrW7-kJRc8tctjnGcfe_Fwx39z5JOm0yZnJHnmwl8,69
13
+ ffmpeg_normalize-1.33.1.dist-info/METADATA,sha256=KycBJs9LX83nBZE0Aw81cf1Mep1KUDYVxjSHjQKKm80,11374
14
+ ffmpeg_normalize-1.33.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.8.14
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
2
  ffmpeg-normalize = ffmpeg_normalize.__main__:main
3
+
@@ -0,0 +1,9 @@
1
+ # License
2
+
3
+ ffmpeg-normalize, Copyright (c) Werner Robitza
4
+
5
+ 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:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ 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.
@@ -1 +0,0 @@
1
- __version__ = "1.32.5"